summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-05-20 16:20:42 +0200
committerAndras Timar <andras.timar@collabora.com>2014-05-22 16:14:13 +0200
commita987c3ad1844d2f6babde18b73baf9cc6f2f75db (patch)
tree6dbfad737bc2c1016ad2ce891b7f022e9db8beac /svx
parent1688168de06c1efd09ddc62b01745403aa093289 (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;
}
// -----------------------------------------------------------------------