+ fix undo/redo issues with ortho views

This commit is contained in:
wmayer
2015-01-03 22:39:07 +01:00
parent 56234513b3
commit 553ddff9c1
2 changed files with 14 additions and 3 deletions

View File

@@ -268,11 +268,13 @@ OrthoViews::OrthoViews(const char * pagename, const char * partname)
part_name = partname;
parent_doc = App::GetApplication().getActiveDocument();
parent_doc->openTransaction("Create view");
part = parent_doc->getObject(partname);
bbox.Add(static_cast<Part::Feature*>(part)->Shape.getBoundingBox());
page = parent_doc->getObject(pagename);
Gui::Application::Instance->showViewProvider(page);
load_page();
min_space = 15; // should be preferenced
@@ -1343,12 +1345,18 @@ void TaskDlgOrthoViews::clicked(int)
bool TaskDlgOrthoViews::accept()
{
bool check = widget->user_input();
App::Document* doc = App::GetApplication().getDocument(this->getDocumentName().c_str());
if (doc)
doc->commitTransaction();
return !check;
}
bool TaskDlgOrthoViews::reject()
{
widget->clean_up();
App::Document* doc = App::GetApplication().getDocument(this->getDocumentName().c_str());
if (doc)
doc->abortTransaction();
return true;
}