[Libreoffice-commits] core.git: Branch 'aoo/trunk' - svgio/source

Armin Le Grand alg at apache.org
Fri Oct 10 07:09:34 PDT 2014


 svgio/source/svgreader/svgdocumenthandler.cxx |   18 +++++++++++++++++-
 1 file changed, 17 insertions(+), 1 deletion(-)

New commits:
commit bb72d5b3ecbe6a03d3d3dfe101ad67ff4650a9f9
Author: Armin Le Grand <alg at apache.org>
Date:   Fri Oct 10 12:50:29 2014 +0000

    i125326 accept CssStyles with missing type attribute

diff --git a/svgio/source/svgreader/svgdocumenthandler.cxx b/svgio/source/svgreader/svgdocumenthandler.cxx
index 3e7e5ca..4378f20 100644
--- a/svgio/source/svgreader/svgdocumenthandler.cxx
+++ b/svgio/source/svgreader/svgdocumenthandler.cxx
@@ -330,10 +330,26 @@ namespace svgio
                     {
                         SvgStyleNode* pNew = new SvgStyleNode(maDocument, mpTarget);
                         mpTarget = pNew;
-                        mpTarget->parseAttributes(xAttribs);
+                        const sal_uInt32 nAttributes(xAttribs->getLength());
+
+                        if(0 == nAttributes)
+                        {
+                            // #125326# no attributes, thus also no type="text/css". This is allowed to be missing,
+                            // thus do mark this style as CssStyle. This is required to read the contained
+                            // text (which defines the css style)
+                            pNew->setTextCss(true);
+                        }
+                        else
+                        {
+                            // #125326# there are attributes, read them. This will set isTextCss to true if
+                            // a type="text/css" is contained as exact match, else not
+                            mpTarget->parseAttributes(xAttribs);
+                        }
 
                         if(pNew->isTextCss())
                         {
+                            // if it is a Css style, allow reading text between the start and end tag (see
+                            // SvgDocHdl::characters for details)
                             maCssContents.push_back(rtl::OUString());
                         }
                         break;


More information about the Libreoffice-commits mailing list