From 9a410f9cedbce5276aea48479812ff68210712b0 Mon Sep 17 00:00:00 2001 From: Maxim Monastirsky Date: Wed, 26 Nov 2014 22:26:39 +0200 Subject: sidebar: Try to fix initial spacing values Process SID_ATTR_METRIC status before any other, and call SetMax methods before SetValue, so indent values won't be truncated by a wrong max value. Change-Id: I36d8c0cce9561902aa2c4d531740f56c80207012 --- svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index d7828c4795a0..e6949e41339a 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -563,7 +563,6 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat long nVal = OutputDevice::LogicToLogic( maTxtLeft, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); nVal = (long)mpLeftIndent->Normalize( (long)nVal ); - mpLeftIndent->SetValue( nVal, FUNIT_100TH_MM ); if ( maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Text) && maContext.GetCombinedContext_DI() != CombinedEnumContext(Application_WriterVariants, Context_Default) @@ -574,11 +573,6 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat long nrVal = OutputDevice::LogicToLogic( aTxtRight, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); nrVal = (long)mpRightIndent->Normalize( (long)nrVal ); - mpRightIndent->SetValue( nrVal, FUNIT_100TH_MM ); - - long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); - nfVal = (long)mpFLineIndent->Normalize( (long)nfVal ); - mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM ); switch (maContext.GetCombinedContext_DI()) { @@ -605,6 +599,13 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat } } + mpLeftIndent->SetValue( nVal, FUNIT_100TH_MM ); + mpRightIndent->SetValue( nrVal, FUNIT_100TH_MM ); + + long nfVal = OutputDevice::LogicToLogic( aTxtFirstLineOfst, (MapUnit)(SFX_MAPUNIT_TWIP), MAP_100TH_MM ); + nfVal = (long)mpFLineIndent->Normalize( (long)nfVal ); + mpFLineIndent->SetValue( nfVal, FUNIT_100TH_MM ); + mpTbxIndent_IncDec->Enable(); const sal_uInt16 nIdIncrIndent = mpTbxIndent_IncDec->GetItemId(UNO_INCREMENTINDENT); @@ -823,6 +824,7 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent, get(mpTbxUL_IncDec, "paraspacing"); initial(); + m_aMetricCtl.RequestUpdate(); } } } // end of namespace svx::sidebar -- cgit v1.2.3