r23196 by jghali - #15803: fix a few warnings about signed/unsigned comparison

scribus-commit scribus-commit at lists.scribus.net
Wed Sep 11 13:20:09 UTC 2019


Author: jghali
Date: Wed Sep 11 13:20:08 2019
New Revision: 23196

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23196
Log:
#15803: fix a few warnings about signed/unsigned comparison

Modified:
    trunk/Scribus/scribus/pageitem.cpp
    trunk/Scribus/scribus/pageitem.h
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/scribusdoc.cpp

Modified: trunk/Scribus/scribus/pageitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23196&path=/trunk/Scribus/scribus/pageitem.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem.cpp	(original)
+++ trunk/Scribus/scribus/pageitem.cpp	Wed Sep 11 13:20:08 2019
@@ -1209,11 +1209,11 @@
 	// Fix #6991 : "Text overflow" warning when there is a text underflow in fact
 	/*return NextBox == nullptr && itemText.length() > static_cast<int>(MaxChars);*/
 	return ( NextBox == nullptr )
-		   && ( static_cast<int> ( firstChar ) < itemText.length() )
+		   && ( firstChar < itemText.length() )
 		   // Fix #7766 : scribus.textOverflows() returns 0 if there is no place for the overflow mark
 		   /*&& ( firstChar < MaxChars )*/
 		   && ( firstChar <= m_maxChars )
-		   && ( itemText.length() > static_cast<int> ( m_maxChars ) );
+		   && ( itemText.length() > m_maxChars );
 }
 
 int PageItem::frameOverflowCount() const

Modified: trunk/Scribus/scribus/pageitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23196&path=/trunk/Scribus/scribus/pageitem.h
==============================================================================
--- trunk/Scribus/scribus/pageitem.h	(original)
+++ trunk/Scribus/scribus/pageitem.h	Wed Sep 11 13:20:08 2019
@@ -1690,8 +1690,8 @@
 protected: // Start protected variables
 	PageItem *BackBox;
 	PageItem *NextBox;
-	uint firstChar;
-	uint m_maxChars;
+	int  firstChar;
+	int  m_maxChars;
 	bool m_sampleItem; ///< Used to not draw the frame for sample items
 	MarginStruct m_textDistanceMargins; ///< Left, Top, Bottom, Right distances of text from the frame
 	int verticalAlign;

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23196&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Wed Sep 11 13:20:08 2019
@@ -3109,7 +3109,7 @@
 		QString cc;
 		if (!((itemText.length() == 1) && (itemText.text(0, 1) == QChar(13))))
 		{
-			for (uint d = 0; d < static_cast<uint>(itemText.length()); ++d)
+			for (int d = 0; d < itemText.length(); ++d)
 			{
 				if (d == 0)
 				{

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23196&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Wed Sep 11 13:20:08 2019
@@ -5176,7 +5176,7 @@
 			for (int ite = 0; ite < end; ++ite)
 			{
 				PageItem *itemToCopy = DocItems.at(ite);
-				if ((itemToCopy->OwnPage == static_cast<int>(sourcePage->pageNr())) && (it->ID == itemToCopy->m_layerID))
+				if ((itemToCopy->OwnPage == sourcePage->pageNr()) && (it->ID == itemToCopy->m_layerID))
 					tempSelection.addItem(itemToCopy, true);
 			}
 			if (tempSelection.count() != 0)
@@ -7105,7 +7105,7 @@
 				for (int ite = 0; ite < oldItems; ++ite)
 				{
 					PageItem *itemToCopy = Items->at(ite);
-					if ((itemToCopy->OwnPage == static_cast<int>(from->pageNr())) && (it->ID == itemToCopy->m_layerID))
+					if ((itemToCopy->OwnPage == from->pageNr()) && (it->ID == itemToCopy->m_layerID))
 						tempSelection.addItem(itemToCopy, true);
 				}
 				if (tempSelection.count() != 0)




More information about the scribus-commit mailing list