[PATCH] enable rendering of text without any attributes

Chr. Rossmanith Chr.Rossmanith at gmx.de
Sat Apr 28 11:36:54 PDT 2012


---
 filter/source/svg/svgreader.cxx |   20 ++++++++++++++++++--
 1 file changed, 18 insertions(+), 2 deletions(-)

diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index 357c732..dfb33c8 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -207,8 +207,24 @@ struct AnnotatingVisitor
         maParentStates.push_back(rInitialState);
     }
 
-    void operator()( const uno::Reference<xml::dom::XElement>& )
-    {}
+    void operator()( const uno::Reference<xml::dom::XElement>& xElem)
+    {
+        const sal_Int32 nTagId(getTokenId(xElem->getTagName()));
+        if (nTagId != XML_TEXT)
+            return;
+
+        maCurrState = maParentStates.back();
+        maCurrState.maTransform.identity();
+        maCurrState.maViewBox.reset();
+        // set default font size here to ensure writing styles for text
+        if( !mbSeenText && XML_TEXT == nTagId )
+        {
+            maCurrState.mnFontSize = 12.0;
+            mbSeenText = true;
+        }
+        // if necessary, serialize to automatic-style section
+        writeStyle(xElem,nTagId);
+    }
 
     void operator()( const uno::Reference<xml::dom::XElement>&      xElem,
                      const uno::Reference<xml::dom::XNamedNodeMap>& xAttributes )
-- 
1.7.9.5


--------------040401000908080300060509--


More information about the LibreOffice mailing list