diff options
author | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-02-01 16:26:51 +0100 |
---|---|---|
committer | Cédric Bosdonnat <cedricbosdo@openoffice.org> | 2011-02-01 16:27:42 +0100 |
commit | 552cdb5b8b406238486b9415262a551cb29ca817 (patch) | |
tree | c877dbca5bf87e7b418b5d6434a3a58c234d31c3 | |
parent | 6c4d785cc570862213e279fcf21a22a35d194f37 (diff) |
fdo#32684: Don't force Char / Lines units on rulers
-rw-r--r-- | sw/source/ui/config/usrpref.cxx | 12 | ||||
-rw-r--r-- | sw/source/ui/uiview/view.cxx | 33 |
2 files changed, 10 insertions, 35 deletions
diff --git a/sw/source/ui/config/usrpref.cxx b/sw/source/ui/config/usrpref.cxx index 83739bd4f8..979c45e1a5 100644 --- a/sw/source/ui/config/usrpref.cxx +++ b/sw/source/ui/config/usrpref.cxx @@ -32,6 +32,7 @@ #include <tools/stream.hxx> #include <unotools/syslocale.hxx> +#include <svl/cjkoptions.hxx> #include "swtypes.hxx" #include "hintids.hxx" @@ -72,9 +73,16 @@ SwMasterUsrPref::SwMasterUsrPref(BOOL bWeb) : bApplyCharUnit(sal_False) { MeasurementSystem eSystem = SvtSysLocale().GetLocaleData().getMeasurementSystemEnum(); + SvtCJKOptions aCJKOptions; eUserMetric = MEASURE_METRIC == eSystem ? FUNIT_CM : FUNIT_INCH; - eHScrollMetric = eUserMetric; - eVScrollMetric = eUserMetric; + + sal_Bool bCJKEnabled = aCJKOptions.IsAsianTypographyEnabled(); + bApplyCharUnit = bCJKEnabled; + eHScrollMetric = bApplyCharUnit ? FUNIT_CHAR : eUserMetric; + eVScrollMetric = bApplyCharUnit ? FUNIT_LINE : eUserMetric; + + bIsHScrollMetricSet = bApplyCharUnit; + bIsVScrollMetricSet = bApplyCharUnit; aContentConfig.Load(); aLayoutConfig.Load(); diff --git a/sw/source/ui/uiview/view.cxx b/sw/source/ui/uiview/view.cxx index 63be548245..ee4f600e80 100644 --- a/sw/source/ui/uiview/view.cxx +++ b/sw/source/ui/uiview/view.cxx @@ -917,42 +917,9 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) pVRuler->SetZoom( aZoomFract ); pHRuler->SetDoubleClickHdl(LINK( this, SwView, ExecRulerClick )); FieldUnit eMetric = pUsrPref->GetHScrollMetric(); - - BOOL bApplyCharUnit = pUsrPref->IsApplyCharUnit(); - SvtCJKOptions aCJKOptions; - if ( aCJKOptions.IsAsianTypographyEnabled() ) - { - if ( bApplyCharUnit ) - eMetric = FUNIT_CHAR; - else - { - if ( eMetric == FUNIT_CHAR ) - eMetric = FUNIT_CM; - } - } - else - { - if ( eMetric == FUNIT_CHAR ) - eMetric = FUNIT_INCH; - } pHRuler->SetUnit( eMetric ); eMetric = pUsrPref->GetVScrollMetric(); - if ( aCJKOptions.IsAsianTypographyEnabled() ) - { - if ( bApplyCharUnit ) - eMetric = FUNIT_LINE; - else - { - if ( eMetric == FUNIT_LINE ) - eMetric = FUNIT_CM; - } - } - else - { - if ( eMetric == FUNIT_LINE ) - eMetric = FUNIT_INCH; - } pVRuler->SetUnit( eMetric ); pHRuler->SetCharWidth( 371 ); // default character width |