Skip to content

Commit

Permalink
+ fixes #2064: Editable text changes in drawing template not restored.
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed May 2, 2015
1 parent 894e660 commit 74c912f
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Mod/Drawing/App/FeaturePage.cpp
Expand Up @@ -106,13 +106,18 @@ void FeaturePage::onChanged(const App::Property* prop)

void FeaturePage::onDocumentRestored()
{
// Needs to be tmp. set because otherwise the custom text gets overridden (#0002064)
this->StatusBits.set(4); // the 'Restore' flag

Base::FileInfo fi(PageResult.getValue());
std::string path = App::Application::getResourceDir() + "Mod/Drawing/Templates/" + fi.fileName();
// try to find the template in user dir/Templates first
Base::FileInfo tempfi(App::Application::getUserAppDataDir() + "Templates/" + fi.fileName());
if (tempfi.exists())
path = tempfi.filePath();
Template.setValue(path);

this->StatusBits.reset(4); // the 'Restore' flag
}

App::DocumentObjectExecReturn *FeaturePage::execute(void)
Expand Down

0 comments on commit 74c912f

Please sign in to comment.