Apache OpenOffice (AOO) Bugzilla – Issue 123216
OpenOffice 4.0 grudges WMF and EMF pictures from Word files
Last modified: 2017-05-20 10:33:49 UTC
Created attachment 81484 [details] OpenOffice 4.0 fails to import WMF & EMF pics from Word. OpenOffice 4.0 not able to import all WMF and EMF pics from Word files. Funny thing, those problematic WMF pics can be transferred from Word to openoffice 4.0 by copy & paste, but not EMF pics. No problems found with OO 3.4.1, though!!
Can you please attach the Word document? PS for top image of attachment 81484 [details]: Save Graphics... - save as EMF - new document - Insert - Picture - From File... - select EMF image -> image is cropped. Rev. 1520602 Win 7
Created attachment 81485 [details] EMF image screenshot
Created attachment 81488 [details] WMF picture in original Word file.
Created attachment 81490 [details] WMF and EMF pictures in NEW Word file Created a new, empty Word file and copied the picture into it, - both as WMF and EMF picture. Enjoy and surprise! Now OO 4.0 imported the .docx file perfectly!
Thank you. I can't even copy from Word 2007 and paste in Writer. Rev. 1520602 Win 7
ALG: Took a look; can copy/paste from word to draw/impress, but not to Writer or Calc in AOO400. The same on AOO341. Looking for other changes (the graphic gets loaded, font sizes are messed up, rest looks good).
(In reply to Armin Le Grand from comment #6) > ALG: Took a look; can copy/paste from word to draw/impress, but not to > Writer or Calc in AOO400. The same on AOO341. Looking for other changes (the > graphic gets loaded, font sizes are messed up, rest looks good). Copy WMF pic from Word to Writer: In Writer try using Paste Special -> GDI metafile. That works for me.
ALG: @Egil: That gives us a workaround, thanks. Looking to the EMF import wile file loading...
ALG: Debugged through the EMF importer comparing AOO341 and AOO401, looks correct. Preparing MSFilter stuff for debugging...
ALG: EMF importer does the same and pasting from Word to in draw/impress works: Two hints that the import itself works, so there must be someting around this scenario when loading the whole file which changes the imported metafile, maybe writzer does something special with it...
ALG: ADded rGDIMetaFile.GetChecksum() and it's getting different at action #13, a MetaFontAction. Looking deeper. Indeed, the FontSize is different; when correcting one, the CRC is correct. Correct size is (169, 422), wrong one is (85, 209). Need to check why different FontSizes get imported...
ALG: Getting closer; the regression seems to be caused by task 121382 where the WorldTransform gets used more intense at WMF import. There is a case used in WMF import missing, the MWT_SET (4) in reading WIN_EMR_MODIFYWORLDTRANSFORM actions. Added that. Still bad ly scaled. When pasting from word to draw ConvertWMFToGDIMetaFile uses EnhWMFReader direct and no WorldTransform is used at all. When loading the *.doc, ConvertWMFToGDIMetaFile uses WMFReader which itself (partially?) uses EnhWMFReader::ReadEnhWMF(); in this case the WorldTransform is used and FontSizes get scaled by ca. 0.5 and 6.2 (what explains the too big font sizes). Question is if adaption of FontSize in task 121382 was correct or not; I still think so - it maybe that WorldTransform adaption is still missing somewhere else, checking...
ALG: Re-checked task 121382 (paste chart from bugdoc to writer) and never a homogen matrix is set different from the identity in EMR_EXTCREATEFONTINDIRECTW handler (ConvertWMFToGDIMetaFile uses EnhWMFReader direct and no WorldTransform is used), so applying the WorldTransform to the FontSize is unused. Also tried to find hints in ms docu if this should be applied, could not find hints in EMR_EXTCREATEFONTINDIRECTW or close to it. Looks as if I could remove the scaling in case EMR_EXTCREATEFONTINDIRECTW, but keep MWT_SET and handling it which is surely not wrong. Checking...
ALG: This task and 121382 work with removing FontScaling using WorldTransform, so I will remove it. Adding regression keyword, asking for AOO401 flag, preparing commit to trunk.
ALG: Owner and target
"alg" committed SVN revision 1521441 into trunk: i123216 No FontScaling by WorldTransform on WMF import
approve showstopper request
ALG: Checked and committed to AOO401 tree, changing target and done.
ALG: ...and a big thank you to Egil for finding and reporting this!
(In reply to Armin Le Grand from comment #19) > ALG: ...and a big thank you to Egil for finding and reporting this! +1
"alg" committed SVN revision 1521537 into branches/AOO401: i123216 No FontScaling by WorldTransform on WMF import
(In reply to Armin Le Grand from comment #19) > ALG: ...and a big thank you to Egil for finding and reporting this! You are welcome! I'll do my best to have you guys sweating for your dimes. ;)