Changes in SvgSvgNode::getSvgStyleAttributes()
Hi all, I see some changes in fdo#78554 which I do not understand. In AOO the method SvgSvgNode::getSvgStyleAttributes() is a simple getter for the member maSvgStyleAttributes. First was a change in commit 1d89cd08ab3566375e30b17f1b17bc240ca907a4. But the commit message does not mention, what problem this change solves. I see no bug report and no test document. The following changes try to solve a problem which seems to be introduced with the above mentioned commit. I ask, because AOO has no problems with the file attached to fdo#78554. The text is there when opening via File > Open and same when insert via Insert > Picture. Kind regards Regina ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Changes in SvgSvgNode::getSvgStyleAttributes()
Hi, On Mon, Jul 14, 2014 at 8:15 PM, Regina Henschel wrote: > Hi all, > > I see some changes in fdo#78554 which I do not understand. In AOO the method > SvgSvgNode::getSvgStyleAttributes() is a simple getter for the member > maSvgStyleAttributes. > > First was a change in commit 1d89cd08ab3566375e30b17f1b17bc240ca907a4. But > the commit message does not mention, what problem this change solves. I see > no bug report and no test document. [1] is the test document - it doesn't work correctly in AOO 4.1 I have "reverse engeneered" what fdo#78554 wants to fix and started writing a test, but it is not really finished yet. > The following changes try to solve a problem which seems to be introduced > with the above mentioned commit. > > I ask, because AOO has no problems with the file attached to fdo#78554. The > text is there when opening via File > Open and same when insert via Insert > > Picture. > > Kind regards > Regina [1] http://cgit.freedesktop.org/libreoffice/core/tree/svgio/qa/cppunit/data/RectWithParentStyles.svg ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Changes in SvgSvgNode::getSvgStyleAttributes()
On Mon, Jul 14, 2014 at 9:05 PM, Tomaž Vajngerl wrote: > I have "reverse engeneered" what fdo#78554 wants to fix and started > writing a test, but it is not really finished yet. I mean what 1d89cd08ab3566375e30b17f1b17bc240ca907a4 wants to fix... Regards, Tomaž ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Changes in SvgSvgNode::getSvgStyleAttributes()
Hi Tomaž, Tomaž Vajngerl schrieb: Hi, On Mon, Jul 14, 2014 at 8:15 PM, Regina Henschel wrote: Hi all, I see some changes in fdo#78554 which I do not understand. In AOO the method SvgSvgNode::getSvgStyleAttributes() is a simple getter for the member maSvgStyleAttributes. First was a change in commit 1d89cd08ab3566375e30b17f1b17bc240ca907a4. But the commit message does not mention, what problem this change solves. I see no bug report and no test document. [1] is the test document - it doesn't work correctly in AOO 4.1 I have "reverse engeneered" what fdo#78554 wants to fix and started writing a test, but it is not really finished yet. Thanks for document. I can see the problem now. Indeed it does not show correct in AOO. I think, that the problem is not in SvgSvgNode, but the problem is, that the style inheritance is not resolved, when the style is defined by a style _element_. Take this example from http://www.w3.org/TR/SVG/styling.html#StylingWithCSS http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";> http://www.w3.org/2000/svg"; version="1.1" width="10cm" height="5cm" viewBox="0 0 1000 500"> 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. http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";> http://www.w3.org/2000/svg"; version="1.1" width="10cm" height="5cm" viewBox="0 0 1000 500"> This makes LO and AOO hang. On the other hand, the same as style _attribute_ works in both cases. http://www.w3.org/2000/svg"; xmlns:xlink="http://www.w3.org/1999/xlink"; style="stroke:#ff;fill:#00cc00"> style="stroke-width: 3;" /> http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";> http://www.w3.org/2000/svg"; version="1.1" width="10cm" height="5cm" viewBox="0 0 1000 500"> So it is not inheritance in general and not the fact, that the style is on the outer svg-element, but it the problem, that the parent's style information is in a style _element_. Therefore the fix should not be a change in the method SvgSvgNode::getSvgStyleAttributes(). Kind regards Regina The following changes try to solve a problem which seems to be introduced with the above mentioned commit. I ask, because AOO has no problems with the file attached to fdo#78554. The text is there when opening via File > Open and same when insert via Insert > Picture. Kind regards Regina [1] http://cgit.freedesktop.org/libreoffice/core/tree/svgio/qa/cppunit/data/RectWithParentStyles.svg ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Changes in SvgSvgNode::getSvgStyleAttributes()
Hi Tomaž, forget my previous mail. The error is indeed that the old version of SvgSvgNode::getSvgStyleAttributes() does not consider the styles from the style element. Kind regards Regina Tomaž Vajngerl schrieb: Hi, On Mon, Jul 14, 2014 at 8:15 PM, Regina Henschel wrote: Hi all, I see some changes in fdo#78554 which I do not understand. In AOO the method SvgSvgNode::getSvgStyleAttributes() is a simple getter for the member maSvgStyleAttributes. First was a change in commit 1d89cd08ab3566375e30b17f1b17bc240ca907a4. But the commit message does not mention, what problem this change solves. I see no bug report and no test document. [1] is the test document - it doesn't work correctly in AOO 4.1 I have "reverse engeneered" what fdo#78554 wants to fix and started writing a test, but it is not really finished yet. The following changes try to solve a problem which seems to be introduced with the above mentioned commit. I ask, because AOO has no problems with the file attached to fdo#78554. The text is there when opening via File > Open and same when insert via Insert > Picture. Kind regards Regina [1] http://cgit.freedesktop.org/libreoffice/core/tree/svgio/qa/cppunit/data/RectWithParentStyles.svg ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice
Re: Changes in SvgSvgNode::getSvgStyleAttributes()
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. > > >"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd";> > http://www.w3.org/2000/svg"; version="1.1" > width="10cm" height="5cm" viewBox="0 0 1000 500"> > > g { > fill: red; > stroke: blue; > stroke-width: 3 > } > ]]> > > > > > > > This makes LO and AOO hang. Following my backtrace it is caused here: Program received signal SIGINT, Interrupt. 0x77baab2c in rtl_uString_ImplAlloc(int) () from /home/joren/core/instdir/program/../ure-link/lib/libuno_sal.so.3 #0 0x77baab2c in rtl_uString_ImplAlloc(int) () from /home/joren/core/instdir/program/../ure-link/lib/libuno_sal.so.3 #1 0x77bac25e in rtl_uString_newFromLiteral () from /home/joren/core/instdir/program/../ure-link/lib/libuno_sal.so.3 #2 0x7fffcdea8f2d in svgio::svgreader::SvgGNode::getSvgStyleAttributes() const () from /home/joren/core/instdir/program/../program/libsvgiolo.so #3 0x7fffcdeb3866 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@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 ___ LibreOffice mailing list LibreOffice@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice