Skip to content

Commit

Permalink
Fix in Drawing page object - fixes #1540
Browse files Browse the repository at this point in the history
* Changing the editable texts updates the page automatically
* Added a doc.recompute() after creating a new page
  • Loading branch information
yorikvanhavre committed Aug 7, 2014
1 parent e0bdc07 commit dc3ebfb
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/Mod/Drawing/App/FeaturePage.cpp
Expand Up @@ -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());
}
Expand Down
2 changes: 2 additions & 0 deletions src/Mod/Drawing/Gui/Command.cpp
Expand Up @@ -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 {
Expand Down Expand Up @@ -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();
}

Expand Down

0 comments on commit dc3ebfb

Please sign in to comment.