r20715 by craig -

scribus-commit scribus-commit at lists.scribus.net
Sun Jan 24 21:27:37 UTC 2016


Author: craig
Date: Sun Jan 24 21:27:37 2016
New Revision: 20715

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20715
Log:
Fix warning in menumanager.cpp

Modified:
    trunk/Scribus/scribus/menumanager.cpp

Modified: trunk/Scribus/scribus/menumanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20715&path=/trunk/Scribus/scribus/menumanager.cpp
==============================================================================
--- trunk/Scribus/scribus/menumanager.cpp	(original)
+++ trunk/Scribus/scribus/menumanager.cpp	Sun Jan 24 21:27:37 2016
@@ -114,16 +114,19 @@
 	if (menuStrings.contains(menuName))
 	{
 		QList<QAction*> mba=scribusMenuBar->actions();
-		QAction* beforeAct;
+		QAction* beforeAct=NULL;
 		foreach (beforeAct, mba)
 		{
 			if (beforeMenuName==beforeAct->text().remove('&').remove("..."))
 				break;
 		}
-		QMenu *m=new QMenu(menuName);
-		scribusMenuBar->insertMenu(beforeAct, m);
-		menuBarMenus.insert(menuName, m);
-		retVal=true;
+		if (beforeAct)
+		{
+			QMenu *m=new QMenu(menuName);
+			scribusMenuBar->insertMenu(beforeAct, m);
+			menuBarMenus.insert(menuName, m);
+			retVal=true;
+		}
 	}
 	return retVal;
 }




More information about the scribus-commit mailing list