Apache OpenOffice (AOO) Bugzilla – Issue 125045
Drawing files (.odg) no longer readable after saving
Last modified: 2015-01-01 14:38:39 UTC
Created attachment 83497 [details] Sample file Drawing files (.odg) are no longer readable after saving. Steps to reproduce: (1) Open an existing drawing file, e.g. attached file "Sample.odg") (2) Save drawing file, resulting in attached file "Sample (saved).odg" (3) Open saved drawing file, e.g. attached file "Sample (saved).odg" The error message is shown in attached screenshot. The problem appears on Mac OS X 10.9.2 with OpenOffice 4.2 revision 1600106 from trunk. It may be exist on Windows as well as on Linux too. The problem has been introduced during the commits to trunk this week or last week.
Created attachment 83498 [details] Sample file after saving
Created attachment 83499 [details] Screenshot of error message
I get the error too with AOO420m1(Build:9800) - Rev. 1599676 on Windows 7 32bit.
doubled attributes draw:fill="solid" draw:fill-color="#cfe7f5" in line 14 column 522.
It happens in Draw and Impress, but not in Writer or Calc. Start with a new document, draw a rectangle, save, close, open. --> Error.
Hi Regina, thanks for the analysis. This must have happened with the changes for Writer FillStyles, I have no idea yet why it has influence on draw/impress styles in that form. Grepping...
Reason found; the xml im/export does chain SvXMLExportPropertyMapper to combine properties; this has some caveats (double entries as here, already avoided partly by indexing the static tables with e.g. [1] or [13] in stead of [0] at construction time, also double XMLPropertyHandlerFactory entries). In this case a XMLShapeExportPropertyMapper gets added/chained a CreateParaExtPropMapper(...) which is a XMLTextPropertySetMapper(TEXT_PROP_MAP_SHAPE_PARA). Used PropMaps are aXMLSDProperties[0] and aXMLParaPropMap[1] (the one comes from already avoiding to have the 1st entry double which is a "ParaUserDefinedAttributes" / "UserDefinedAttributes" entry). Unfortunately both contain the fill attribute set now due to writer changes, thus these are exported double. ChainExportMapper is not very convenient but currently used ten times in xmloff, reportdesign, dbaccess and sc, so not simple to replace/correct. Thinking about a good solution...
Have a working solution which provides the problem; a good solution would have to cleanup the ChainImport/ExportMapper stuff first which by itself is not trivial and not without risk. For now, the construction of a to-be-chained mapper using TEXT_PROP_MAP_SHAPE_PARA will use an increased index and the fill attributes are moved to the beginning of that list. This works, but is not the most elegant solution. Preparing commit...
"alg" committed SVN revision 1600631 into trunk: i125045 For XMLPropertyMapper using TEXT_PROP_MAP_SHAPE_PARA hide the Drawing...
Okay, done
Retested successfully, thanks for fixing
I believe this fix may be breaking doc imports. See Issue 125477 for a good example of all of the problems this introduces in 4.2.