Issue 119567 - [From Symphony]WMF graphic size changed too small to see if saved by AOO
[From Symphony]WMF graphic size changed too small to see if saved by AOO
Status: VERIFIED FIXED
Product: Writer
Classification: Application
Component: save-export
3.4.0
PC All
: P3 major (vote)
: 4.0.0
Assigned To: Oliver-Rainer Wittmann
: ms_interoperability
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-30 06:29 UTC by Yan Ji
Modified: 2012-12-26 08:18 UTC (History)
4 users (show)

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


Attachments
sample (87.50 KB, application/msword)
2012-05-30 06:29 UTC, Yan Ji
no flags Details
patch for i119567 (2.36 KB, patch)
2012-07-03 14:13 UTC, zjchen
orw: review+
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Yan Ji 2012-05-30 06:29:41 UTC
Created attachment 77786 [details]
sample

Build: AOO3.4
Steps:
1. Open sample file
2. Save it as another .doc file
3. Open the saved file in AOO or MS Office

Defect: 
In AOO: It looks like the grpahic is lost, but actually it still there which width changed to 0.02 and height to 0.39 make the graphic too small to see.
In MS Office: There is dialog popup "The dimentions after cropping are too samll or too large"
Comment 1 zjchen 2012-07-03 13:29:58 UTC
Open the saved file in AOO, select the invisible picture, noticed there are several improper parameters in crop tab:

scale - width is 1%, height is 7%, while original document should be 7% and 8%,
image size - width is 0.02'' height is 0.39'',while original document should be  5.83'' and 0.40'

put the value of scale/image size as original sample file, the cropped graphic can be displayed properly.
Comment 2 zjchen 2012-07-03 13:59:38 UTC
The problem is that the graphic in sample file is a special WMF picture, and its PicHeader parameters is not correctly on export. 

see <SwWW8WrGrf::WritePICFHeader(..)> in "main\sw\filter\source\wrtww8gr.cxx" line 604
when the original size of WMF picture is too big to fit, the final size will be replaced with Layout size, so that the scaling factor will be calculated based on inappropriate size. 
 
Resolution: 
replace writting the inappropriate scaling value into stream with default operation when the original size of WMF picture is too big to fit
Comment 3 zjchen 2012-07-03 14:13:59 UTC
Created attachment 78566 [details]
patch for i119567
Comment 4 Oliver-Rainer Wittmann 2012-07-05 13:29:56 UTC
taking over to review the attached patch
Comment 5 Oliver-Rainer Wittmann 2012-07-05 14:51:36 UTC
Comment on attachment 78566 [details]
patch for i119567

review done -> patch looks good and solves the problem.
I will apply it on trunk
Comment 6 Oliver-Rainer Wittmann 2012-07-06 08:09:13 UTC
I have applied the patch on trunk, revision 1358065
I took the freedom to apply minor adjustments before committing it.
Comment 7 zjchen 2012-07-08 13:24:22 UTC
->Oliver
Thanks for your review and modification. It looks much better:)
Comment 8 Du Jing 2012-08-20 09:01:49 UTC
verified on the AOO3.5