r17739 by jghali - #10884: Text spills out of frame

scribus-commit scribus-commit at lists.scribus.net
Sat Jul 28 12:16:51 UTC 2012


Author: jghali
Date: Sat Jul 28 12:16:51 2012
New Revision: 17739

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17739
Log:
#10884: Text spills out of frame

Modified:
    branches/Version14x/Scribus/scribus/pageitem_textframe.cpp

Modified: branches/Version14x/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17739&path=/branches/Version14x/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/pageitem_textframe.cpp (original)
+++ branches/Version14x/Scribus/scribus/pageitem_textframe.cpp Sat Jul 28 12:16:51 2012
@@ -240,6 +240,39 @@
 		invalid = true;
 		currentShadow = newShadow;
 	}
+}
+
+static void debugLineLayout(const StoryText& itemText, const LineSpec& line)
+{
+	QFile debugFile(QDir::homePath() + "/Desktop/debug_line.csv");
+	debugFile.open(QIODevice::WriteOnly);
+
+	QTextStream stream(&debugFile);
+	stream.setRealNumberNotation(QTextStream::FixedNotation);
+	stream.setRealNumberPrecision(7);
+
+	stream << "xoffset"  << "\t";
+	stream << "yoffset"  << "\t";
+	stream << "xadvance" << "\t";
+	stream << "yadvance" << "\t";
+	stream << "scaleH"   << "\t";
+	stream << "scaleV"   << "\t";
+	stream << "\n";
+
+	for (int zc = line.firstItem; zc < line.lastItem; ++zc)
+	{
+		const ScText* item = itemText.item(zc);
+
+		stream << item->glyph.xoffset  << "\t";
+		stream << item->glyph.yoffset  << "\t";
+		stream << item->glyph.xadvance << "\t";
+		stream << item->glyph.yadvance << "\t";
+		stream << item->glyph.scaleH   << "\t";
+		stream << item->glyph.scaleV   << "\t";
+		stream << "\n";
+	}
+
+	debugFile.close();
 }
 
 static void dumpIt(const ParagraphStyle& pstyle, QString indent = QString("->"))
@@ -2464,14 +2497,13 @@
 	}
 	MaxChars = itemText.length();
 	invalid = false;
-	if (NextBox != NULL) 
-	{
-		PageItem_TextFrame* nextFrame = dynamic_cast<PageItem_TextFrame*>(NextBox);
-		if (nextFrame != NULL)
-		{
-			nextFrame->invalid = true;
-			nextFrame->firstChar = MaxChars;
-		}
+
+	PageItem_TextFrame* nextFrame = dynamic_cast<PageItem_TextFrame*>(NextBox);
+	while (nextFrame != NULL)
+	{
+		nextFrame->invalid   = true;
+		nextFrame->firstChar = MaxChars;
+		nextFrame = dynamic_cast<PageItem_TextFrame*>(nextFrame->NextBox);
 	}
 //	qDebug("textframe: len=%d, done relayout", itemText.length());
 	return;




More information about the scribus-commit mailing list