Review Request: Fix some odf saving/loading for charts
Thorsten Zachmann
t.zachmann at zagge.de
Tue Aug 30 15:28:37 BST 2011
> On Aug. 30, 2011, 2:12 p.m., Sebastian Sauer wrote:
> > plugins/chartshape/ChartShape.cpp, line 165
> > <http://git.reviewboard.kde.org/r/102488/diff/1/?file=33256#file33256line165>
> >
> > Is that correct? I mean that we still use KoGenStyle::ParagraphAutoStyle here?
That was there before and it will not change the saved result as only font data is save in that style
> On Aug. 30, 2011, 2:12 p.m., Sebastian Sauer wrote:
> > plugins/chartshape/ChartShape.cpp, line 199
> > <http://git.reviewboard.kde.org/r/102488/diff/1/?file=33256#file33256line199>
> >
> > commit 6698ad09 which added those both lines did add saving for width+height of the title and the label.
> >
> > I guess the reason was that we need that to proper center-align? To bad Johannes didn't wrote why we need it :-/
> >
> > Are you sure removing that lines is correct and if yes, why only here and not at Axis.cpp:1491 at those
> >
> > bodyWriter.addAttributePt( "svg:width", d->title->size().width() );
> >
> > too? I think that cries for us better not removing that lines but commenting them out and adding a comment why we did so. That way we at least leave a hint for the next one who tries to deal with that code (and who may readd those lines if he doesn't know that they got removed to fix this case).
> >
The width and hight are not loaded back from file it uses the title size to se the size. Width and height are not supported by odf at this position.
- Thorsten
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102488/#review6169
-----------------------------------------------------------
On Aug. 30, 2011, 7 a.m., Thorsten Zachmann wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://git.reviewboard.kde.org/r/102488/
> -----------------------------------------------------------
>
> (Updated Aug. 30, 2011, 7 a.m.)
>
>
> Review request for Calligra.
>
>
> Summary
> -------
>
> Fix odf loading/saving of chart related attributes/elements.
>
> When checking for errors in the odf of the embedded chart in http://www.zagge.de/files/ho.odp
>
> I got the following errors.
>
> Object 1/content.xml:5:247: error: attribute "fill" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:5:247: error: attribute "stroke" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:5:247: error: attribute "clip" from namespace "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:5:247: error: attribute "wrap" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed at this point; ignored
> Object 1/content.xml:5:247: error: attribute "wrap-dynamic-threshold" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed at this point; ignored
> Object 1/content.xml:9:60: error: attribute "display-label" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:22:84: error: element "chart-properties" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed in this context
> Object 1/content.xml:22:84: error: attribute "family" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:26:84: error: element "chart-properties" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed in this context
> Object 1/content.xml:26:84: error: attribute "family" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:30:84: error: element "chart-properties" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed in this context
> Object 1/content.xml:30:84: error: attribute "family" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:34:84: error: element "chart-properties" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed in this context
> Object 1/content.xml:34:84: error: attribute "family" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:38:84: error: element "chart-properties" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed in this context
> Object 1/content.xml:38:84: error: attribute "family" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:42:84: error: element "chart-properties" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed in this context
> Object 1/content.xml:42:84: error: attribute "family" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "fill" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "fill-color" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "opacity" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "stroke" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "stroke-linejoin" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "clip" from namespace "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "margin" from namespace "urn:oasis:names:tc:opendocument:xmlns:xsl-fo-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "wrap" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "wrap-dynamic-threshold" from namespace "urn:oasis:names:tc:opendocument:xmlns:style:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "stroke-color" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "stroke-linecap" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "stroke-opacity" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:48:460: error: attribute "stroke-width" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:53:176: error: attribute "x" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:53:176: error: attribute "y" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:54:197: error: attribute "id" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:54:197: error: attribute "layer" from namespace "urn:oasis:names:tc:opendocument:xmlns:drawing:1.0" not allowed at this point; ignored
> Object 1/content.xml:54:197: error: attribute "legend-expansion" from namespace "urn:oasis:names:tc:opendocument:xmlns:office:1.0" not allowed at this point; ignored
> Object 1/content.xml:57:131: error: attribute "width" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:57:131: error: attribute "height" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:58:82: error: element "categories" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed in this context
> Object 1/content.xml:63:131: error: attribute "width" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:63:131: error: attribute "height" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:64:82: error: element "categories" from namespace "urn:oasis:names:tc:opendocument:xmlns:chart:1.0" not allowed in this context
>
> This patch fixes all but
>
> Object 1/content.xml:58:131: error: attribute "width" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:58:131: error: attribute "height" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:64:131: error: attribute "width" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
> Object 1/content.xml:64:131: error: attribute "height" from namespace "urn:oasis:names:tc:opendocument:xmlns:svg-compatible:1.0" not allowed at this point; ignored
>
> I did not fix those as we also read those back when loading the title of an axis.
>
> I paste the fixes here as I also changed the way styles are saved to make it possible to save the styles in the correct properites of the style.
>
>
> Diffs
> -----
>
> libs/flake/KoShape.cpp 4e01de1
> libs/flake/KoShapeShadow.cpp 3958db4
> libs/odf/KoGenStyle.h e48fb2e
> libs/odf/KoOdfGraphicStyles.cpp 54ded90
> plugins/chartshape/Axis.cpp cbc7ded
> plugins/chartshape/ChartShape.h c28f8dd
> plugins/chartshape/ChartShape.cpp 42f11ee
> plugins/chartshape/DataSet.cpp 2a3e272
> plugins/chartshape/Legend.cpp 282901f
>
> Diff: http://git.reviewboard.kde.org/r/102488/diff
>
>
> Testing
> -------
>
> Run the tests after saving the files and it looks much better.
>
>
> Thanks,
>
> Thorsten
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/calligra-devel/attachments/20110830/f569fd10/attachment.htm>
More information about the calligra-devel
mailing list