summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2014-05-20 16:20:42 +0200
committerMichael Stahl <mstahl@redhat.com>2014-05-20 16:44:29 +0200
commit68bc8af6b6c4d0399bd10ed450d81aa2f17931a1 (patch)
treef3fde30fe52bccf4932cf932b2ed0543d54f72cc /svx
parent35199df7b7af9d9dd3e98eb5f1b24ac1d407345c (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. Change-Id: I6001c93079fd7d899f1e119913b29ea4898b1c34
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/relfld.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/svx/source/dialog/relfld.cxx b/svx/source/dialog/relfld.cxx
index 1031c894d78f..b4db0011d6c2 100644
--- a/svx/source/dialog/relfld.cxx
+++ b/svx/source/dialog/relfld.cxx
@@ -22,7 +22,8 @@
-SvxRelativeField::SvxRelativeField( Window* pParent, WinBits nBits)
+SvxRelativeField::SvxRelativeField(
+ Window *const pParent, WinBits const nBits, FieldUnit const eUnit)
: MetricField( pParent, nBits)
, nRelMin(0)
, nRelMax(0)
@@ -32,15 +33,20 @@ SvxRelativeField::SvxRelativeField( Window* pParent, WinBits nBits)
, bNegativeEnabled(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;
}