summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-01-31 12:31:11 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-01-31 19:37:29 +0100
commitc599e23a92310916d4e7f09c5aaf354d63973d0b (patch)
treed1e584a33e47f3fbbfcbdfcd9c3b9a14f7fcadd2 /svx
parentc82efb610bf556ea12cbe4f94568ac619897799f (diff)
loplugin:singlevalfields
Change-Id: I77ccf3f36363e182a644b98cdf720f1381a5cceb Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87766 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.cxx5
-rw-r--r--svx/source/sidebar/text/TextCharacterSpacingControl.hxx3
-rw-r--r--svx/source/tbxctrls/layctrl.cxx8
3 files changed, 7 insertions, 9 deletions
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
index b04dd42caabb..bf3a99892684 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.cxx
@@ -43,7 +43,6 @@ namespace svx {
TextCharacterSpacingControl::TextCharacterSpacingControl(TextCharacterSpacingPopup* pControl, weld::Widget* pParent)
: WeldToolbarPopup(pControl->getFrameInterface(), pParent, "svx/ui/textcharacterspacingcontrol.ui", "TextCharacterSpacingControl")
- , mnId(SID_ATTR_CHAR_KERNING)
, mnCustomKern(0)
, mnLastCus(SPACING_NOCUSTOM)
, mxEditKerning(m_xBuilder->weld_metric_spin_button("kerning", FieldUnit::POINT))
@@ -190,10 +189,10 @@ IMPL_LINK_NOARG(TextCharacterSpacingControl, KerningModifyHdl, weld::MetricSpinB
ExecuteCharacterSpacing(mnCustomKern, false);
}
-MapUnit TextCharacterSpacingControl::GetCoreMetric() const
+MapUnit TextCharacterSpacingControl::GetCoreMetric()
{
SfxItemPool &rPool = SfxGetpApp()->GetPool();
- sal_uInt16 nWhich = rPool.GetWhich(mnId);
+ sal_uInt16 nWhich = rPool.GetWhich(SID_ATTR_CHAR_KERNING);
return rPool.GetMetric(nWhich);
}
diff --git a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
index 22b5e63141ae..f5ff964f0c85 100644
--- a/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
+++ b/svx/source/sidebar/text/TextCharacterSpacingControl.hxx
@@ -40,7 +40,6 @@ public:
virtual ~TextCharacterSpacingControl() override;
private:
- sal_uInt16 mnId;
long mnCustomKern;
short mnLastCus;
@@ -60,7 +59,7 @@ private:
DECL_LINK(PredefinedValuesHdl, weld::Button&, void);
DECL_LINK(KerningModifyHdl, weld::MetricSpinButton&, void);
- MapUnit GetCoreMetric() const;
+ static MapUnit GetCoreMetric();
};
}
diff --git a/svx/source/tbxctrls/layctrl.cxx b/svx/source/tbxctrls/layctrl.cxx
index 3d7f57d60db9..0e7691017ad3 100644
--- a/svx/source/tbxctrls/layctrl.cxx
+++ b/svx/source/tbxctrls/layctrl.cxx
@@ -392,6 +392,8 @@ namespace {
class ColumnsWidget final : public weld::CustomWidgetController
{
private:
+ static constexpr long WIDTH = 5;
+
rtl::Reference<SvxColumnsToolBoxControl> mxControl;
weld::SpinButton& mrSpinButton;
@@ -401,7 +403,6 @@ private:
::Color aHighlightFillColor;
::Color aFaceColor;
long nCol;
- long nWidth;
long nMX;
bool m_bMod1;
@@ -455,7 +456,6 @@ ColumnsWidget::ColumnsWidget(SvxColumnsToolBoxControl* pControl, weld::SpinButto
: mxControl(pControl)
, mrSpinButton(rSpinButton)
, nCol(1)
- , nWidth(5)
, nMX(0)
, m_bMod1(false)
{
@@ -488,7 +488,7 @@ void ColumnsWidget::SetDrawingArea(weld::DrawingArea* pDrawingArea)
OutputDevice& rDevice = pDrawingArea->get_ref_device();
Size aLogicSize = rDevice.LogicToPixel( Size( 95, 155 ), MapMode( MapUnit::Map10thMM ) );
nMX = aLogicSize.Width();
- Size aSize(nMX*nWidth-1, aLogicSize.Height());
+ Size aSize(nMX*WIDTH-1, aLogicSize.Height());
pDrawingArea->set_size_request(aSize.Width(), aSize.Height());
CustomWidgetController::SetDrawingArea(pDrawingArea);
SetOutputSizePixel(aSize);
@@ -607,7 +607,7 @@ void ColumnsWidget::Paint(vcl::RenderContext& rRenderContext, const tools::Recta
long nLineWidth;
Size aSize(GetOutputSizePixel());
- for (i = 0; i < nWidth; i++)
+ for (i = 0; i < WIDTH; i++)
{
if (i < nCol)
{