r17358 by fschmid - Tables: almost last part of making table cell text really editable, allow using the Story Editor.

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 4 23:04:52 UTC 2012


Author: fschmid
Date: Sun Mar  4 23:04:51 2012
New Revision: 17358

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17358
Log:
Tables: almost last part of making table cell text really editable, allow using the Story Editor.

Modified:
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribus.h

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17358&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Mar  4 23:04:51 2012
@@ -2875,6 +2875,7 @@
 			PageItem *i2 = currItem->asTable()->activeCell().textFrame();
 			enableTextActions(&scrActions, true, i2->currentCharStyle().font().scName());
 			scrActions["insertSampleText"]->setEnabled(true);
+			scrActions["toolsEditWithStoryEditor"]->setEnabled(true);
 		}
 		break;
 	case PageItem::PathText: //Path Text
@@ -6407,12 +6408,14 @@
 			charPalette->setEnabled(false, 0);
 			enableTextActions(&scrActions, false);
 			scrActions["insertSampleText"]->setEnabled(false);
+			scrActions["toolsEditWithStoryEditor"]->setEnabled(false);
 			actionManager->restoreActionShortcutsPostEditMode();
 		}
 		else if (mode == modeEditTable && oldMode != modeEditTable)
 		{
 			charPalette->setEnabled(true, currItem);
 			scrActions["insertSampleText"]->setEnabled(true);
+			scrActions["toolsEditWithStoryEditor"]->setEnabled(true);
 			PageItem *i2 = currItem->asTable()->activeCell().textFrame();
 			enableTextActions(&scrActions, true, i2->currentCharStyle().font().scName());
 			actionManager->saveActionShortcutsPreEditMode();
@@ -6627,7 +6630,7 @@
 
 		if (mode == modeStoryEditor)
 		{
-			slotStoryEditor();
+			slotStoryEditor(oldMode == modeEditTable);
 			slotSelect();
 		}
 		if (mode == modeCopyProperties)
@@ -9237,18 +9240,21 @@
 	return DocumentChecker().checkDocument(doc);
 }
 
-void ScribusMainWindow::slotStoryEditor()
+void ScribusMainWindow::slotStoryEditor(bool fromTable)
 {
 	if (doc->m_Selection->count() != 0)
 	{
 		PageItem *currItem = doc->m_Selection->itemAt(0);
-		PageItem *currItemSE=storyEditor->currentItem();
-		ScribusDoc *currDocSE=storyEditor->currentDocument();
+		PageItem *i2 = currItem;
+		if (fromTable)
+			i2 = currItem->asTable()->activeCell().textFrame();
+		PageItem *currItemSE = storyEditor->currentItem();
+		ScribusDoc *currDocSE = storyEditor->currentDocument();
 		storyEditor->activFromApp = true;
 		//CB shouldnt these be after the if?
 		//Why are we resetting the doc and item in this case. My original code didnt do this.
-		storyEditor->setCurrentDocumentAndItem(doc, currItem);
-		if (currItem==currItemSE && doc==currDocSE)
+		storyEditor->setCurrentDocumentAndItem(doc, i2);
+		if (i2 == currItemSE && doc == currDocSE)
 		{
 			storyEditor->show();
 			storyEditor->raise();

Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17358&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sun Mar  4 23:04:51 2012
@@ -250,7 +250,7 @@
 	void ToggleStickyTools();
 	void ToggleAllGuides();
 	void ToggleAllPalettes();
-	void slotStoryEditor();
+	void slotStoryEditor(bool fromTable);
 	void slotCharSelect();
 	void ImageEffects();
 	QString fileCollect(const bool compress = false, const bool withFonts = false, const bool withProfiles = false, const QString& newDirectory=QString::null);




More information about the scribus-commit mailing list