diff options
author | Jan Holesovsky <kendy@collabora.com> | 2014-11-04 22:08:36 +0100 |
---|---|---|
committer | Jan Holesovsky <kendy@collabora.com> | 2014-11-04 22:09:34 +0100 |
commit | eca6f3056de43b2a74108f96df3b55633a486d0b (patch) | |
tree | 4f3d8fdb914da6d5907385a716fc7dd9839cd762 /svx | |
parent | 0ce9c4f910afb2bf1ac0aec97ef49598493ac3a5 (diff) |
line spacing: Final cleanup.
Change-Id: Ide0e653493759e7583fbebb2b3d23d614bdb803c
Diffstat (limited to 'svx')
-rw-r--r-- | svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx | 25 | ||||
-rw-r--r-- | svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx | 30 |
2 files changed, 22 insertions, 33 deletions
diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx index d85e08bf9148..4cfbca6be7b3 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.cxx @@ -16,18 +16,14 @@ * except in compliance with the License. You may obtain a copy of * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ + #include "ParaLineSpacingControl.hxx" -#include "ParaPropertyPanel.hrc" -#include <sfx2/sidebar/ResourceDefinitions.hrc> -#include <svx/dialogs.hrc> -#include <svx/dialmgr.hxx> -#include <unotools/viewoptions.hxx> + +#include <editeng/editids.hrc> #include <editeng/kernitem.hxx> +#include <editeng/lspcitem.hxx> #include <sfx2/dispatch.hxx> -#include <sfx2/sidebar/Theme.hxx> -#include <sfx2/viewfrm.hxx> #include <svtools/unitconv.hxx> -#include <vcl/settings.hxx> #define DEFAULT_LINE_SPACING 200 #define FIX_DIST_DEF 283 @@ -51,7 +47,6 @@ #define MIN_FIXED_DISTANCE 28 using namespace svx; -using namespace svx::sidebar; ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) : SfxPopupWindow(nId, "ParaLineSpacingControl", "svx/ui/paralinespacingcontrol.ui") @@ -94,14 +89,14 @@ ParaLineSpacingControl::ParaLineSpacingControl(sal_uInt16 nId) SetFieldUnit(*mpLineDistAtMetricBox, eUnit); - initialize(); + Initialize(); } ParaLineSpacingControl::~ParaLineSpacingControl() { } -void ParaLineSpacingControl::initialize() +void ParaLineSpacingControl::Initialize() { const SfxPoolItem* pItem; SfxItemState eState = SfxViewFrame::Current()->GetBindings().GetDispatcher()->QueryState(SID_ATTR_PARA_LINESPACE, pItem); @@ -287,8 +282,8 @@ void ParaLineSpacingControl::UpdateMetricFields() mpActLineDistFld->Show(); mpActLineDistFld->Enable(); break; + case LLINESPACE_FIX: - { mpLineDistAtPercentBox->Hide(); mpActLineDistFld = mpLineDistAtMetricBox; @@ -301,8 +296,7 @@ void ParaLineSpacingControl::UpdateMetricFields() mpLineDistLabel->Enable(); mpActLineDistFld->Show(); mpActLineDistFld->Enable(); - } - break; + break; } } @@ -348,10 +342,9 @@ void ParaLineSpacingControl::ExecuteLineSpace() case LLINESPACE_DURCH: case LLINESPACE_FIX: SetLineSpace(aSpacing, nPos, GetCoreValue(*mpLineDistAtMetricBox, meLNSpaceUnit)); - break; + break; default: - OSL_ENSURE(false, "error!!"); break; } diff --git a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx index 087e6a81936a..07fb087a1d94 100644 --- a/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx +++ b/svx/source/sidebar/paragraph/ParaLineSpacingControl.hxx @@ -19,16 +19,11 @@ #ifndef INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGCONTROL_HXX #define INCLUDED_SVX_SOURCE_SIDEBAR_PARAGRAPH_PARALINESPACINGCONTROL_HXX -#include "svx/sidebar/ValueSetWithTextControl.hxx" -#include <sfx2/bindings.hxx> #include <svtools/ctrlbox.hxx> -#include <svtools/ctrltool.hxx> -#include <vcl/fixed.hxx> -#include <svl/poolitem.hxx> -#include <editeng/lspcitem.hxx> -#include <sfx2/sidebar/EnumContext.hxx> #include <sfx2/tbxctrl.hxx> +class SvxLineSpacingItem; + namespace svx { class ParaLineSpacingControl : public SfxPopupWindow @@ -37,15 +32,6 @@ public: ParaLineSpacingControl(sal_uInt16 nId); virtual ~ParaLineSpacingControl(); - short GetLastCustomState(); - long GetLastCustomValue(); - - void ExecuteLineSpace(); - void SetLineSpace( SvxLineSpacingItem& rLineSpace, - int eSpace, long lValue = 0 ); - - void ExecuteLineSpacing(sal_uInt16 aEntry); - private: SfxMapUnit meLNSpaceUnit; @@ -63,7 +49,17 @@ private: MetricField* mpLineDistAtMetricBox; private: - void initialize(); + /// Setup the widgets with values from the document. + void Initialize(); + + /// Take the values from the widgets, and update the paragraph accordingly. + void ExecuteLineSpace(); + + /// Set one particular value. + void SetLineSpace(SvxLineSpacingItem& rLineSpace, int eSpace, long lValue = 0); + + /// For the buttons - set the values, and close the popup. + void ExecuteLineSpacing(sal_uInt16 aEntry); /// Set mpActlineDistFld and visibility of mpLineDist* fields according to what is just selected. void UpdateMetricFields(); |