r22447 by craig - Coverity 1350142 / 1350555

scribus-commit scribus-commit at lists.scribus.net
Mon Mar 26 21:38:41 UTC 2018


Author: craig
Date: Mon Mar 26 21:38:41 2018
New Revision: 22447

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22447
Log:
Coverity 1350142 / 1350555

Modified:
    trunk/Scribus/scribus/appmodehelper.cpp

Modified: trunk/Scribus/scribus/appmodehelper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22447&path=/trunk/Scribus/scribus/appmodehelper.cpp
==============================================================================
--- trunk/Scribus/scribus/appmodehelper.cpp	(original)
+++ trunk/Scribus/scribus/appmodehelper.cpp	Mon Mar 26 21:38:41 2018
@@ -130,7 +130,8 @@
 		case modeDrawBezierLine:
 		{
 			//if No nodes were created
-			if (currItem == NULL) {
+			if (currItem == NULL)
+			{
 				setSpecialEditMode(false);
 				break;
 			}
@@ -348,7 +349,7 @@
 			break;
 		case modeEditTable:
 			{
-				if (oldMode != modeEditTable)
+				if (currItem && oldMode != modeEditTable)
 				{
 					scmw->charPalette->setEnabled(true, currItem);
 					(*a_scrActions)["insertSampleText"]->setEnabled(true);
@@ -359,10 +360,7 @@
 					a_actMgr->saveActionShortcutsPreEditMode();
 					// #11938: Paste is not correctly enabled in modeEditTable
 					if (ScMimeData::clipboardHasScribusData())
-					{
-						bool tableEditMode = ((currItem != NULL) && (currItem->asTable()));
-						(*a_scrActions)["editPaste"]->setEnabled(tableEditMode);
-					}
+						(*a_scrActions)["editPaste"]->setEnabled(currItem->asTable());
 				}
 			}
 			break;




More information about the scribus-commit mailing list