Gui: prevent crashes on MacOS using boost::format

This commit is contained in:
0penBrain
2023-03-30 19:00:18 +02:00
parent 5329cede7f
commit 8bea52a5bf
5 changed files with 56 additions and 56 deletions

View File

@@ -806,7 +806,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
if (GeoId != Sketcher::GeoEnum::GeoUndef && PosId != Sketcher::PointPos::none) {
getDocument()->openCommand(QT_TRANSLATE_NOOP("Command", "Drag Point"));
try {
Gui::cmdAppObjectArgs(getObject(), "movePoint(%i,%i,App.Vector(%f,%f,0),%i)"
Gui::cmdAppObjectArgs(getObject(), "movePoint(%d,%d,App.Vector(%f,%f,0),%d)"
,GeoId, static_cast<int>(PosId), x-drag.xInit, y-drag.yInit, 0);
getDocument()->commitCommand();
@@ -867,7 +867,7 @@ bool ViewProviderSketch::mouseButtonPressed(int Button, bool pressed, const SbVe
}
try {
Gui::cmdAppObjectArgs(getObject(), "movePoint(%i,%i,App.Vector(%f,%f,0),%i)"
Gui::cmdAppObjectArgs(getObject(), "movePoint(%d,%d,App.Vector(%f,%f,0),%d)"
,drag.DragCurve, static_cast<int>(Sketcher::PointPos::none), vec.x, vec.y, drag.relative ? 1 : 0);
getDocument()->commitCommand();
@@ -3384,7 +3384,7 @@ bool ViewProviderSketch::onDelete(const std::vector<std::string> &subList)
for (rit = delConstraints.rbegin(); rit != delConstraints.rend(); ++rit) {
try {
Gui::cmdAppObjectArgs(getObject(), "delConstraint(%i)", *rit);
Gui::cmdAppObjectArgs(getObject(), "delConstraint(%d)", *rit);
}
catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what());
@@ -3408,7 +3408,7 @@ bool ViewProviderSketch::onDelete(const std::vector<std::string> &subList)
if (((*it)->Type == Sketcher::Coincident) && (((*it)->First == GeoId && (*it)->FirstPos == PosId) ||
((*it)->Second == GeoId && (*it)->SecondPos == PosId)) ) {
try {
Gui::cmdAppObjectArgs(getObject(), "delConstraintOnPoint(%i,%i)", GeoId, (int)PosId);
Gui::cmdAppObjectArgs(getObject(), "delConstraintOnPoint(%d,%d)", GeoId, (int)PosId);
}
catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what());
@@ -3443,7 +3443,7 @@ bool ViewProviderSketch::onDelete(const std::vector<std::string> &subList)
for (rit = delExternalGeometries.rbegin(); rit != delExternalGeometries.rend(); ++rit) {
try {
Gui::cmdAppObjectArgs(getObject(), "delExternal(%i)", *rit);
Gui::cmdAppObjectArgs(getObject(), "delExternal(%d)", *rit);
}
catch (const Base::Exception& e) {
Base::Console().Error("%s\n", e.what());