summaryrefslogtreecommitdiffstats
path: root/scribus/pageitem.cpp
diff options
context:
space:
mode:
authorcraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-04-09 13:26:22 +0000
committercraig <craig@11d20701-8431-0410-a711-e3c959e3b870>2012-04-09 13:26:22 +0000
commitb252275b0c7d1a59082e7f1c64d984c2acbe5beb (patch)
tree12a1a61bd17239528f795473684b40f79017c565 /scribus/pageitem.cpp
parent448972858a4deb471b2a00fe28613ea07d43eb17 (diff)
downloadscribus-b252275b0c7d1a59082e7f1c64d984c2acbe5beb.tar.gz
scribus-b252275b0c7d1a59082e7f1c64d984c2acbe5beb.tar.xz
scribus-b252275b0c7d1a59082e7f1c64d984c2acbe5beb.zip
#9046: Undoing path operations doesn't work as expected
git-svn-id: svn://scribus.net/branches/Version14x/Scribus@17423 11d20701-8431-0410-a711-e3c959e3b870
Diffstat (limited to 'scribus/pageitem.cpp')
-rw-r--r--scribus/pageitem.cpp33
1 files changed, 33 insertions, 0 deletions
diff --git a/scribus/pageitem.cpp b/scribus/pageitem.cpp
index 7c2fffe..db37354 100644
--- a/scribus/pageitem.cpp
+++ b/scribus/pageitem.cpp
@@ -3300,6 +3300,8 @@ void PageItem::restore(UndoState *state, bool isUndo)
restoreUnlinkTextFrame(ss, isUndo);
else if (ss->contains("REVERSE_TEXT"))
restoreReverseText(ss, isUndo);
+ else if (ss->contains("PATH_OPERATION"))
+ restorePathOperation(ss, isUndo);
}
if (!OnMasterPage.isEmpty())
m_Doc->setCurrentPage(oldCurrentPage);
@@ -3722,6 +3724,37 @@ void PageItem::restoreReverseText(UndoState *state, bool /*isUndo*/)
Reverse = !Reverse;
}
+void PageItem::restorePathOperation(UndoState *state, bool isUndo)
+{//PATH_OPERATION
+ ItemState<QPair<QPair<FPointArray, FPointArray>, QPair<FPointArray, FPointArray> > >*is = dynamic_cast<ItemState<QPair<QPair<FPointArray, FPointArray>, QPair<FPointArray, FPointArray> > >*>(state);
+ if (is)
+ {
+ if (isUndo)
+ {
+ this->ClipEdited=is->getBool("PATH_OP_OLD_CLIPEDITED");
+ this->Frame=is->getBool("PATH_OP_OLD_FRAME");
+ this->FrameType=is->getInt("PATH_OP_OLD_FRAMETYPE");
+ this->OldB2=is->getDouble("PATH_OP_OLD_OLDB2");
+ this->OldH2=is->getDouble("PATH_OP_OLD_OLDH2");
+ QPair<FPointArray, FPointArray> oldLines=is->getItem().first;
+ this->PoLine = oldLines.first;
+ this->ContourLine = oldLines.second;
+ }
+ else
+ {
+ this->ClipEdited=is->getBool("PATH_OP_NEW_CLIPEDITED");
+ this->Frame=is->getBool("PATH_OP_NEW_FRAME");
+ this->FrameType=is->getInt("PATH_OP_NEW_FRAMETYPE");
+ this->OldB2=is->getDouble("PATH_OP_NEW_OLDB2");
+ this->OldH2=is->getDouble("PATH_OP_NEW_OLDH2");
+ QPair<FPointArray, FPointArray> newLines=is->getItem().second;
+ this->PoLine = newLines.first;
+ this->ContourLine = newLines.second;
+ }
+ this->updateClip();
+ }
+}
+
void PageItem::restorePoly(SimpleState *state, bool isUndo, bool isContour)
{
int mode = state->getInt("MODE");