r21333 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Tue May 17 23:51:35 UTC 2016
Author: jghali
Date: Tue May 17 23:51:35 2016
New Revision: 21333
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=21333
Log:
#14074: import odt file brings in red squares
Modified:
trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
Modified: trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=21333&path=/trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp (original)
+++ trunk/Scribus/scribus/plugins/gettext/odt2im/importodt.cpp Tue May 17 23:51:35 2016
@@ -347,7 +347,14 @@
if (spf.tagName() == "style:font-face")
{
if (!spf.attribute("style:name").isEmpty())
- m_fontMap.insert(spf.attribute("style:name"), spf.attribute("svg:font-family"));
+ {
+ QString fontFamily = spf.attribute("svg:font-family");
+ if (fontFamily.startsWith(QChar('\'')))
+ fontFamily = fontFamily.mid(1);
+ if (fontFamily.endsWith(QChar('\'')))
+ fontFamily.chop(1);
+ m_fontMap.insert(spf.attribute("style:name"), fontFamily);
+ }
}
}
}
@@ -604,7 +611,14 @@
if (spf.tagName() == "style:font-face")
{
if (!spf.attribute("style:name").isEmpty())
- m_fontMap.insert(spf.attribute("style:name"), spf.attribute("svg:font-family"));
+ {
+ QString fontFamily = spf.attribute("svg:font-family");
+ if (fontFamily.startsWith(QChar('\'')))
+ fontFamily = fontFamily.mid(1);
+ if (fontFamily.endsWith(QChar('\'')))
+ fontFamily.chop(1);
+ m_fontMap.insert(spf.attribute("style:name"), fontFamily);
+ }
}
}
}
@@ -1056,6 +1070,16 @@
m_fontMap[actStyle.fontName.value] = tmpOStyle.fontName;
}
}
+ else if (parDefaultStyle.fontName.valid)
+ {
+ tmpOStyle.fontName = constructFontName(parDefaultStyle.fontName.value, "");
+ m_fontMap[parDefaultStyle.fontName.value] = tmpOStyle.fontName;
+ }
+ else if (txtDefaultStyle.fontName.valid)
+ {
+ tmpOStyle.fontName = constructFontName(txtDefaultStyle.fontName.value, "");
+ m_fontMap[txtDefaultStyle.fontName.value] = tmpOStyle.fontName;
+ }
if (actStyle.fontStyle.valid)
tmpOStyle.fontStyle = actStyle.fontStyle.value;
if (actStyle.fontWeight.valid)
More information about the scribus-commit
mailing list