From b41159c14ec698e01b43a545e6b93419d0206d5d Mon Sep 17 00:00:00 2001 From: Amelia Wang Date: Mon, 13 Sep 2010 14:45:00 +0200 Subject: cjk-character-units-fix-376788.diff: add a new character unit i#376788 --- cui/source/tabpages/paragrph.cxx | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) (limited to 'cui/source/tabpages/paragrph.cxx') diff --git a/cui/source/tabpages/paragrph.cxx b/cui/source/tabpages/paragrph.cxx index aa70c22dc..0c765b536 100644 --- a/cui/source/tabpages/paragrph.cxx +++ b/cui/source/tabpages/paragrph.cxx @@ -442,17 +442,25 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) BOOL bApplyCharUnit = GetApplyCharUnit( rSet ); - if ( bApplyCharUnit ) + SvtCJKOptions aCJKOptions; + if(aCJKOptions.IsAsianTypographyEnabled() && bApplyCharUnit ) eFUnit = FUNIT_CHAR; + SetFieldUnit( aLeftIndent, eFUnit ); SetFieldUnit( aRightIndent, eFUnit ); SetFieldUnit( aFLineIndent, eFUnit ); - if ( bApplyCharUnit ) - eFUnit = FUNIT_LINE; - SetFieldUnit( aTopDist, eFUnit ); - SetFieldUnit( aBottomDist, eFUnit ); - eFUnit = FUNIT_POINT; - SetFieldUnit( aLineDistAtMetricBox, eFUnit ); + if ( eFUnit == FUNIT_CHAR ) + { + SetFieldUnit( aTopDist, FUNIT_LINE ); + SetFieldUnit( aBottomDist, FUNIT_LINE ); + SetFieldUnit( aLineDistAtMetricBox, FUNIT_POINT ); + } + else + { + SetFieldUnit( aTopDist, eFUnit ); + SetFieldUnit( aBottomDist, eFUnit ); + SetFieldUnit( aLineDistAtMetricBox, eFUnit ); + } USHORT _nWhich = GetWhich( SID_ATTR_LRSPACE ); SfxItemState eItemState = rSet.GetItemState( _nWhich ); @@ -544,7 +552,10 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) else { aTopDist.SetRelative(); - SetFieldUnit( aTopDist, eFUnit ); + if ( eFUnit == FUNIT_CHAR ) + SetFieldUnit( aTopDist, FUNIT_LINE ); + else + SetFieldUnit( aTopDist, eFUnit ); SetMetricValue( aTopDist, rOldItem.GetUpper(), eUnit ); } @@ -556,7 +567,10 @@ void SvxStdParagraphTabPage::Reset( const SfxItemSet& rSet ) else { aBottomDist.SetRelative(); - SetFieldUnit( aBottomDist, eFUnit ); + if ( eFUnit == FUNIT_CHAR ) + SetFieldUnit( aBottomDist, FUNIT_LINE ); + else + SetFieldUnit( aBottomDist, eFUnit ); SetMetricValue( aBottomDist, rOldItem.GetLower(), eUnit ); } } -- cgit v1.2.3