r18143 by jghali - remove unnecessary 'if' block (always true in block where it is located)

scribus-commit scribus-commit at lists.scribus.net
Sat Feb 16 00:00:57 UTC 2013


Author: jghali
Date: Sat Feb 16 00:00:57 2013
New Revision: 18143

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18143
Log:
remove unnecessary 'if' block (always true in block where it is located)

Modified:
    branches/Version14x/Scribus/scribus/scribusdoc.cpp

Modified: branches/Version14x/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18143&path=/branches/Version14x/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusdoc.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusdoc.cpp Sat Feb 16 00:00:57 2013
@@ -6419,19 +6419,15 @@
 		{
 			int start = currItem->itemText.startOfItem(currItem->firstInFrame());
 			int length = currItem->itemText.endOfItem(currItem->lastInFrame()) - start;
-			if (appMode == modeEdit)
-			{
-				if (currItem->itemText.lengthOfSelection() > 0)
-				{
-					start = currItem->itemText.startOfSelection();
-					length = currItem->itemText.endOfSelection() - start;
-				}
-				else
-				{
-					start = qMax(currItem->firstInFrame(), currItem->itemText.cursorPosition());
-//9876					length = (start + 1) < currItem->itemText.length()? 1 : 0;
-					length = start < currItem->itemText.length() ? 1 : 0;
-				}
+			if (currItem->itemText.lengthOfSelection() > 0)
+			{
+				start = currItem->itemText.startOfSelection();
+				length = currItem->itemText.endOfSelection() - start;
+			}
+			else
+			{
+				start = qMax(currItem->firstInFrame(), currItem->itemText.cursorPosition());
+				length = start < currItem->itemText.length() ? 1 : 0;
 			}
 			currItem->itemText.applyCharStyle(start, qMax(0, length), newStyle);
 			currItem->invalid = true;




More information about the scribus-commit mailing list