svx/source/sidebar/paragraph/ParaPropertyPanel.cxx | 34 ++++----------------- svx/source/sidebar/paragraph/ParaPropertyPanel.hxx | 9 ----- 2 files changed, 8 insertions(+), 35 deletions(-)
New commits: commit 9a410f9cedbce5276aea48479812ff68210712b0 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Wed Nov 26 22:26:39 2014 +0200 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 diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index d7828c4..e6949e4 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 commit 3e1dc286891e7542f66ddc4ac407556a5aedc9e3 Author: Maxim Monastirsky <momonas...@gmail.com> Date: Wed Nov 26 20:22:27 2014 +0200 Cleanup some leftovers from the line spacing popup conversion Change-Id: Ia2e35461958ea5d79241fa2231bd7ef164fc378d diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx index 2867a5c..d7828c4 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.cxx @@ -197,7 +197,6 @@ void ParaPropertyPanel::DataChanged (const DataChangedEvent& rEvent) ParaPropertyPanel::~ParaPropertyPanel() { - delete mpLnSPItem; } void ParaPropertyPanel::ReSize(bool /* bSize */) @@ -487,10 +486,6 @@ void ParaPropertyPanel::NotifyItemUpdate( StateChangedIndentImpl( nSID, eState, pState ); break; - case SID_ATTR_PARA_LINESPACE: - StateChangedLnSPImpl( nSID, eState, pState ); - break; - case SID_ATTR_PARA_ULSPACE: StateChangedULImpl( nSID, eState, pState ); break; @@ -657,18 +652,6 @@ void ParaPropertyPanel::StateChangedIndentImpl( sal_uInt16 /*nSID*/, SfxItemStat } } -void ParaPropertyPanel::StateChangedLnSPImpl( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) -{ - meLnSpState = eState; - - if( pState && eState >= SfxItemState::DEFAULT ) - { - if(mpLnSPItem) - delete mpLnSPItem; - mpLnSPItem = static_cast<SvxLineSpacingItem *>(pState->Clone()); - } -} - void ParaPropertyPanel::StateChangedULImpl( sal_uInt16 /*nSID*/, SfxItemState eState, const SfxPoolItem* pState ) { mpTopDist->SetMax( mpTopDist->Normalize( MAX_DURCH ), MapToFieldUnit(m_eULSpaceUnit) ); @@ -798,8 +781,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent, maSpace3 (SVX_RES(IMG_SPACE3)), maIndHang (SVX_RES(IMG_INDENT_HANG)), maTxtLeft (0), - mpLnSPItem (NULL), - meLnSpState (SfxItemState::DONTCARE), mbOutLineLeft (false), mbOutLineRight (false), maUpper (0), @@ -809,7 +790,6 @@ ParaPropertyPanel::ParaPropertyPanel(vcl::Window* pParent, m_eLRSpaceUnit(), m_eULSpaceUnit(), maLRSpaceControl (SID_ATTR_PARA_LRSPACE,*pBindings,*this), - maLNSpaceControl (SID_ATTR_PARA_LINESPACE, *pBindings,*this), maULSpaceControl (SID_ATTR_PARA_ULSPACE, *pBindings,*this), maOutLineLeftControl(SID_OUTLINE_LEFT, *pBindings, *this, OUString("OutlineRight"), rxFrame), maOutLineRightControl(SID_OUTLINE_RIGHT, *pBindings, *this, OUString("OutlineLeft"), rxFrame), diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index b79f33a..8d47825 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -86,9 +86,6 @@ private: // Data Member long maTxtLeft; - //Line spacing - SvxLineSpacingItem *mpLnSPItem; - SfxItemState meLnSpState; bool mbOutLineLeft; bool mbOutLineRight; long maUpper; @@ -100,7 +97,6 @@ private: SfxMapUnit m_eULSpaceUnit; // Control Items ::sfx2::sidebar::ControllerItem maLRSpaceControl; - ::sfx2::sidebar::ControllerItem maLNSpaceControl; ::sfx2::sidebar::ControllerItem maULSpaceControl; ::sfx2::sidebar::ControllerItem maOutLineLeftControl; ::sfx2::sidebar::ControllerItem maOutLineRightControl; @@ -127,7 +123,6 @@ private: DECL_LINK(ClickUL_IncDec_Hdl_Impl, ToolBox*); void StateChangedIndentImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); - void StateChangedLnSPImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangedULImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangeOutLineImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); void StateChangeIncDecImpl( sal_uInt16 nSID, SfxItemState eState, const SfxPoolItem* pState ); commit 8e5ac3ba8b8fe445bf6918c15172756337033dca Author: Maxim Monastirsky <momonas...@gmail.com> Date: Wed Nov 26 20:17:21 2014 +0200 Unused includes Change-Id: I262b3106bf426a12b2e826eeefd02351e67c7a9b diff --git a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx index 6017b9d..b79f33a 100644 --- a/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx +++ b/svx/source/sidebar/paragraph/ParaPropertyPanel.hxx @@ -19,21 +19,17 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARAPROPERTYPANEL_HXX -#include <vcl/ctrl.hxx> #include <sfx2/sidebar/ControllerItem.hxx> #include <sfx2/sidebar/IContextChangeReceiver.hxx> #include <editeng/lspcitem.hxx> -#include <svtools/ctrlbox.hxx> #include <svx/sidebar/PanelLayout.hxx> #include <svx/relfld.hxx> #include <editeng/svxenum.hxx> -#include <editeng/fhgtitem.hxx> #include <com/sun/star/frame/XFrame.hpp> #include <com/sun/star/ui/XSidebar.hpp> #include <vcl/vclenum.hxx> -#include <vcl/fixed.hxx> #include <svl/poolitem.hxx> #include <tools/fldunit.hxx> _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits