Apache OpenOffice (AOO) Bugzilla – Issue 125222
embedded OLE object imported with wrong style from PPTX
Last modified: 2017-05-20 10:35:18 UTC
Created attachment 83658 [details] Slide with embedded Excel sheet The attached file was created with PowerPoint 2010. I inserted an Excel sheet as OLE object into the slide. In OpenOffice it is imported with Default style, which is not good, because the background fill color is blue instead of none. It should have been imported with "Object with no fill and no line". The blue background is a regression from r1344740. #119287# exchanged hard attributes for OLE and GraphicObject with new default StyleSheet for these objects
Indeed the object has correctly no fill or line style, but uses the default style which leads to being filled blue. This is identical in AOO411, AOO410, AOO401 and trunk. What AOO version is r1344740, could you please give the AOO version directly? Its AOO341 where it also gets the default style, but is not filled. Reason for this is that in former AOO versions OLEs and GraphicObjects got the default style, but their line and fill style was hard-wired to ignore that, so no graphic attributes were possible for those object types. OLEs and GraphicObjects should indeed use 'NoFillNoLine' as style as they do when you create/add one. For some reason this is not the case for the PPTX import.
The same should happen with pptx containing graphic objects, thus checked that. The object has no fill, no line and default as style. It still works, but somehow fill seems to be set as hard attributes, using 'format default formatting' shows the expected blue background. Checking where this is done (would be an alternative to do the same for OLEs)...
Could not find out where the background fill for the OLE is created; after quite some debugging I saw that the loaded bugdoc creates *two* objects, an OLE and a GraphicObject containing a metafile. The OLE is empty and shows the 'emptyole' symbol and is *not filled* as it should be, while for the graphic object the metafile itself contains the blue filled background. Argh! Thus the error is some mechanism in the PPTX import that creates that metafile, not at the objects (which still could have the 'Object with no fill and no line' set as style, but get the correct no fill attribute already as hard attribute)
This also means that the OLE import in PPTX is not working - what it should create is one OLE with the correct content. The content is currently represented as metafile and lost (as it seems). Do we have a task for this?
The metafile is okay, but the graphic object containing it gets no default fill style as needed, probably because it's not a real object but a artificial one to get the OLE content visualized, so it probably will not get attributes read from the import file. In any case in SdGenericDrawPage::_CreateSdrObject the correct default style has to be used for graphic and ole shapes, similar to SdrOle2Obj::SetPage and SdrGrafObj::SetPage, thus I will add and test that...
Note: Issue 125224 is similar and I guess OLE import was never added to PPTX, too. If then this should lead to a separate enhancement request; this task will correct the fill attributes/styles
Tested with changed SdGenericDrawPage::_CreateSdrObject, works as expected. It is an intended and needed change, it's about the place where the UNO API incarnates implementation objects for existing XShape UNO objects. In the cases I saw setting the style is not even needed - this is already done in object construction - but I will not risk that this is missing. As noted in the issue 119287 this will change in aw080 anyways since there SdrObjects will get a default style at construction time; adding a tagged (TTTT for aw080 changes) note there to adapt again when aw080 is ready...
Re-checked, looks good. Preparing commit...
Commited to trunk, done. Safe fix (AFAIK), regression from AOO341. A candidate for AOO411. Requesting flag...
Upps, had wrong task-ID in commit, the commit message is (from issue 119287) ---------------------- "alg" committed SVN revision 1609118 into trunk: i119287 corrected default style for draw objects created using UNO API
grant showstopper flag
Added to branch AOO410, checked, works. Adapting target, committing there...
"alg" committed SVN revision 1609460 into branches/AOO410: i125222 corrected default style for draw objects created using UNO API
The fix is not in AOO 4.1.1 Milestone 2 build (1608452). So need to verify it in the next build.
Per Juergen on July 16: "The translation deadline is on July 18th and then a new milestone will be prepared. I expect it being available mid of next week"
Verified fixed on AOO 4.1.1 m3 build: 9772 on Windows 8 Now importing a excel table object from excel works as expected ,with no fill & no line! Yuzhen, pls mark as verified . Thanks Rekha
Thanks Rekha! Marking it as verified