Kaydet (Commit) 5d8bbe5f authored tarafından Andre Fischer's avatar Andre Fischer

122453: Initialize and update units of PosSize panel spin fields.

üst f7f162ae
...@@ -720,6 +720,11 @@ void PosSizePropertyPanel::NotifyItemUpdate( ...@@ -720,6 +720,11 @@ void PosSizePropertyPanel::NotifyItemUpdate(
else else
mbAdjustEnabled = false; 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) switch (nSID)
{ {
case SID_ATTR_TRANSFORM_WIDTH: case SID_ATTR_TRANSFORM_WIDTH:
...@@ -732,6 +737,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( ...@@ -732,6 +737,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
long mlOldWidth1 = pWidthItem->GetValue(); long mlOldWidth1 = pWidthItem->GetValue();
mlOldWidth1 = Fraction( mlOldWidth1 ) / maUIScale; mlOldWidth1 = Fraction( mlOldWidth1 ) / maUIScale;
SetFieldUnit( *mpMtrWidth, meDlgUnit, true );
SetMetricValue( *mpMtrWidth, mlOldWidth1, mePoolUnit ); SetMetricValue( *mpMtrWidth, mlOldWidth1, mePoolUnit );
mlOldWidth = mlOldWidth1; mlOldWidth = mlOldWidth1;
break; break;
...@@ -751,6 +757,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( ...@@ -751,6 +757,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
long mlOldHeight1 = pHeightItem->GetValue(); long mlOldHeight1 = pHeightItem->GetValue();
mlOldHeight1 = Fraction( mlOldHeight1 ) / maUIScale; mlOldHeight1 = Fraction( mlOldHeight1 ) / maUIScale;
SetFieldUnit( *mpMtrHeight, meDlgUnit, true );
SetMetricValue( *mpMtrHeight, mlOldHeight1, mePoolUnit ); SetMetricValue( *mpMtrHeight, mlOldHeight1, mePoolUnit );
mlOldHeight = mlOldHeight1; mlOldHeight = mlOldHeight1;
break; break;
...@@ -769,6 +776,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( ...@@ -769,6 +776,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
{ {
long nTmp = pItem->GetValue(); long nTmp = pItem->GetValue();
nTmp = Fraction( nTmp ) / maUIScale; nTmp = Fraction( nTmp ) / maUIScale;
SetFieldUnit( *mpMtrPosX, meDlgUnit, true );
SetMetricValue( *mpMtrPosX, nTmp, mePoolUnit ); SetMetricValue( *mpMtrPosX, nTmp, mePoolUnit );
break; break;
} }
...@@ -786,6 +794,7 @@ void PosSizePropertyPanel::NotifyItemUpdate( ...@@ -786,6 +794,7 @@ void PosSizePropertyPanel::NotifyItemUpdate(
{ {
long nTmp = pItem->GetValue(); long nTmp = pItem->GetValue();
nTmp = Fraction( nTmp ) / maUIScale; nTmp = Fraction( nTmp ) / maUIScale;
SetFieldUnit( *mpMtrPosY, meDlgUnit, true );
SetMetricValue( *mpMtrPosY, nTmp, mePoolUnit ); SetMetricValue( *mpMtrPosY, nTmp, mePoolUnit );
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment