[Libreoffice-commits] core.git: 2 commits - vcl/source

Stephan Bergmann sbergman at redhat.com
Mon Jun 15 01:12:49 PDT 2015


 vcl/source/outdev/map.cxx |   53 ++++++++++++++++++++++------------------------
 1 file changed, 26 insertions(+), 27 deletions(-)

New commits:
commit 0b255720a60f15ffe8006b37e367378b229e245f
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jun 15 10:12:19 2015 +0200

    Fix indentation
    
    Change-Id: I687f7020284d86a880a0a5db31658f01edf8e850

diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 8255c2e..4f2863e 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -366,13 +366,13 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
 #if (SAL_TYPES_SIZEOFLONG < 8)
     if( (+n < nThres) && (-n < nThres) )
     {
-       n *= nMapNum * nDPI;
-       if( nMapDenom != 1 )
-       {
-          n = (2 * n) / nMapDenom;
-          if( n < 0 ) --n; else ++n;
-          n /= 2;
-       }
+        n *= nMapNum * nDPI;
+        if( nMapDenom != 1 )
+        {
+            n = (2 * n) / nMapDenom;
+            if( n < 0 ) --n; else ++n;
+            n /= 2;
+        }
     }
     else
 #else
@@ -381,17 +381,17 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
     assert(nMapNum == 0 || std::abs(n) < std::numeric_limits<long>::max() / nMapNum / nDPI); //detect overflows
 #endif
     {
-       sal_Int64 n64 = n;
-       n64 *= nMapNum;
-       n64 *= nDPI;
-       if( nMapDenom == 1 )
-          n = (long)n64;
-       else
-       {
-          n = (long)(2 * n64 / nMapDenom);
-          if( n < 0 ) --n; else ++n;
-          n /= 2;
-       }
+        sal_Int64 n64 = n;
+        n64 *= nMapNum;
+        n64 *= nDPI;
+        if( nMapDenom == 1 )
+            n = (long)n64;
+        else
+        {
+            n = (long)(2 * n64 / nMapDenom);
+            if( n < 0 ) --n; else ++n;
+            n /= 2;
+        }
     }
     return n;
 }
commit 1bd2fe8943a0235b20c6d6fba09ec0cf8b268066
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Mon Jun 15 10:01:59 2015 +0200

    Minor clean up
    
    Change-Id: I8e4d123626b5ef750c3b266d1aa1c96e1944b080

diff --git a/vcl/source/outdev/map.cxx b/vcl/source/outdev/map.cxx
index 37db101..8255c2e 100644
--- a/vcl/source/outdev/map.cxx
+++ b/vcl/source/outdev/map.cxx
@@ -362,8 +362,7 @@ void OutputDevice::ImplInvalidateViewTransform()
 static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
                               long nThres )
 {
-    // To "use" it...
-    (void) nThres;
+    assert(nDPI > 0);
 #if (SAL_TYPES_SIZEOFLONG < 8)
     if( (+n < nThres) && (-n < nThres) )
     {
@@ -377,8 +376,8 @@ static long ImplLogicToPixel( long n, long nDPI, long nMapNum, long nMapDenom,
     }
     else
 #else
+    (void) nThres;
     assert(nMapNum >= 0);
-    assert(nDPI > 0);
     assert(nMapNum == 0 || std::abs(n) < std::numeric_limits<long>::max() / nMapNum / nDPI); //detect overflows
 #endif
     {
@@ -401,16 +400,16 @@ static long ImplPixelToLogic( long n, long nDPI, long nMapNum, long nMapDenom,
                               long nThres )
 {
     assert(nDPI > 0);
-    // To "use" it...
-   (void) nThres;
-   if (nMapNum == 0)
-   {
-       return 0;
-   }
+    if (nMapNum == 0)
+    {
+        return 0;
+    }
 #if (SAL_TYPES_SIZEOFLONG < 8)
     if( (+n < nThres) && (-n < nThres) )
         n = (2 * n * nMapDenom) / (nDPI * nMapNum);
     else
+#else
+    (void) nThres;
 #endif
     {
         sal_Int64 n64 = n;


More information about the Libreoffice-commits mailing list