r18146 by fschmid - Fixed Bug #11244: clear contents: remove confirmation dialog when clearing contents of multiple frames

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 16 09:33:38 UTC 2013


Author: fschmid
Date: Sat Feb 16 09:33:37 2013
New Revision: 18146

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18146
Log:
Fixed Bug #11244: clear contents: remove confirmation dialog when clearing contents of multiple frames

Modified:
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18146&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Sat Feb 16 09:33:37 2013
@@ -11339,30 +11339,21 @@
 	assert(itemSelection != 0);
 
 	uint selectedItemCount = itemSelection->count();
-	if (selectedItemCount <= 0) return;
-
-	PageItem *currItem;
-	bool applyToAll = false;
+	if (selectedItemCount <= 0)
+		return;
+	if (ScCore->usingGUI())
+	{
+		int t = QMessageBox::warning(m_ScMW, CommonStrings::trWarning, tr("Do you really want to clear the content of all selected frames?"),  QMessageBox::Yes, QMessageBox::No | QMessageBox::Default);
+		if (t == QMessageBox::No)
+			return;
+	}
 	for (uint i = 0; i < selectedItemCount; ++i)
 	{
-		currItem = itemSelection->itemAt(i);
+		PageItem *currItem = itemSelection->itemAt(i);
 		if (currItem->asImageFrame())
 		{
 			if ((ScCore->fileWatcher->files().contains(currItem->Pfile) != 0) && (currItem->PictureIsAvailable))
 				ScCore->fileWatcher->removeFile(currItem->Pfile);
-		}
-		else if (currItem->asTextFrame() && ScCore->usingGUI() && (!applyToAll))
-		{
-			if (currItem->itemText.length() != 0 && (currItem->nextInChain() == 0 || currItem->prevInChain() == 0))
-			{
-				int btnYesToAll = (i < (selectedItemCount - 1)) ? QMessageBox::YesToAll : 0;
-				int t = QMessageBox::warning(m_ScMW, CommonStrings::trWarning,
-									tr("Do you really want to clear all your text?"),
-									QMessageBox::Yes, QMessageBox::No | QMessageBox::Default, btnYesToAll);
-				if (t == QMessageBox::No)
-					continue;
-				applyToAll = (t == QMessageBox::YesToAll);
-			}
 		}
 		currItem->clearContents();
 	}




More information about the scribus-commit mailing list