r22896 by jghali - #15604: wrong undo when resizing multiple items
scribus-commit
scribus-commit at lists.scribus.net
Fri Mar 15 13:18:09 UTC 2019
Author: jghali
Date: Fri Mar 15 13:18:09 2019
New Revision: 22896
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22896
Log:
#15604: wrong undo when resizing multiple items
Modified:
trunk/Scribus/scribus/scribusdoc.cpp
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22896&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Fri Mar 15 13:18:09 2019
@@ -14366,7 +14366,8 @@
{
if (currItem->isArc())
return;
- m_undoManager->setUndoEnabled(false);
+ // Added by r17735: why? this break resizing of multiple item selections
+ //m_undoManager->setUndoEnabled(false);
bool siz = currItem->Sizing;
currItem->Sizing = false;
if ((!(currItem->isGroup() || currItem->isSymbol())) || includeGroup)
@@ -14439,7 +14440,8 @@
currItem->Clip = FlattenPath(currItem->PoLine, currItem->Segments);
currItem->updateGradientVectors();
currItem->Sizing = siz;
- m_undoManager->setUndoEnabled(true);
+ // Added by r17735: why? this break resizing of multiple item selections
+ //m_undoManager->setUndoEnabled(true);
}
void ScribusDoc::moveGroup(double x, double y, Selection* customSelection)
@@ -14555,6 +14557,10 @@
double origGW = gw;
double origGH = gh;
updateManager()->setUpdatesDisabled();
+
+ UndoTransaction activeTransaction;
+ if (UndoManager::undoEnabled())
+ activeTransaction = m_undoManager->beginTransaction(Um::Selection, Um::IResize, Um::Resize, "", Um::IResize);
for (int i = 0; i < selectedItemCount; ++i)
{
@@ -14700,6 +14706,9 @@
bb->updatePolyClip();
}
}
+
+ bb->checkChanges();
+
bb->setImageXYOffset(oldLocalX, oldLocalY);
bb->OldB2 = bb->width();
bb->OldH2 = bb->height();
@@ -14763,6 +14772,9 @@
currItem->gWidth = gw;
currItem->gHeight = gh;
}
+
+ if (activeTransaction)
+ activeTransaction.commit();
// FIXME:av emit DocChanged();
}
More information about the scribus-commit
mailing list