Review Request: Fix some odf saving/loading for charts

Thorsten Zachmann t.zachmann at zagge.de
Tue Aug 30 08:00:49 BST 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102488/
-----------------------------------------------------------

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/aa19d5e7/attachment.htm>


More information about the calligra-devel mailing list