Issue 125045 - Drawing files (.odg) no longer readable after saving
Summary: Drawing files (.odg) no longer readable after saving
Status: CLOSED FIXED
Alias: None
Product: Draw
Classification: Application
Component: ui (show other issues)
Version: 4.2.0-dev
Hardware: Mac All
: P1 (highest) Critical (vote)
Target Milestone: ---
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-06-04 21:37 UTC by Thorsten Wagner
Modified: 2015-01-01 14:38 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Sample file (10.00 KB, application/vnd.oasis.opendocument.graphics)
2014-06-04 21:37 UTC, Thorsten Wagner
no flags Details
Sample file after saving (10.04 KB, application/vnd.oasis.opendocument.graphics)
2014-06-04 21:37 UTC, Thorsten Wagner
no flags Details
Screenshot of error message (34.69 KB, image/png)
2014-06-04 21:38 UTC, Thorsten Wagner
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Thorsten Wagner 2014-06-04 21:37:31 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.
Comment 1 Thorsten Wagner 2014-06-04 21:37:54 UTC
Created attachment 83498 [details]
Sample file after saving
Comment 2 Thorsten Wagner 2014-06-04 21:38:13 UTC
Created attachment 83499 [details]
Screenshot of error message
Comment 3 Regina Henschel 2014-06-04 21:51:28 UTC
I get the error too with AOO420m1(Build:9800)  -  Rev. 1599676 on Windows 7 32bit.
Comment 4 Regina Henschel 2014-06-04 21:59:20 UTC
doubled attributes draw:fill="solid" draw:fill-color="#cfe7f5" in line 14 column 522.
Comment 5 Regina Henschel 2014-06-04 22:09:11 UTC
It happens in Draw and Impress, but not in Writer or Calc. Start with a new document, draw a rectangle, save, close, open. --> Error.
Comment 6 Armin Le Grand 2014-06-05 09:23:17 UTC
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...
Comment 7 Armin Le Grand 2014-06-05 11:16:41 UTC
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...
Comment 8 Armin Le Grand 2014-06-05 12:23:00 UTC
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...
Comment 9 SVN Robot 2014-06-05 12:25:43 UTC
"alg" committed SVN revision 1600631 into trunk:
i125045 For XMLPropertyMapper using TEXT_PROP_MAP_SHAPE_PARA hide the Drawing...
Comment 10 Armin Le Grand 2014-06-05 12:28:35 UTC
Okay, done
Comment 11 Thorsten Wagner 2014-06-05 23:11:48 UTC
Retested successfully, thanks for fixing
Comment 12 slacka 2014-08-21 04:23:01 UTC
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.