r24786 by craig - FIx some character comparisons for Qt6 compatibility

scribus-commit scribus-commit at lists.scribus.net
Tue Dec 28 15:43:03 UTC 2021


Author: craig
Date: Tue Dec 28 15:43:02 2021
New Revision: 24786

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24786
Log:
FIx some character comparisons for Qt6 compatibility

Modified:
    trunk/Scribus/scribus/fonts/scface.cpp
    trunk/Scribus/scribus/scpainter.h
    trunk/Scribus/scribus/scpainterex_ps2.h
    trunk/Scribus/scribus/text/screenpainter.cpp
    trunk/Scribus/scribus/text/storytext.cpp

Modified: trunk/Scribus/scribus/fonts/scface.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24786&path=/trunk/Scribus/scribus/fonts/scface.cpp
==============================================================================
--- trunk/Scribus/scribus/fonts/scface.cpp	(original)
+++ trunk/Scribus/scribus/fonts/scface.cpp	Tue Dec 28 15:43:02 2021
@@ -391,16 +391,17 @@
 
 ScFace::gid_type ScFace::emulateGlyph(uint ch) const
 {
-	if (ch == SpecialChars::LINEBREAK || ch == SpecialChars::PARSEP
-		|| ch == SpecialChars::FRAMEBREAK || ch == SpecialChars::COLBREAK
-		|| ch == SpecialChars::TAB || ch == SpecialChars::SHYPHEN
-		|| ch == SpecialChars::ZWSPACE || ch == SpecialChars::ZWNBSPACE || ch==SpecialChars::OBJECT)
+	QChar chr(ch);
+	if (chr == SpecialChars::LINEBREAK || chr == SpecialChars::PARSEP
+		|| chr == SpecialChars::FRAMEBREAK || chr == SpecialChars::COLBREAK
+		|| chr == SpecialChars::TAB || chr == SpecialChars::SHYPHEN
+		|| chr == SpecialChars::ZWSPACE || chr == SpecialChars::ZWNBSPACE || chr == SpecialChars::OBJECT)
 		return CONTROL_GLYPHS + ch;
-	if (ch == SpecialChars::NBSPACE)
+	if (chr == SpecialChars::NBSPACE)
 		return  m_m->char2CMap(' ');
-	if (ch == SpecialChars::NNBSPACE)
+	if (chr == SpecialChars::NNBSPACE)
 		return  m_m->char2CMap(0x2009); // Use thin space
-	if (ch == SpecialChars::NBHYPHEN)
+	if (chr == SpecialChars::NBHYPHEN)
 		return hyphenGlyph();
 	return 0;
 }
@@ -440,7 +441,7 @@
 	if (m_m->status == ScFace::UNKNOWN)
 		m_m->load();
 	
-	if (ch == SpecialChars::SHYPHEN)
+	if (QChar(ch) == SpecialChars::SHYPHEN)
 		return emulateGlyph(ch);
 
 	gid_type gl = m_m->char2CMap(ch);

Modified: trunk/Scribus/scribus/scpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24786&path=/trunk/Scribus/scribus/scpainter.h
==============================================================================
--- trunk/Scribus/scribus/scpainter.h	(original)
+++ trunk/Scribus/scribus/scpainter.h	Tue Dec 28 15:43:02 2021
@@ -185,10 +185,10 @@
 	QTransform m_matrix;
 	ScFace m_font;
 	double m_fontSize { 0.0 };
-	bool mf_underline { false };
-	bool mf_strikeout { false };
-	bool mf_shadow { false };
-	bool mf_outlined { false };
+//	bool mf_underline { false };
+//	bool mf_strikeout { false };
+//	bool mf_shadow { false };
+//	bool mf_outlined { false };
 	/*! \brief Filling */
 	QColor m_fill { 0, 0, 0 };
 	double m_fill_trans { 1.0 };

Modified: trunk/Scribus/scribus/scpainterex_ps2.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24786&path=/trunk/Scribus/scribus/scpainterex_ps2.h
==============================================================================
--- trunk/Scribus/scribus/scpainterex_ps2.h	(original)
+++ trunk/Scribus/scribus/scpainterex_ps2.h	Tue Dec 28 15:43:02 2021
@@ -244,11 +244,11 @@
 	bool m_pathIsClosed { false };
 	bool m_drawingClosedPath { false };
 /* Drawing surface dimensions */
-	double m_deviceDimX { 0.0 };
-	double m_deviceDimY { 0.0 };
+//	double m_deviceDimX { 0.0 };
+//	double m_deviceDimY { 0.0 };
 /* Device resolutions */
-	double m_deviceResX { 0.0 };
-	double m_deviceResY { 0.0 };
+//	double m_deviceResX { 0.0 };
+//	double m_deviceResY { 0.0 };
 
 /* Color conversion function */
 	void   transformImage(QImage* image, uchar* data, int scan) const;

Modified: trunk/Scribus/scribus/text/screenpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24786&path=/trunk/Scribus/scribus/text/screenpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/text/screenpainter.cpp	(original)
+++ trunk/Scribus/scribus/text/screenpainter.cpp	Tue Dec 28 15:43:02 2021
@@ -109,7 +109,8 @@
 		else if (gid != 0)
 		{
 			gid = gc.getText().at(0).unicode();
-			if (gid != SpecialChars::NBSPACE && gid != SpecialChars::NNBSPACE)
+			QChar chr(gid);
+			if (chr != SpecialChars::NBSPACE && chr != SpecialChars::NNBSPACE)
 				gid = 32;
 		}
 		QTransform chma, chma4;

Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24786&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp	(original)
+++ trunk/Scribus/scribus/text/storytext.cpp	Tue Dec 28 15:43:02 2021
@@ -581,7 +581,8 @@
 void StoryText::removeParSep(int pos)
 {
 	ScText* it = item(pos);
-	if (it->parstyle) {
+	if (it->parstyle)
+	{
 //		const CharStyle* oldP = & it->parstyle->charStyle();
 //		const CharStyle* newP = & that->paragraphStyle(pos+1).charStyle();
 //		d->replaceParentStyle(pos, oldP, newP);
@@ -590,7 +591,7 @@
 	}
 	// demote this parsep so the assert code in replaceCharStyleContextInParagraph()
 	// doesn't choke:
-	it->ch = 0;
+	it->ch = QChar();
 	d->replaceCharStyleContextInParagraph(pos, paragraphStyle(pos+1).charStyleContext());
 }
 




More information about the scribus-commit mailing list