[Libreoffice-commits] core.git: vcl/osx

Robert Antoni Buj Gelonch robert.buj at gmail.com
Thu Apr 9 01:59:26 PDT 2015


 vcl/osx/salnativewidgets.cxx |  135 +------------------------------------------
 1 file changed, 4 insertions(+), 131 deletions(-)

New commits:
commit 1af750ceed914cee01357fd83303df35b5b3dac8
Author: Robert Antoni Buj Gelonch <robert.buj at gmail.com>
Date:   Wed Feb 25 18:46:17 2015 +0100

    NSAppKitVersionNumber is always greater than NSAppKitVersionNumber10_7
    
    Change-Id: I9e2b9388c5df1b3a5fc0b2deb570b6f63e59b8eb
    Reviewed-on: https://gerrit.libreoffice.org/14637
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 559b418..041df33 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -36,10 +36,6 @@
 
 #include <cuidraw.hxx>
 
-#ifndef NSAppKitVersionNumber10_7
-#define NSAppKitVersionNumber10_7 1138
-#endif
-
 #if !HAVE_FEATURE_MACOSX_SANDBOX
 
 @interface NSWindow(CoreUIRendererPrivate)
@@ -130,131 +126,29 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */  ControlPart nPart,
     switch( nPart )
     {
         case PART_BUTTON_UP:
-            if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
-            {
-                if( GetSalData()->mbIsScrollbarDoubleMax )
-                    rResultRect.Top() = rControlRect.Bottom() - 2*BUTTON_HEIGHT;
-                rResultRect.Bottom() = rResultRect.Top() + BUTTON_HEIGHT;
-            }
-            else
-            {
-                rResultRect.Bottom() = rResultRect.Top();
-            }
+            rResultRect.Bottom() = rResultRect.Top();
             break;
 
         case PART_BUTTON_DOWN:
-            if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
-            {
-                rResultRect.Top() = rControlRect.Bottom() - BUTTON_HEIGHT;
-            }
-            else
-            {
-                rResultRect.Top() = rResultRect.Bottom();
-            }
+            rResultRect.Top() = rResultRect.Bottom();
             break;
 
         case PART_BUTTON_LEFT:
-            if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
-            {
-                if( GetSalData()->mbIsScrollbarDoubleMax )
-                    rResultRect.Left() = rControlRect.Right() - 2*BUTTON_WIDTH;
-                rResultRect.Right() = rResultRect.Left() + BUTTON_WIDTH;
-            }
-            else
-            {
-                rResultRect.Right() = rResultRect.Left();
-            }
+            rResultRect.Right() = rResultRect.Left();
             break;
 
         case PART_BUTTON_RIGHT:
-            if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
-            {
-                rResultRect.Left() = rControlRect.Right() - BUTTON_WIDTH;
-            }
-            else
-            {
-                rResultRect.Left() = rResultRect.Right();
-            }
+            rResultRect.Left() = rResultRect.Right();
             break;
 
         case PART_TRACK_HORZ_AREA:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            rResultRect.Right() -= BUTTON_WIDTH + 1;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-                rResultRect.Right() -= BUTTON_WIDTH;
-            else
-                rResultRect.Left() += BUTTON_WIDTH + 1;
-            break;
-
         case PART_TRACK_VERT_AREA:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            rResultRect.Bottom() -= BUTTON_HEIGHT + 1;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-                rResultRect.Bottom() -= BUTTON_HEIGHT;
-            else
-                rResultRect.Top() += BUTTON_HEIGHT + 1;
-            break;
         case PART_THUMB_HORZ:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-            {
-                rResultRect.Left() += 8;
-                rResultRect.Right() += 6;
-            }
-            else
-            {
-                rResultRect.Left() += 4;
-                rResultRect.Right() += 4;
-            }
-            break;
         case PART_THUMB_VERT:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-            {
-                rResultRect.Top() += 8;
-                rResultRect.Bottom() += 8;
-            }
-            else
-            {
-                rResultRect.Top() += 4;
-                rResultRect.Bottom() += 4;
-            }
-            break;
         case PART_TRACK_HORZ_LEFT:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-                rResultRect.Right() += 8;
-            else
-                rResultRect.Right() += 4;
-            break;
         case PART_TRACK_HORZ_RIGHT:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-                rResultRect.Left() += 6;
-            else
-                rResultRect.Left() += 4;
-            break;
         case PART_TRACK_VERT_UPPER:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-                rResultRect.Bottom() += 8;
-            else
-                rResultRect.Bottom() += 4;
-            break;
         case PART_TRACK_VERT_LOWER:
-            if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
-                break;
-            if( GetSalData()->mbIsScrollbarDoubleMax )
-                rResultRect.Top() += 8;
-            else
-                rResultRect.Top() += 4;
             break;
         default:
             bRetVal = false;
@@ -412,27 +306,6 @@ bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart
         Rectangle aRect;
         bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
         rIsInside = bValid && aRect.IsInside( rPos );
-        if( NSAppKitVersionNumber < NSAppKitVersionNumber10_7 &&
-            GetSalData()->mbIsScrollbarDoubleMax )
-        {
-            // in double max mode the actual trough is a little smaller than the track
-            // there is some visual filler that is not sensitive
-            if( bValid && rIsInside )
-            {
-                if( nPart == PART_TRACK_HORZ_AREA )
-                {
-                    // the left 4 pixels are not hit sensitive
-                    if( rPos.X() - aRect.Left() < 4 )
-                        rIsInside = false;
-                }
-                else if( nPart == PART_TRACK_VERT_AREA )
-                {
-                    // the top 4 pixels are not hit sensitive
-                    if( rPos.Y() - aRect.Top() < 4 )
-                        rIsInside = false;
-                }
-            }
-        }
         return bValid;
     }  //  CTRL_SCROLLBAR
 


More information about the Libreoffice-commits mailing list