Issue 119555 - [From Symphony]font size of Fontwork changes from 96 to 36 after save as new .doc file
[From Symphony]font size of Fontwork changes from 96 to 36 after save as new ...
Status: CLOSED FIXED
Product: Writer
Classification: Application
Component: save-export
3.4.0
All All
: P3 normal (vote)
: 4.0.0
Assigned To: AOO issues mailing list
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-30 05:47 UTC by louqle
Modified: 2012-06-19 06:57 UTC (History)
3 users (show)

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


Attachments
fontwork (23.50 KB, application/msword)
2012-05-30 05:47 UTC, louqle
no flags Details
patch for issue 119555 (877 bytes, patch)
2012-06-11 11:33 UTC, zjchen
zjchencdl: review?
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description louqle 2012-05-30 05:47:53 UTC
Created attachment 77767 [details]
fontwork

1. open FontWork_Size.doc in aoo 3.4 then save as another .doc file
2. open the new .doc file by MS word
3. Double click the fontwork, then check the value on the "Size" drop down list.


It should be 96 but currently it's 36
Comment 1 zjchen 2012-06-11 02:46:18 UTC
After investigation, I figured out the problem is that the font size property of font work doesn't export to new saved .doc file,  thus the font size would be the default value 36.
Comment 2 zjchen 2012-06-11 08:11:50 UTC
The font size attribute can be exported in method
<EscherPropertyContainer::CreateCustomShapeProperties(..)> 
Here is the export implement

---------------------------------------------------------------
if ( EscherPropertyValueHelper::GetPropertyValue( aAny, aXPropSet, String( RTL_CONSTASCII_USTRINGPARAM( "CharHeight" ) ), sal_True ) )
{
    float fCharHeight = 0.0;
    if ( aAny >>= fCharHeight )
    {
        sal_Int32 nTextSize = static_cast< sal_Int32 > ( fCharHeight * 65536 );
        AddOpt(ESCHER_Prop_gtextSize, nTextSize);
    }
}
----------------------------------------------------------------
Comment 3 zjchen 2012-06-11 11:33:01 UTC
Created attachment 78235 [details]
patch for issue 119555

I have tested with sample files for export doc and odt.
notice that the there is a font size gap between AOO and MS WORD.
AOO has 30 kinds of fontwork font size, while MS WORD has 21 totally.
If change the font size to those not include in MS Word, the .doc file can be opened correctly in AOO, but the size cannot be seen in MS Word. 

AOO Font Size 6,7,8,9,10,10.5,11,12,13,14,15,16,18,20,22,24,26,28,32,36,40,44,48,54,60,66,72,80,88,90
MS WORD Font Size
8,9,10,12,14,16,18,20,24,28,32,36,40,44,48,54,60,66,72,80,96
Comment 4 hdu@apache.org 2012-06-11 14:23:21 UTC
Great! Thanks for finding the problem and for the patch, it was applied as revision 1348861.
Comment 5 louqle 2012-06-18 03:25:11 UTC
verified in trunk build r1350879
Comment 6 binguo 2012-06-19 06:57:43 UTC
Verified it on Aoo_Trunk_20120616.1800.1350879 and it does not reproduce, so close it as fixed.