summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorAmelia Wang <amwang@novell.com>2010-09-13 14:45:00 +0200
committerCédric Bosdonnat <cedricbosdo@openoffice.org>2010-09-13 16:02:08 +0200
commitb41159c14ec698e01b43a545e6b93419d0206d5d (patch)
tree2b67584265c873b4f8ce16c85a65656a5a87f0a0 /cui
parent38d7e2c79e4207d8138a1740e077bf0e83c80856 (diff)
cjk-character-units-fix-376788.diff: add a new character unit
i#376788
Diffstat (limited to 'cui')
-rw-r--r--cui/source/tabpages/paragrph.cxx32
1 files changed, 23 insertions, 9 deletions
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 );
}
}