summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-05-20 16:20:42 +0200
committerCaolán McNamara <caolanm@redhat.com>2014-05-21 08:13:07 -0500
commitae25bede31aba18d7fa0ed90050f6e82f0507514 (patch)
tree7a6f358e020f08f5de2b8cd7d33f8ae04e233adf /svx
parent0c16a3cea9845c37b5cc73da44e8a55d6ad30eea (diff)
SvxRelativeField: set the unit from the passed stringmap
In the Paragraph "Indents & Spacing" tab there are fields with unit: <object class="svxlo-SvxRelativeField" id="spinED_LEFTINDENT:0cm"> But the unit is effectively ignored, and the resulting SvxRelativeField with FUNIT_NONE and 9999 max somehow results in 0.18cm max when the dialog sets cm as unit. (cherry picked from commit 68bc8af6b6c4d0399bd10ed450d81aa2f17931a1) Conflicts: svx/source/dialog/relfld.cxx Change-Id: I6001c93079fd7d899f1e119913b29ea4898b1c34 Reviewed-on: https://gerrit.libreoffice.org/9416 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/relfld.cxx13
1 files changed, 10 insertions, 3 deletions
diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx
index 67a4a59d4fca..52479b5f5907 100644
--- a/svx/source/dialog/relfld.cxx
+++ b/svx/source/dialog/relfld.cxx
@@ -22,21 +22,28 @@
// -----------------------------------------------------------------------
-SvxRelativeField::SvxRelativeField( Window* pParent, WinBits nBits) :
+SvxRelativeField::SvxRelativeField(Window* pParent, WinBits nBits, FieldUnit const eUnit)
+ :
MetricField( pParent, nBits)
{
bNegativeEnabled = sal_False;
bRelativeMode = sal_False;
bRelative = sal_False;
+ SetUnit(eUnit);
SetDecimalDigits( 2 );
SetMin( 0 );
SetMax( 9999 );
}
-extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL makeSvxRelativeField(Window *pParent, VclBuilder::stringmap &)
+extern "C" SAL_DLLPUBLIC_EXPORT Window* SAL_CALL
+makeSvxRelativeField(Window *const pParent, VclBuilder::stringmap & rMap)
{
- return new SvxRelativeField(pParent, WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP);
+ OString const custom(VclBuilder::extractCustomProperty(rMap));
+ FieldUnit const eUnit(VclBuilder::detectUnit(custom));
+ SvxRelativeField *const pRet = new SvxRelativeField(pParent,
+ WB_BORDER | WB_SPIN | WB_REPEAT | WB_LEFT | WB_GROUP, eUnit);
+ return pRet;
}
// -----------------------------------------------------------------------