r23484 by jghali - #16066: Variable Text gets damaged when hyphenation is on

scribus-commit scribus-commit at lists.scribus.net
Fri Mar 6 11:21:52 UTC 2020


Author: jghali
Date: Fri Mar  6 11:21:52 2020
New Revision: 23484

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23484
Log:
#16066: Variable Text gets damaged when hyphenation is on

Modified:
    trunk/Scribus/scribus/text/shapedtextfeed.cpp

Modified: trunk/Scribus/scribus/text/shapedtextfeed.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23484&path=/trunk/Scribus/scribus/text/shapedtextfeed.cpp
==============================================================================
--- trunk/Scribus/scribus/text/shapedtextfeed.cpp	(original)
+++ trunk/Scribus/scribus/text/shapedtextfeed.cpp	Fri Mar  6 11:21:52 2020
@@ -31,8 +31,8 @@
 
 bool ShapedTextFeed::haveMoreText(int glyphPos, QList<GlyphCluster>& glyphs)
 {
-    while (glyphPos >= glyphs.count())
-    {
+	while (glyphPos >= glyphs.count())
+	{
 		int nextChar = m_textSource->nextBlockStart(m_endChar);
 		ShapedText more(getMore(m_endChar, nextChar));
 		
@@ -42,9 +42,9 @@
 		m_endChar = more.lastChar();
 		int nOldGlyphs = glyphs.count();
 		glyphs.append(more.glyphs());
-		std::sort(glyphs.begin() + nOldGlyphs, glyphs.end(), logicalGlyphRunComp);
-    }
-    return glyphPos < glyphs.count();
+		std::stable_sort(glyphs.begin() + nOldGlyphs, glyphs.end(), logicalGlyphRunComp);
+	}
+	return glyphPos < glyphs.count();
 }
 
 
@@ -71,7 +71,7 @@
 	QList<GlyphCluster> runs;
 	for (int i = 0; i < glyphsCount; ++i)
 		runs.append(glyphs.at(start + i));
-	std::sort(runs.begin(), runs.end(), visualGlyphRunComp);
+	std::stable_sort(runs.begin(), runs.end(), visualGlyphRunComp);
 	return runs;
 }
 




More information about the scribus-commit mailing list