r19554 by craig - #12554: Rename Contents menu to Content, rework some indenting

scribus-commit scribus-commit at lists.scribus.net
Tue Oct 7 19:09:25 UTC 2014


Author: craig
Date: Tue Oct  7 19:09:25 2014
New Revision: 19554

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19554
Log:
#12554: Rename Contents menu to Content, rework some indenting

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/contextmenu.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19554&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Oct  7 19:09:25 2014
@@ -5032,74 +5032,72 @@
 	if (doc->appMode == modeEditClip)
 		view->requestMode(submodeEndNodeEdit);
 
-	if (!doc->m_Selection->isEmpty())
-	{
-//		QString BufferI = "";
-		PageItem *currItem = doc->m_Selection->itemAt(0);
-		if (((doc->appMode == modeEdit) || (doc->appMode == modeEditTable)) && (currItem->isTextFrame() || currItem->isTable()))
-		{
-			PageItem_TextFrame *cItem;
-			if (doc->appMode == modeEditTable)
-				cItem = currItem->asTable()->activeCell().textFrame();
-			else
-				cItem = currItem->asTextFrame();
-			if (cItem->HasSel)
-			{
-				StoryText itemText(doc);
-				itemText.setDefaultStyle(cItem->itemText.defaultStyle());
-				itemText.insert(0, cItem->itemText, true);
+	if (doc->m_Selection->isEmpty())
+		return;
+	PageItem *currItem = doc->m_Selection->itemAt(0);
+	if (((doc->appMode == modeEdit) || (doc->appMode == modeEditTable)) && (currItem->isTextFrame() || currItem->isTable()))
+	{
+		PageItem_TextFrame *cItem;
+		if (doc->appMode == modeEditTable)
+			cItem = currItem->asTable()->activeCell().textFrame();
+		else
+			cItem = currItem->asTextFrame();
+		if (cItem->HasSel)
+		{
+			StoryText itemText(doc);
+			itemText.setDefaultStyle(cItem->itemText.defaultStyle());
+			itemText.insert(0, cItem->itemText, true);
 //				BufferI = itemText.text(0, itemText.length());
-				std::ostringstream xmlString;
-				SaxXML xmlStream(xmlString);
-				xmlStream.beginDoc();
-				itemText.saxx(xmlStream, "SCRIBUSTEXT");
-				xmlStream.endDoc();
-				std::string xml(xmlString.str());
-				ScTextMimeData* mimeData = new ScTextMimeData();
-				mimeData->setScribusText( QByteArray(xml.c_str(), xml.length()) );
-				mimeData->setText( itemText.text(0, itemText.length()) );
-				QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
-			}
+			std::ostringstream xmlString;
+			SaxXML xmlStream(xmlString);
+			xmlStream.beginDoc();
+			itemText.saxx(xmlStream, "SCRIBUSTEXT");
+			xmlStream.endDoc();
+			std::string xml(xmlString.str());
+			ScTextMimeData* mimeData = new ScTextMimeData();
+			mimeData->setScribusText( QByteArray(xml.c_str(), xml.length()) );
+			mimeData->setText( itemText.text(0, itemText.length()) );
+			QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
+		}
+	}
+	else
+	{
+		if ((currItem->isSingleSel) && (currItem->isGroup()))
+			return;
+		//do not copy notes frames
+		if (doc->m_Selection->count() ==1 && currItem->isNoteFrame())
+			return;
+		//deselect notesframes
+		Selection tempSelection(*(doc->m_Selection));
+		for (int i = 0; i < doc->m_Selection->count(); ++i)
+		{
+			if (doc->m_Selection->itemAt(i)->isNoteFrame())
+				tempSelection.removeItem(doc->m_Selection->itemAt(i));
+		}
+		if (tempSelection.count() < doc->m_Selection->count())
+			*(doc->m_Selection) = tempSelection;
+
+		ScriXmlDoc ss;
+		QString BufferS = ss.WriteElem(doc, doc->m_Selection);
+		if (!internalCopy)
+		{
+			if ((prefsManager->appPrefs.scrapbookPrefs.doCopyToScrapbook) && (!internalCopy))
+			{
+				scrapbookPalette->ObjFromCopyAction(BufferS, currItem->itemName());
+				rebuildRecentPasteMenu();
+			}
+			ScElemMimeData* mimeData = new ScElemMimeData();
+			mimeData->setScribusElem(BufferS);
+			mimeData->setText(BufferS);
+			QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
 		}
 		else
-		{
-			if ((currItem->isSingleSel) && (currItem->isGroup()))
-				return;
-			//do not copy notes frames
-			if (doc->m_Selection->count() ==1 && currItem->isNoteFrame())
-				return;
-			//deselect notesframes
-			Selection tempSelection(*(doc->m_Selection));
-			for (int i = 0; i < doc->m_Selection->count(); ++i)
-			{
-				if (doc->m_Selection->itemAt(i)->isNoteFrame())
-					tempSelection.removeItem(doc->m_Selection->itemAt(i));
-			}
-			if (tempSelection.count() < doc->m_Selection->count())
-				*(doc->m_Selection) = tempSelection;
-
-			ScriXmlDoc ss;
-			QString BufferS = ss.WriteElem(doc, doc->m_Selection);
-			if (!internalCopy)
-			{
-				if ((prefsManager->appPrefs.scrapbookPrefs.doCopyToScrapbook) && (!internalCopy))
-				{
-					scrapbookPalette->ObjFromCopyAction(BufferS, currItem->itemName());
-					rebuildRecentPasteMenu();
-				}
-				ScElemMimeData* mimeData = new ScElemMimeData();
-				mimeData->setScribusElem(BufferS);
-				mimeData->setText(BufferS);
-				QApplication::clipboard()->setMimeData(mimeData, QClipboard::Clipboard);
-			}
-			else
-				internalCopyBuffer = BufferS;
-		}
-		if (!internalCopy)
-		{
-			scrActions["editPaste"]->setEnabled(true);
-			scrMenuMgr->setMenuEnabled("EditPasteRecent", scrapbookPalette->tempBView->objectMap.count() != 0);
-		}
+			internalCopyBuffer = BufferS;
+	}
+	if (!internalCopy)
+	{
+		scrActions["editPaste"]->setEnabled(true);
+		scrMenuMgr->setMenuEnabled("EditPasteRecent", scrapbookPalette->tempBView->objectMap.count() != 0);
 	}
 }
 

Modified: trunk/Scribus/scribus/ui/contextmenu.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19554&path=/trunk/Scribus/scribus/ui/contextmenu.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/contextmenu.cpp (original)
+++ trunk/Scribus/scribus/ui/contextmenu.cpp Tue Oct  7 19:09:25 2014
@@ -90,7 +90,7 @@
 	assert(m_doc!=0 && currItem!=0);
 	
 	QMenu *menuConvertTo = new QMenu(this);
-	QMenu *menuEditContents = new QMenu(this);
+	QMenu *menuEditContent = new QMenu(this);
 	QMenu *menuInfo = new QMenu(this);
 	QMenu *menuLayer = new QMenu(this);
 	QMenu *menuLevel = new QMenu(this);
@@ -162,42 +162,42 @@
 	if (m_actionList.contains("fileImportText"))
 	{
 		addSeparator();
-		menuEditContents->addAction(m_ScMW->scrActions["fileImportText"]);
-		menuEditContents->addAction(m_ScMW->scrActions["fileImportAppendText"]);
-		menuEditContents->addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
-		menuEditContents->addAction(m_ScMW->scrActions["insertSampleText"]);
-		menuEditContents->addSeparator();
+		menuEditContent->addAction(m_ScMW->scrActions["fileImportText"]);
+		menuEditContent->addAction(m_ScMW->scrActions["fileImportAppendText"]);
+		menuEditContent->addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
+		menuEditContent->addAction(m_ScMW->scrActions["insertSampleText"]);
+		menuEditContent->addSeparator();
 	}
 	else //enable this for, eg, text on a path
 		if (m_actionList.contains("toolsEditWithStoryEditor"))
 		{
 			addSeparator();
-			menuEditContents->addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
+			menuEditContent->addAction(m_ScMW->scrActions["toolsEditWithStoryEditor"]);
 		}
 	if (m_actionList.contains("fileImportImage"))
-		menuEditContents->addAction(m_ScMW->scrActions["fileImportImage"]);
+		menuEditContent->addAction(m_ScMW->scrActions["fileImportImage"]);
 	if (selectedItemCount==1 && currItem->asImageFrame())
 	{
 		if (QApplication::clipboard()->mimeData()->hasImage())
-			menuEditContents->addAction(m_ScMW->scrActions["editPasteImageFromClipboard"]);
+			menuEditContent->addAction(m_ScMW->scrActions["editPasteImageFromClipboard"]);
 	}
 	if (itemsAreSameType)
 	{
 		if (m_actionList.contains("editCopyContents"))
-			menuEditContents->addAction(m_ScMW->scrActions["editCopyContents"]);
+			menuEditContent->addAction(m_ScMW->scrActions["editCopyContents"]);
 		if (m_actionList.contains("editPasteContents"))
-			menuEditContents->addAction(m_ScMW->scrActions["editPasteContents"]);
+			menuEditContent->addAction(m_ScMW->scrActions["editPasteContents"]);
 		if (currItem->asImageFrame() && m_actionList.contains("editPasteContentsAbs"))
-			menuEditContents->addAction(m_ScMW->scrActions["editPasteContentsAbs"]);
+			menuEditContent->addAction(m_ScMW->scrActions["editPasteContentsAbs"]);
 	}
 	if (m_actionList.contains("editClearContents"))
-		menuEditContents->addAction(m_ScMW->scrActions["editClearContents"]);
+		menuEditContent->addAction(m_ScMW->scrActions["editClearContents"]);
 	if (m_actionList.contains("editTruncateContents"))
-		menuEditContents->addAction(m_ScMW->scrActions["editTruncateContents"]);
-	if (menuEditContents->actions().count()>0)
-	{
-		QAction *act = addMenu(menuEditContents);
-		act->setText( tr("Contents"));
+		menuEditContent->addAction(m_ScMW->scrActions["editTruncateContents"]);
+	if (menuEditContent->actions().count()>0)
+	{
+		QAction *act = addMenu(menuEditContent);
+		act->setText( tr("Content"));
 	}
 	//-->
 




More information about the scribus-commit mailing list