Changes in SvgSvgNode::getSvgStyleAttributes()

Joren DC jorendc at libreoffice.org
Tue Jul 15 04:46:58 PDT 2014


Hi Regina, Tomaž, *


op 15-07-14 00:12, Regina Henschel schreef:
> It is shown correctly. The style definition selector fits to the
> element. Now put the rectangle into a group and define the style for
> the group.
>
> <?xml version="1.0" standalone="no"?>
> <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
>   "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
> <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
>      width="10cm" height="5cm" viewBox="0 0 1000 500">
>   <defs>
>     <style type="text/css"><![CDATA[
>       g {
>         fill: red;
>         stroke: blue;
>         stroke-width: 3
>       }
>     ]]></style>
>   </defs>
> <g>
>   <rect x="200" y="100" width="600" height="300"/>
> </g>
> </svg>
>
> This makes LO and AOO hang.
Following my backtrace it is caused here:
Program received signal SIGINT, Interrupt.
0x00007ffff7baab2c in rtl_uString_ImplAlloc(int) () from
/home/joren/core/instdir/program/../ure-link/lib/libuno_sal.so.3
#0  0x00007ffff7baab2c in rtl_uString_ImplAlloc(int) () from
/home/joren/core/instdir/program/../ure-link/lib/libuno_sal.so.3
#1  0x00007ffff7bac25e in rtl_uString_newFromLiteral () from
/home/joren/core/instdir/program/../ure-link/lib/libuno_sal.so.3
#2  0x00007fffcdea8f2d in
svgio::svgreader::SvgGNode::getSvgStyleAttributes() const () from
/home/joren/core/instdir/program/../program/libsvgiolo.so
#3  0x00007fffcdeb3866 in
svgio::svgreader::SvgStyleAttributes::getParentStyle() const () from
/home/joren/core/instdir/program/../program/libsvgiolo.so

We can fix this hang on the same why I fixed fdo#78554, but now in
svggnode.cxx:

joren at jorenMint ~/core $ git diff
diff --git a/svgio/source/svgreader/svggnode.cxx
b/svgio/source/svgreader/svggno
index 82d3d5d..45fa6a3 100644
--- a/svgio/source/svgreader/svggnode.cxx
+++ b/svgio/source/svgreader/svggnode.cxx
@@ -43,7 +43,13 @@ namespace svgio
 
         const SvgStyleAttributes* SvgGNode::getSvgStyleAttributes() const
         {
-            return checkForCssStyle(OUString("g"), maSvgStyleAttributes);
+            const SvgStyleAttributes* aCheckCssStyle =
checkForCssStyle(OUStrin
+            const SvgStyleAttributes* aGetCssStyleParent =
maSvgStyleAttributes
+
+            if (aGetCssStyleParent == NULL)
+                return aCheckCssStyle;
+
+            return aGetCssStyleParent;
         }

@Tomaž: we need a different way of accessing this StyleAttributes?

Kind regards,
Joren


More information about the LibreOffice mailing list