Issue 123216 - OpenOffice 4.0 grudges WMF and EMF pictures from Word files
Summary: OpenOffice 4.0 grudges WMF and EMF pictures from Word files
Status: CLOSED FIXED
Alias: None
Product: Writer
Classification: Application
Component: open-import (show other issues)
Version: 4.0.0
Hardware: PC Windows, all
: P3 Major (vote)
Target Milestone: 4.0.1
Assignee: Armin Le Grand
QA Contact:
URL:
Keywords: regression
Depends on:
Blocks:
 
Reported: 2013-09-09 01:10 UTC by Egil Jahnsen
Modified: 2017-05-20 10:33 UTC (History)
5 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
jsc: 4.0.1_release_blocker+


Attachments
OpenOffice 4.0 fails to import WMF & EMF pics from Word. (26.88 KB, application/vnd.oasis.opendocument.text)
2013-09-09 01:10 UTC, Egil Jahnsen
no flags Details
EMF image screenshot (152.98 KB, image/jpeg)
2013-09-09 06:22 UTC, Edwin Sharp
no flags Details
WMF picture in original Word file. (43.00 KB, application/msword)
2013-09-09 11:59 UTC, Egil Jahnsen
no flags Details
WMF and EMF pictures in NEW Word file (179.57 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2013-09-09 12:26 UTC, Egil Jahnsen
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description Egil Jahnsen 2013-09-09 01:10:04 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!!
Comment 1 Edwin Sharp 2013-09-09 06:20:57 UTC
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
Comment 2 Edwin Sharp 2013-09-09 06:22:55 UTC
Created attachment 81485 [details]
EMF image screenshot
Comment 3 Egil Jahnsen 2013-09-09 11:59:08 UTC
Created attachment 81488 [details]
WMF picture in original Word file.
Comment 4 Egil Jahnsen 2013-09-09 12:26:17 UTC
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!
Comment 5 Edwin Sharp 2013-09-09 12:26:46 UTC
Thank you.

I can't even copy from Word 2007 and paste in Writer.

Rev. 1520602 Win 7
Comment 6 Armin Le Grand 2013-09-09 12:35:17 UTC
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).
Comment 7 Egil Jahnsen 2013-09-09 12:42:20 UTC
(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.
Comment 8 Armin Le Grand 2013-09-09 12:50:58 UTC
ALG: @Egil: That gives us a workaround, thanks. Looking to the EMF import wile file loading...
Comment 9 Armin Le Grand 2013-09-09 16:03:30 UTC
ALG: Debugged through the EMF importer comparing AOO341 and AOO401, looks correct. Preparing MSFilter stuff for debugging...
Comment 10 Armin Le Grand 2013-09-09 17:09:57 UTC
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...
Comment 11 Armin Le Grand 2013-09-09 17:41:20 UTC
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...
Comment 12 Armin Le Grand 2013-09-10 10:26:18 UTC
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...
Comment 13 Armin Le Grand 2013-09-10 11:34:41 UTC
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...
Comment 14 Armin Le Grand 2013-09-10 11:42:16 UTC
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.
Comment 15 Armin Le Grand 2013-09-10 11:51:22 UTC
ALG: Owner and target
Comment 16 SVN Robot 2013-09-10 11:58:44 UTC
"alg" committed SVN revision 1521441 into trunk:
i123216 No FontScaling by WorldTransform on WMF import
Comment 17 jsc 2013-09-10 13:24:34 UTC
approve showstopper request
Comment 18 Armin Le Grand 2013-09-10 16:14:26 UTC
ALG: Checked and committed to AOO401 tree, changing target and done.
Comment 19 Armin Le Grand 2013-09-10 16:15:03 UTC
ALG: ...and a big thank you to Egil for finding and reporting this!
Comment 20 Edwin Sharp 2013-09-10 16:16:23 UTC
(In reply to Armin Le Grand from comment #19)
> ALG: ...and a big thank you to Egil for finding and reporting this!

+1
Comment 21 SVN Robot 2013-09-10 16:29:41 UTC
"alg" committed SVN revision 1521537 into branches/AOO401:
i123216 No FontScaling by WorldTransform on WMF import
Comment 22 Egil Jahnsen 2013-09-10 16:42:53 UTC
(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. ;)