Kaydet (Commit) eca6f305 authored tarafından Jan Holesovsky's avatar Jan Holesovsky

line spacing: Final cleanup.

Change-Id: Ide0e653493759e7583fbebb2b3d23d614bdb803c
üst 0ce9c4f9
......@@ -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;
}
......
......@@ -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();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment