r16417 by craig - #9787: Apply patch to allow multiple text frame clearing now undo works
scribus-commit
scribus-commit at lists.scribus.net
Sun Mar 6 17:45:57 CET 2011
Author: craig
Date: Sun Mar 6 16:45:57 2011
New Revision: 16417
URL: http://scribus.info/websvn/listing.php?repname=Scribus&sc=1&rev=16417
Log:
#9787: Apply patch to allow multiple text frame clearing now undo works
Modified:
branches/Version135/Scribus/scribus/scribusdoc.cpp
Modified: branches/Version135/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.info/websvn/diff.php?repname=Scribus&rev=16417&path=/branches/Version135/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version135/Scribus/scribus/scribusdoc.cpp Sun Mar 6 16:45:57 2011
@@ -7295,6 +7295,8 @@
if (selectedItemCount != 0)
{
PageItem *currItem;
+ bool userDecide = false;
+ bool userWantClear = true;
for (uint i = 0; i < selectedItemCount; ++i)
{
currItem = itemSelection->itemAt(i);
@@ -7302,20 +7304,25 @@
{
if ((ScCore->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PictureIsAvailable))
ScCore->fileWatcher->removeFile(currItem->Pfile);
+ currItem->clearContents();
}
else
- if (currItem->asTextFrame() && ScCore->usingGUI())
- {
- if (currItem->itemText.length() != 0 && (currItem->nextInChain() == 0 || currItem->prevInChain() == 0))
+ if (currItem->asTextFrame())
+ {
+ if (ScCore->usingGUI() && (! userDecide))
{
- int t = ScMessageBox::warning(m_ScMW, CommonStrings::trWarning,
+ if (currItem->itemText.length() != 0 && (currItem->nextInChain() == 0 || currItem->prevInChain() == 0))
+ {
+ int t = ScMessageBox::warning(m_ScMW, CommonStrings::trWarning,
tr("Do you really want to clear all your text?"),
QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
- if (t == QMessageBox::No)
- continue;
+ userWantClear = (t != QMessageBox::No);
+ userDecide = true;
+ }
}
- }
- currItem->clearContents();
+ if (userWantClear)
+ currItem->clearContents();
+ }
}
updateFrameItems();
regionsChanged()->update(QRectF());
More information about the scribus-commit
mailing list