diff options
author | Xisco Fauli <anistenis@gmail.com> | 2016-01-26 01:29:22 +0100 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2016-01-28 06:47:47 +0000 |
commit | 701324a1e1f7e0c181ff1a50956ced686785ea53 (patch) | |
tree | 4b0d053279cd5c4a393df80b1d5d953cedf3997f | |
parent | c06238f28209402a9cbcc2471dd713de0db0fb4b (diff) |
SVGIO: tdf#45771: Fix issue when text size is twice its size...
... when using relative units (em, ex)
This is because for nodes of type textnode, getFontSizeNumber
is called from SvgCharacterNode::createSimpleTextPrimitive
and from SvgNode::getCurrentFontSize(), so avoid the second call.
Change-Id: Ibd418708a572e3c1643164a900fac7e7481afe81
Reviewed-on: https://gerrit.libreoffice.org/21801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
-rw-r--r-- | svgio/inc/svgio/svgreader/svgnode.hxx | 2 | ||||
-rw-r--r-- | svgio/inc/svgio/svgreader/svgtextnode.hxx | 2 | ||||
-rw-r--r-- | svgio/source/svgreader/svgtextnode.cxx | 5 |
3 files changed, 8 insertions, 1 deletions
diff --git a/svgio/inc/svgio/svgreader/svgnode.hxx b/svgio/inc/svgio/svgreader/svgnode.hxx index ab7f28a2850d..d72cde3066a3 100644 --- a/svgio/inc/svgio/svgreader/svgnode.hxx +++ b/svgio/inc/svgio/svgreader/svgnode.hxx @@ -160,7 +160,7 @@ namespace svgio virtual double getCurrentFontSizeInherited() const override; virtual double getCurrentXHeightInherited() const override; - double getCurrentFontSize() const; + virtual double getCurrentFontSize() const; double getCurrentXHeight() const; /// Id access diff --git a/svgio/inc/svgio/svgreader/svgtextnode.hxx b/svgio/inc/svgio/svgreader/svgtextnode.hxx index 7922f133b979..86c13216d1f5 100644 --- a/svgio/inc/svgio/svgreader/svgtextnode.hxx +++ b/svgio/inc/svgio/svgreader/svgtextnode.hxx @@ -58,6 +58,8 @@ namespace svgio virtual void parseAttribute(const OUString& rTokenName, SVGToken aSVGToken, const OUString& aContent) override; virtual void decomposeSvgNode(drawinglayer::primitive2d::Primitive2DContainer& rTarget, bool bReferenced) const override; + virtual double getCurrentFontSize() const override; + /// transform content, set if found in current context const basegfx::B2DHomMatrix* getTransform() const { return mpaTransform; } void setTransform(const basegfx::B2DHomMatrix* pMatrix = nullptr) { if(mpaTransform) delete mpaTransform; mpaTransform = nullptr; if(pMatrix) mpaTransform = new basegfx::B2DHomMatrix(*pMatrix); } diff --git a/svgio/source/svgreader/svgtextnode.cxx b/svgio/source/svgreader/svgtextnode.cxx index 4637bcee51c2..ae7d0e104b85 100644 --- a/svgio/source/svgreader/svgtextnode.cxx +++ b/svgio/source/svgreader/svgtextnode.cxx @@ -260,6 +260,11 @@ namespace svgio } } } + + double SvgTextNode::getCurrentFontSize() const + { + return getCurrentFontSizeInherited(); + } } // end of namespace svgreader } // end of namespace svgio |