diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-02-18 01:27:17 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-02-19 06:28:11 +0000 |
commit | 324014c997ab90f5777f772a46e6faf887a00832 (patch) | |
tree | 07f8b8ffbbdfeaad39b2466547b68659c422adce /svgio/source | |
parent | 1b374b2a3080a7191c282f891a562962c872893b (diff) |
SVGIO: Fix problem when relative font-size depends on its...
... parent's font-size
Change-Id: I13943923c401a5a06b3aa51181fd75292534e888
Reviewed-on: https://gerrit.libreoffice.org/22452
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'svgio/source')
-rw-r--r-- | svgio/source/svgreader/svgstyleattributes.cxx | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/svgio/source/svgreader/svgstyleattributes.cxx b/svgio/source/svgreader/svgstyleattributes.cxx index a6ad68d888bc..fb750fe9933b 100644 --- a/svgio/source/svgreader/svgstyleattributes.cxx +++ b/svgio/source/svgreader/svgstyleattributes.cxx @@ -2402,6 +2402,20 @@ namespace svgio return SvgNumber( maFontSizeNumber.getNumber() * aDefaultSize / 100.0, Unit_px, true); } + else if((Unit_em == maFontSizeNumber.getUnit()) || (Unit_ex == maFontSizeNumber.getUnit())) + { + const SvgStyleAttributes* pSvgStyleAttributes = getParentStyle(); + + if(pSvgStyleAttributes) + { + const SvgNumber aParentNumber = pSvgStyleAttributes->getFontSizeNumber(); + + return SvgNumber( + aParentNumber.getNumber() * maFontSizeNumber.getNumber(), + aParentNumber.getUnit(), + true); + } + } return maFontSizeNumber; } |