r22170 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sun Oct 1 13:24:00 UTC 2017


Author: jghali
Date: Sun Oct  1 13:24:00 2017
New Revision: 22170

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22170
Log:
revert change erroneously committed with r22166

Modified:
    trunk/Scribus/scribus/pageitem_textframe.cpp

Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22170&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp	(original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp	Sun Oct  1 13:24:00 2017
@@ -1440,9 +1440,6 @@
 			m_availableRegion = matrix.map(m_availableRegion);
 		}
 
-		// update Bullet & number list if any.
-		updateBulletsNum();
-
 		ITextContext* context = this;
 		//TextShaper textShaper(this, itemText, firstInFrame());
 		ShapedTextFeed shapedText(&itemText, firstInFrame(), context);
@@ -1483,6 +1480,8 @@
 			desc = -itemText.defaultStyle().charStyle().font().descent(itemText.defaultStyle().charStyle().fontSize() / 10.0);
 			current.yPos = itemText.defaultStyle().lineSpacing() + m_textDistanceMargins.top() + lineCorr - desc;
 		}
+		// update Bullet & number list if any.
+		updateBulletsNum();
 
 		current.startLine(0);
 
@@ -2245,17 +2244,19 @@
 				current.xPos = qMax(current.xPos, current.colLeft);
 			}
 			// remember possible break
-			if (shapedText.haveMoreText(i + 1, glyphClusters))
-			{
-				const GlyphCluster& nextCluster = glyphClusters[i + 1];
-				if (nextCluster.hasFlag(ScLayout_LineBoundary))
-				{
-					if (!current.glyphs[currentIndex].hasFlag(ScLayout_HyphenationPossible)
-						&& (itemText.text(a) != '-')
-						&& (itemText.text(a) != SpecialChars::SHYPHEN))
-					{
-						current.rememberBreak(i, breakPos, style.rightMargin());
-					}
+			if (shapedText.haveMoreText(i + 1, glyphClusters) && glyphClusters[i + 1].hasFlag(ScLayout_LineBoundary))
+			{
+				if (current.glyphs.length() > 1
+					&& (current.glyphs[currentIndex - 1].lastChar() != SpecialChars::CJK_NOBREAK_AFTER)
+					&& (current.glyphs[currentIndex].firstChar() != SpecialChars::CJK_NOBREAK_BEFORE))
+				{
+//					qDebug() << "rememberBreak LineBoundry @" << i-1;
+					current.rememberBreak(i - 1, breakPos, style.rightMargin());
+				}
+				if (!current.glyphs[currentIndex].hasFlag(ScLayout_LineBoundary))
+				{
+//					qDebug() << "rememberBreak 2nd LineBoundry @" << i;
+					current.rememberBreak(i, breakPos, style.rightMargin());
 				}
 			}
 			if (HasObject)




More information about the scribus-commit mailing list