r22380 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Mon Feb 5 18:35:23 UTC 2018
Author: jghali
Date: Mon Feb 5 18:35:23 2018
New Revision: 22380
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22380
Log:
#15099, improve librevenge based import: reduce the amount of copypasta <dtardon>
Modified:
trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
Modified: trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22380&path=/trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp Mon Feb 5 18:35:23 2018
@@ -1636,21 +1636,14 @@
}
if (propList["style:text-scale"] && propList["style:text-scale"]->getUnit() == librevenge::RVNG_PERCENT)
textCharStyle.setScaleH(propList["style:text-scale"]->getDouble() * 1000);
- if (propList["style:font-name"])
+ // NOTE: fo:font-name was only ever emitted by libfreehand, by a mistake
+ const librevenge::RVNGProperty *fontNameProp = propList["style:font-name"] ? propList["style:font-name"] : propList["fo:font-name"];
+ if (fontNameProp)
{
QString fontVari;
if (propList["fo:font-weight"])
fontVari = QString(propList["fo:font-weight"]->getStr().cstr());
- QString fontName = QString(propList["style:font-name"]->getStr().cstr());
- QString realFontName = constructFontName(fontName, fontVari);
- textCharStyle.setFont((*m_Doc->AllFonts)[realFontName]);
- }
- if (propList["fo:font-name"])
- {
- QString fontVari;
- if (propList["fo:font-weight"])
- fontVari = QString(propList["fo:font-weight"]->getStr().cstr());
- QString fontName = QString(propList["fo:font-name"]->getStr().cstr());
+ QString fontName = QString(fontNameProp->getStr().cstr());
QString realFontName = constructFontName(fontName, fontVari);
textCharStyle.setFont((*m_Doc->AllFonts)[realFontName]);
}
More information about the scribus-commit
mailing list