Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hi,

text without attributes is displayed now.

Christina
From 6eb292d4c3e64f686b4d6c9ad43ae101228e6941 Mon Sep 17 00:00:00 2001
From: "Chr. Rossmanith" <Chr.Rossmanith@gmx.de>
Date: Sat, 28 Apr 2012 20:36:54 +0200
Subject: [PATCH] enable rendering of text without any attributes

---
 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


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.