summaryrefslogtreecommitdiff
path: root/cui/source/tabpages/paragrph.cxx
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
commite1e9d3b73c82d0f7448d5ffa1f49d0a5f36b2a22 (patch)
tree4793edf86c9f59d4af3d967443de6abd8e428bee /cui/source/tabpages/paragrph.cxx
parent7bd13d9c9d86999bca94e1151c9ac0bdbf05fe13 (diff)
cjk-character-units-fix-376788.diff: add a new character unit
i#376788
Diffstat (limited to 'cui/source/tabpages/paragrph.cxx')
-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 34f142176760..047f55f4f0db 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 );
}
}