diff options
author | Chr. Rossmanith <Chr.Rossmanith@gmx.de> | 2012-04-29 22:12:29 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2012-04-30 08:30:00 +0200 |
commit | b18cfdc7cd3755c147970f86d23973f337be01a7 (patch) | |
tree | e7a614304196faef64bbfe45016d2ac0139a4083 /filter | |
parent | 23791c1c013313f80b743b61bc7500d3c730aa02 (diff) |
SVG: text elements and graphic elements should not share style ids
Diffstat (limited to 'filter')
-rw-r--r-- | filter/source/svg/gfxtypes.hxx | 8 | ||||
-rw-r--r-- | filter/source/svg/svgreader.cxx | 7 |
2 files changed, 13 insertions, 2 deletions
diff --git a/filter/source/svg/gfxtypes.hxx b/filter/source/svg/gfxtypes.hxx index 24c4cbd1e203..daca2bee42c0 100644 --- a/filter/source/svg/gfxtypes.hxx +++ b/filter/source/svg/gfxtypes.hxx @@ -173,10 +173,11 @@ struct State maTransform(), maViewport(), maViewBox(), + mbIsText(false), maFontFamily(), // app-default mnFontSize(0), - maFontStyle(RTL_CONSTASCII_USTRINGPARAM("normal")), - maFontVariant(RTL_CONSTASCII_USTRINGPARAM("normal")), + maFontStyle("normal"), + maFontVariant("normal"), mnFontWeight(400.0), meTextAnchor(BEFORE), meTextDisplayAlign(BEFORE), @@ -211,6 +212,7 @@ struct State basegfx::B2DRange maViewport; basegfx::B2DRange maViewBox; + bool mbIsText; rtl::OUString maFontFamily; /** Absolute: xx-small=6.94 | x-small=8.33 | small=10 | medium=12 | large=14.4 | x-large=17.28 | xx-large=20.736 @@ -263,6 +265,7 @@ inline bool operator==(const State& rLHS, const State& rRHS ) rLHS.maTransform==rRHS.maTransform && rLHS.maViewport==rRHS.maViewport && rLHS.maViewBox==rRHS.maViewBox && + rLHS.mbIsText==rRHS.mbIsText && rLHS.maFontFamily==rRHS.maFontFamily && rLHS.mnFontSize==rRHS.mnFontSize && rLHS.maFontStyle==rRHS.maFontStyle && @@ -309,6 +312,7 @@ struct StateHash ^ size_t(rState.maViewport.getHeight()) ^ size_t(rState.maViewBox.getWidth()) ^ size_t(rState.maViewBox.getHeight()) + ^ size_t(rState.mbIsText) ^ size_t(rState.maFontFamily.hashCode()) ^ size_t(rState.mnFontSize) ^ size_t(rState.maFontStyle.hashCode()) diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index dfb33c8e742b..2c0c09b20b57 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -521,8 +521,12 @@ struct AnnotatingVisitor rtl::Reference<SvXMLAttributeList> xAttrs( new SvXMLAttributeList() ); uno::Reference<xml::sax::XAttributeList> xUnoAttrs( xAttrs.get() ); + if (XML_TEXT == nTagId) + rState.mbIsText = true; std::pair<StatePool::iterator, bool> aRes = mrStates.insert(rState); + SAL_INFO ("svg", "size " << mrStates.size() << " id " << const_cast<State&>(*aRes.first).mnStyleId); + if( !aRes.second ) return false; // not written @@ -530,6 +534,8 @@ struct AnnotatingVisitor // mnStyleId does not take part in hashing/comparison const_cast<State&>(*aRes.first).mnStyleId = mnCurrStateId; + SAL_INFO ("svg", " --> " << const_cast<State&>(*aRes.first).mnStyleId); + mrStateMap.insert(std::make_pair( mnCurrStateId, rState)); @@ -750,6 +756,7 @@ struct AnnotatingVisitor void writeStyle(const uno::Reference<xml::dom::XElement>& xElem, const sal_Int32 nTagId) { + SAL_INFO ("svg", "writeStyle xElem " << xElem->getTagName()); sal_Int32 nEmulatedStyleId=0; if( maCurrState.maDashArray.size() && maCurrState.meStrokeType != NONE ) |