r22373 by jghali -
scribus-commit
scribus-commit at lists.scribus.net
Mon Feb 5 18:21:24 UTC 2018
Author: jghali
Date: Mon Feb 5 18:21:24 2018
New Revision: 22373
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22373
Log:
#15099, improve librevenge based import: better way to handle unit conversions <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=22373&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:21:24 2018
@@ -1767,13 +1767,15 @@
double RawPainter::valueAsPoint(const librevenge::RVNGProperty *prop)
{
- double value = 0.0;
- QString str = QString(prop->getStr().cstr()).toLower();
- if (str.endsWith("in"))
- value = prop->getDouble() * 72.0;
- else
- value = prop->getDouble();
- return value;
+ switch (prop->getUnit())
+ {
+ case librevenge::RVNG_INCH:
+ return prop->getDouble() * 72.0;
+ case librevenge::RVNG_TWIP:
+ return prop->getDouble() / 20.0;
+ default:
+ return prop->getDouble();
+ }
}
void RawPainter::applyFill(PageItem* ite)
More information about the scribus-commit
mailing list