diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-11-04 17:57:24 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-11-04 20:26:22 +0100 |
commit | 05695230af685bd5db817e160828cdfe414a8b5a (patch) | |
tree | 5ee1dca1795eed7e0dbef4d5d10c83c221fa4fee /svx | |
parent | 3df910376d403f582702bcc44eb4379fdab3c965 (diff) |
line spacing: Correct way of detecting the currently used units.
Change-Id: I208c54f948ecfc0a47d9b26c83acd0bbfdc2070f
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index 516688ab9b14..d85e08bf9148 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -84,7 +84,15 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) aLink = LINK( this, ParaLineSpacingControl, LineSPDistAtHdl_Impl ); mpLineDistAtPercentBox->SetModifyHdl( aLink ); mpLineDistAtMetricBox->SetModifyHdl( aLink ); - SetFieldUnit(*mpLineDistAtMetricBox, SfxModule::GetCurrentFieldUnit()); + + FieldUnit eUnit = FUNIT_INCH; + const SfxPoolItem* pItem = NULL; + if (SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_METRIC, pItem) >= SfxItemState::DEFAULT) + eUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>(pItem)->GetValue()); + else + eUnit = SfxModule::GetCurrentFieldUnit(); + + SetFieldUnit(*mpLineDistAtMetricBox, eUnit); initialize(); } @@ -104,7 +112,6 @@ void ParaLineSpacingControl::initialize() if( eState >= SfxItemState::DEFAULT ) { - // SfxMapUnit eUnit = maLNSpaceControl.GetCoreMetric(); SfxMapUnit eUnit = SFX_MAPUNIT_100TH_MM; meLNSpaceUnit = eUnit; |