Author: af
Date: Wed Jun 12 13:15:45 2013
New Revision: 1492181
URL: http://svn.apache.org/r1492181
Log:
122453: Initialize and update units of PosSize panel spin fields.
Modified:
openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
Modified:
openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
URL:
http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx?rev=1492181&r1=1492180&r2=1492181&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
(original)
+++ openoffice/trunk/main/svx/source/sidebar/possize/PosSizePropertyPanel.cxx
Wed Jun 12 13:15:45 2013
@@ -720,6 +720,11 @@ void PosSizePropertyPanel::NotifyItemUpd
else
mbAdjustEnabled = false;
+ // Pool unit and dialog unit may have changed, make sure that we
+ // have the current values.
+ mePoolUnit = maTransfWidthControl.GetCoreMetric();
+ meDlgUnit = GetModuleFieldUnit();
+
switch (nSID)
{
case SID_ATTR_TRANSFORM_WIDTH:
@@ -732,6 +737,7 @@ void PosSizePropertyPanel::NotifyItemUpd
long mlOldWidth1 = pWidthItem->GetValue();
mlOldWidth1 = Fraction( mlOldWidth1 ) / maUIScale;
+ SetFieldUnit( *mpMtrWidth, meDlgUnit, true );
SetMetricValue( *mpMtrWidth, mlOldWidth1, mePoolUnit );
mlOldWidth = mlOldWidth1;
break;
@@ -751,6 +757,7 @@ void PosSizePropertyPanel::NotifyItemUpd
long mlOldHeight1 = pHeightItem->GetValue();
mlOldHeight1 = Fraction( mlOldHeight1 ) / maUIScale;
+ SetFieldUnit( *mpMtrHeight, meDlgUnit, true );
SetMetricValue( *mpMtrHeight, mlOldHeight1, mePoolUnit );
mlOldHeight = mlOldHeight1;
break;
@@ -769,6 +776,7 @@ void PosSizePropertyPanel::NotifyItemUpd
{
long nTmp = pItem->GetValue();
nTmp = Fraction( nTmp ) / maUIScale;
+ SetFieldUnit( *mpMtrPosX, meDlgUnit, true );
SetMetricValue( *mpMtrPosX, nTmp, mePoolUnit );
break;
}
@@ -786,6 +794,7 @@ void PosSizePropertyPanel::NotifyItemUpd
{
long nTmp = pItem->GetValue();
nTmp = Fraction( nTmp ) / maUIScale;
+ SetFieldUnit( *mpMtrPosY, meDlgUnit, true );
SetMetricValue( *mpMtrPosY, nTmp, mePoolUnit );
break;
}