r17740 by jghali - #10884: Text spills out of frame
scribus-commit
scribus-commit at lists.scribus.net
Sat Jul 28 12:17:11 UTC 2012
Author: jghali
Date: Sat Jul 28 12:17:11 2012
New Revision: 17740
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17740
Log:
#10884: Text spills out of frame
Modified:
trunk/Scribus/scribus/pageitem_textframe.cpp
Modified: trunk/Scribus/scribus/pageitem_textframe.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17740&path=/trunk/Scribus/scribus/pageitem_textframe.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_textframe.cpp (original)
+++ trunk/Scribus/scribus/pageitem_textframe.cpp Sat Jul 28 12:17:11 2012
@@ -316,6 +316,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("->"))
@@ -2775,14 +2808,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