r22734 by jghali - cmdtext.cpp refactoring and consequent scribus/scribusdoc cleanups (2)

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 14 13:26:31 UTC 2018


Author: jghali
Date: Sun Oct 14 13:26:31 2018
New Revision: 22734

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22734
Log:
cmdtext.cpp refactoring and consequent scribus/scribusdoc cleanups (2)

Modified:
    trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp

Modified: trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22734&path=/trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp	(original)
+++ trunk/Scribus/scribus/plugins/scripter/api_textitem.cpp	Sun Oct 14 13:26:31 2018
@@ -66,20 +66,18 @@
 {
 	if (PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts.contains(name))
 	{
-		int Apm = ScCore->primaryMainWindow()->doc->appMode;
-		ScCore->primaryMainWindow()->doc->m_Selection->clear();
-		ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
-		if (item->HasSel)
-			ScCore->primaryMainWindow()->doc->appMode = modeEdit;
-		ScCore->primaryMainWindow()->SetNewFont(name);
-		ScCore->primaryMainWindow()->doc->appMode = Apm;
-		ScCore->primaryMainWindow()->view->Deselect();
-	}
-	else
-	{
 		RAISE("Font not found");
-	}
-
+		return;
+	}
+	
+	int Apm = ScCore->primaryMainWindow()->doc->appMode;
+	ScCore->primaryMainWindow()->doc->m_Selection->clear();
+	ScCore->primaryMainWindow()->doc->m_Selection->addItem(item);
+	if (item->HasSel)
+		ScCore->primaryMainWindow()->doc->appMode = modeEdit;
+	ScCore->primaryMainWindow()->doc->itemSelection_SetFont(name);
+	ScCore->primaryMainWindow()->doc->appMode = Apm;
+	ScCore->primaryMainWindow()->view->Deselect();
 }
 
 double TextAPI::fontSize()




More information about the scribus-commit mailing list