You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by al...@apache.org on 2014/03/20 14:01:49 UTC

svn commit: r1579612 - /openoffice/trunk/main/svx/source/tbxctrls/itemwin.cxx

Author: alg
Date: Thu Mar 20 13:01:49 2014
New Revision: 1579612

URL: http://svn.apache.org/r1579612
Log:
i124425 corrected SvxMetricField::Down() behaviour

Modified:
    openoffice/trunk/main/svx/source/tbxctrls/itemwin.cxx

Modified: openoffice/trunk/main/svx/source/tbxctrls/itemwin.cxx
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/svx/source/tbxctrls/itemwin.cxx?rev=1579612&r1=1579611&r2=1579612&view=diff
==============================================================================
--- openoffice/trunk/main/svx/source/tbxctrls/itemwin.cxx (original)
+++ openoffice/trunk/main/svx/source/tbxctrls/itemwin.cxx Thu Mar 20 13:01:49 2014
@@ -544,12 +544,26 @@ void SvxMetricField::ReleaseFocus_Impl()
 
 void SvxMetricField::Down()
 {
-	sal_Int64 nValue = GetValue();
-	nValue -= GetSpinSize();
+    // #124425# make the OS2 case OS2-only (if still needed); under
+    // non-OS2 it prevents the value to go to zero on down presses,
+    // s do not use there. Also added a fix for OS2, but could not test
+#ifdef OS2
+    const sal_Int64 nValue(GetValue() - GetSpinSize());
 
-	// Um unter OS/2 einen Sprung auf Max zu verhindern
-	if ( nValue >= GetMin() )
-		MetricField::Down();
+    // prevent a jump to spin max on OS2
+    if ( nValue >= GetMin() )
+    {
+        MetricField::Down();
+    }
+    else if ( nValue < GetMin() )
+    {
+        // still set to GetMin() when spin min is reached
+        SetMetricValue( *this, GetMin(), ePoolUnit );
+    }
+
+#else
+    MetricField::Down();
+#endif
 }
 
 // -----------------------------------------------------------------------