diff options
author | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-03 15:49:47 +0200 |
---|---|---|
committer | ALONSO Laurent <laurent.alonso@inria.fr> | 2019-04-03 15:49:47 +0200 |
commit | 1f490e3ba099f2435fe5c28372c4a9f4aed992e4 (patch) | |
tree | 0fd0a3c382f55a30337c621be0f71e9f5ddd2a69 | |
parent | edb6cbdd5981b3e77e98d70a913f4847c63134fa (diff) |
all: BaselineShift is stored in point...
Change-Id: I6220583f4da9013edb320a2f24fd3a53a9ed3e8f
-rw-r--r-- | src/lib/IWORKText.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/IWORKText.cpp b/src/lib/IWORKText.cpp index 1687e09..d4129aa 100644 --- a/src/lib/IWORKText.cpp +++ b/src/lib/IWORKText.cpp @@ -108,9 +108,14 @@ void IWORKText::fillCharPropList(const IWORKStyleStack &style, const IWORKLangua break; } } - else if (style.has<BaselineShift>()) + else if (style.has<BaselineShift>() && (style.get<BaselineShift>()<0 || style.get<BaselineShift>()>0) && + style.has<FontSize>() && style.get<FontSize>()>0) { - props.insert("style:text-position", style.get<BaselineShift>(), librevenge::RVNG_PERCENT); + // the unit is in point => we need to convert it in a percentage of the font size + librevenge::RVNGString str; + str.sprintf("%.2f", 100*style.get<BaselineShift>()/style.get<FontSize>()); + str.append("% 100%"); + props.insert("style:text-position", str.cstr()); } if (style.has<Capitalization>()) |