r18142 by jghali - #11423: scrapbook file with new line is not possible to insert
scribus-commit
scribus-commit at lists.scribus.net
Fri Feb 15 23:52:04 UTC 2013
Author: jghali
Date: Fri Feb 15 23:52:04 2013
New Revision: 18142
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=18142
Log:
#11423: scrapbook file with new line is not possible to insert
Modified:
branches/Version14x/Scribus/scribus/scribusXml.cpp
Modified: branches/Version14x/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=18142&path=/branches/Version14x/Scribus/scribus/scribusXml.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribusXml.cpp (original)
+++ branches/Version14x/Scribus/scribus/scribusXml.cpp Fri Feb 15 23:52:04 2013
@@ -408,7 +408,11 @@
CharStyle newStyle;
QString pstylename;
QString tmp2, tmf, tmpf, tmp3;
- tmp2 = attrAsString(attrs, "CH", "");
+
+ if (attrs.hasAttribute("Unicode"))
+ tmp2 = QChar(attrAsString(attrs, "Unicode", "").toUInt());
+ else
+ tmp2 = attrAsString(attrs, "CH", "");
tmp2.replace(QRegExp("\r"), QChar(5));
tmp2.replace(QRegExp("\n"), QChar(5));
tmp2.replace(QRegExp("\t"), QChar(4));
@@ -2287,6 +2291,7 @@
CharStyle lastStyle;
int lastPos = 0;
QString text, pstylename;
+ QString tmpnum;
for( int k = 0; k < item->itemText.length(); ++k)
{
@@ -2297,7 +2302,10 @@
pstylename = item->itemText.paragraphStyle(k).parent();
if (style != lastStyle || ch == SpecialChars::PARSEP ||
ch == SpecialChars::PAGENUMBER ||
- ch == SpecialChars::PAGECOUNT)
+ ch == SpecialChars::PAGECOUNT ||
+ (0xd800 <= ch.unicode() && ch.unicode() < 0xe000) ||
+ ch.unicode() == 0xfffe || ch.unicode() == 0xffff ||
+ ch.unicode() < 32)
{
if(k - lastPos > 0)
{
@@ -2326,6 +2334,16 @@
{
writer.writeEmptyElement("var");
writer.writeAttribute("name", "pgco");
+ WriteLegacyCStyle(writer, lastStyle);
+ lastPos = k + 1;
+ }
+ else if ((0xd800 <= ch.unicode() && ch.unicode() < 0xe000) ||
+ ch.unicode() == 0xfffe || ch.unicode() == 0xffff ||
+ ch.unicode() < 32)
+ {
+ tmpnum.setNum(ch.unicode());
+ writer.writeEmptyElement("ITEXT");
+ writer.writeAttribute("Unicode", tmpnum);
WriteLegacyCStyle(writer, lastStyle);
lastPos = k + 1;
}
More information about the scribus-commit
mailing list