Fix in Drawing page object - fixes #1540

* Changing the editable texts updates the page automatically
* Added a doc.recompute() after creating a new page
This commit is contained in:
Yorik van Havre 2014-08-07 10:39:33 -03:00
parent e0bdc07c4d
commit dc3ebfb502
2 changed files with 8 additions and 2 deletions

View File

@ -76,8 +76,12 @@ void FeaturePage::onChanged(const App::Property* prop)
if (!fi.exists())
return;
}
}
if (prop == &Template) {
} else if (prop == &EditableTexts) {
if (!this->isRestoring()) {
this->execute();
return;
}
} else if (prop == &Template) {
if (!this->isRestoring()) {
EditableTexts.setValues(getEditableTextsFromTemplate());
}

View File

@ -104,6 +104,7 @@ void CmdDrawingNewPage::activated(int iMsg)
openCommand("Drawing create page");
doCommand(Doc,"App.activeDocument().addObject('Drawing::FeaturePage','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Template = '%s'",FeatName.c_str(), (const char*)tfi.filePath().toUtf8());
doCommand(Doc,"App.activeDocument().recompute()");
commitCommand();
}
else {
@ -231,6 +232,7 @@ void CmdDrawingNewA3Landscape::activated(int iMsg)
openCommand("Drawing create page");
doCommand(Doc,"App.activeDocument().addObject('Drawing::FeaturePage','%s')",FeatName.c_str());
doCommand(Doc,"App.activeDocument().%s.Template = 'A3_Landscape.svg'",FeatName.c_str());
doCommand(Doc,"App.activeDocument().recompute()");
commitCommand();
}