r24031 by jghali - Fix deprecation warnings related to QRegion::rects();

scribus-commit scribus-commit at lists.scribus.net
Fri Sep 25 12:05:21 UTC 2020


Author: jghali
Date: Fri Sep 25 12:05:21 2020
New Revision: 24031

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24031
Log:
Fix deprecation warnings related to QRegion::rects();

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp
    trunk/Scribus/scribus/util_math.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24031&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Fri Sep 25 12:05:21 2020
@@ -632,8 +632,8 @@
 			QRegion qr2 = QRegion(cRect).subtracted(shape);
 			if (qr2.isEmpty()) // qr2 == 0 <=> cRect subset of shape
 			{
-				QRect rect = lineI.rects().at(0);
-				double  mx = qMax(rect.left(), rect.right()) /*- pf2.dx()*/;
+				QRegion::const_iterator rect = lineI.cbegin();
+				double  mx = qMax(rect->left(), rect->right()) /*- pf2.dx()*/;
 				int steps  = static_cast<int>((mx - StartX - morespace - 2) / 0.25);
 				if (steps > 0)
 				{

Modified: trunk/Scribus/scribus/util_math.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24031&path=/trunk/Scribus/scribus/util_math.cpp
==============================================================================
--- trunk/Scribus/scribus/util_math.cpp	(original)
+++ trunk/Scribus/scribus/util_math.cpp	Fri Sep 25 12:05:21 2020
@@ -337,9 +337,8 @@
 		return false;
 
 	/* can stop when both partOut and partIn are true, or we reach prect->y2 */
-	const QVector<QRect> rects = shape.rects();
-	pbox = (rectCount == 1) ? &boundingRect : rects.constData();
-	pboxEnd = pbox + rectCount;
+	pbox = (rectCount == 1) ? &boundingRect : shape.cbegin();
+	pboxEnd = (rectCount == 1) ? (&boundingRect + 1) : shape.cend();
 	for (; pbox < pboxEnd; ++pbox)
 	{
 		if (pbox->bottom() < ry)




More information about the scribus-commit mailing list