Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gui: prevent crashes on MacOS using boost::format #9126

Merged
merged 1 commit into from Mar 31, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/Mod/Part/Gui/TaskOffset.cpp
Expand Up @@ -37,20 +37,20 @@
#include <Mod/Part/App/FeatureOffset.h>

#include "TaskOffset.h"
#include "ui_TaskOffset.h"

Check failure on line 40 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

'ui_TaskOffset.h' file not found [clang-diagnostic-error]


using namespace PartGui;

class OffsetWidget::Private

Check warning on line 45 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

class 'Private' defines a non-default destructor but does not define a copy constructor, a copy assignment operator, a move constructor or a move assignment operator [cppcoreguidelines-special-member-functions]
{
public:
Ui_TaskOffset ui;
Part::Offset* offset;

Check warning on line 49 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

use default member initializer for 'offset' [modernize-use-default-member-init]
Private() : offset(nullptr)
{
}
~Private()

Check warning on line 53 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

use '= default' to define a trivial destructor [modernize-use-equals-default]
{
}
};
Expand All @@ -68,12 +68,12 @@
d->ui.setupUi(this);
d->ui.spinOffset->setUnit(Base::Unit::Length);
d->ui.spinOffset->setRange(-INT_MAX, INT_MAX);
d->ui.spinOffset->setSingleStep(0.1);

Check warning on line 71 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

0.1 is a magic number; consider replacing it with a named constant [cppcoreguidelines-avoid-magic-numbers,readability-magic-numbers]
d->ui.facesButton->hide();

bool is_2d = d->offset->isDerivedFrom(Part::Offset2D::getClassTypeId());
d->ui.selfIntersection->setVisible(!is_2d);
if(is_2d)

Check warning on line 76 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

statement should be inside braces [readability-braces-around-statements]
d->ui.modeType->removeItem(2);//remove Recto-Verso mode, not supported by 2d offset

//block signals to fill values read out from feature...
Expand All @@ -91,10 +91,10 @@
d->ui.intersection->setChecked(offset->Intersection.getValue());
d->ui.selfIntersection->setChecked(offset->SelfIntersection.getValue());
long mode = offset->Mode.getValue();
if (mode >= 0 && mode < d->ui.modeType->count())

Check warning on line 94 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

statement should be inside braces [readability-braces-around-statements]
d->ui.modeType->setCurrentIndex(mode);
long join = offset->Join.getValue();
if (join >= 0 && join < d->ui.joinType->count())

Check warning on line 97 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

statement should be inside braces [readability-braces-around-statements]
d->ui.joinType->setCurrentIndex(join);

//unblock signals
Expand Down Expand Up @@ -122,21 +122,21 @@
void OffsetWidget::on_spinOffset_valueChanged(double val)
{
d->offset->Value.setValue(val);
if (d->ui.updateView->isChecked())

Check warning on line 125 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

statement should be inside braces [readability-braces-around-statements]
d->offset->getDocument()->recomputeFeature(d->offset);
}

void OffsetWidget::on_modeType_activated(int val)
{
d->offset->Mode.setValue(val);
if (d->ui.updateView->isChecked())

Check warning on line 132 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

statement should be inside braces [readability-braces-around-statements]
d->offset->getDocument()->recomputeFeature(d->offset);
}

void OffsetWidget::on_joinType_activated(int val)
{
d->offset->Join.setValue((long)val);
if (d->ui.updateView->isChecked())

Check warning on line 139 in src/Mod/Part/Gui/TaskOffset.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

statement should be inside braces [readability-braces-around-statements]
d->offset->getDocument()->recomputeFeature(d->offset);
}

Expand Down Expand Up @@ -174,8 +174,8 @@
double offsetValue = d->ui.spinOffset->value().getValue();
Gui::cmdAppObjectArgs(d->offset, "Value = %f", offsetValue);
d->ui.spinOffset->apply();
Gui::cmdAppObjectArgs(d->offset, "Mode = %i", d->ui.modeType->currentIndex());
Gui::cmdAppObjectArgs(d->offset, "Join = %i", d->ui.joinType->currentIndex());
Gui::cmdAppObjectArgs(d->offset, "Mode = %d", d->ui.modeType->currentIndex());
Gui::cmdAppObjectArgs(d->offset, "Join = %d", d->ui.joinType->currentIndex());
Gui::cmdAppObjectArgs(d->offset, "Intersection = %s", d->ui.intersection->isChecked() ? "True" : "False");
Gui::cmdAppObjectArgs(d->offset, "SelfIntersection = %s", d->ui.selfIntersection->isChecked() ? "True" : "False");
Gui::cmdAppObjectArgs(d->offset, "Fill = %s", d->ui.fillOffset->isChecked() ? "True" : "False");
Expand Down
4 changes: 2 additions & 2 deletions src/Mod/Part/Gui/TaskThickness.cpp
Expand Up @@ -40,7 +40,7 @@
#include <Mod/Part/App/PartFeatures.h>

#include "TaskThickness.h"
#include "ui_TaskOffset.h"

Check failure on line 43 in src/Mod/Part/Gui/TaskThickness.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

'ui_TaskOffset.h' file not found [clang-diagnostic-error]


using namespace PartGui;
Expand Down Expand Up @@ -221,8 +221,8 @@
Gui::cmdAppObjectArgs(d->thickness, "Faces = %s", d->selection.c_str());
}
Gui::cmdAppObjectArgs(d->thickness, "Value = %f", d->ui.spinOffset->value().getValue());
Gui::cmdAppObjectArgs(d->thickness, "Mode = %i", d->ui.modeType->currentIndex());
Gui::cmdAppObjectArgs(d->thickness, "Join = %i", d->ui.joinType->currentIndex());
Gui::cmdAppObjectArgs(d->thickness, "Mode = %d", d->ui.modeType->currentIndex());
Gui::cmdAppObjectArgs(d->thickness, "Join = %d", d->ui.joinType->currentIndex());
Gui::cmdAppObjectArgs(d->thickness, "Intersection = %s",
d->ui.intersection->isChecked() ? "True" : "False");
Gui::cmdAppObjectArgs(d->thickness, "SelfIntersection = %s",
Expand Down