summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2016-05-24 09:32:18 +0200
committerNoel Grandin <noelgrandin@gmail.com>2016-05-24 13:07:18 +0000
commitd31935043f7b4ce44811cd6de51f64eb207a6b3a (patch)
tree714429bc7bc3de9c1f4b1066b54bde431584b38e /vcl
parentfe0bba96ac0682eeba1757ede42b5fdef22764b8 (diff)
Convert WINDOW_HITTEST to scoped enum
Change-Id: I18c3798ae41eeffe96797828709f6ee42b32fcbe Reviewed-on: https://gerrit.libreoffice.org/25395 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/inc/window.h4
-rw-r--r--vcl/source/window/mouse.cxx10
-rw-r--r--vcl/source/window/stacking.cxx6
3 files changed, 9 insertions, 11 deletions
diff --git a/vcl/inc/window.h b/vcl/inc/window.h
index 701ad431dd44..cfd214d8098f 100644
--- a/vcl/inc/window.h
+++ b/vcl/inc/window.h
@@ -21,6 +21,7 @@
#define INCLUDED_VCL_INC_WINDOW_H
#include <sal/config.h>
+
#include <tools/fract.hxx>
#include <vcl/idle.hxx>
#include <vcl/rendersettings.hxx>
@@ -80,9 +81,6 @@ namespace dnd {
bool ImplWindowFrameProc( vcl::Window* pInst, SalEvent nEvent, const void* pEvent );
-#define WINDOW_HITTEST_INSIDE ((sal_uInt16)0x0001)
-#define WINDOW_HITTEST_TRANSPARENT ((sal_uInt16)0x0002)
-
struct ImplWinData
{
OUString* mpExtOldText;
diff --git a/vcl/source/window/mouse.cxx b/vcl/source/window/mouse.cxx
index 19cdc7334cbc..b47949d06446 100644
--- a/vcl/source/window/mouse.cxx
+++ b/vcl/source/window/mouse.cxx
@@ -50,7 +50,7 @@ using namespace ::com::sun::star::uno;
namespace vcl {
-sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
+WindowHitTest Window::ImplHitTest( const Point& rFramePos )
{
Point aFramePos( rFramePos );
if( ImplIsAntiparallel() )
@@ -61,19 +61,19 @@ sal_uInt16 Window::ImplHitTest( const Point& rFramePos )
}
Rectangle aRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
if ( !aRect.IsInside( aFramePos ) )
- return 0;
+ return WindowHitTest::NONE;
if ( mpWindowImpl->mbWinRegion )
{
Point aTempPos = aFramePos;
aTempPos.X() -= mnOutOffX;
aTempPos.Y() -= mnOutOffY;
if ( !mpWindowImpl->maWinRegion.IsInside( aTempPos ) )
- return 0;
+ return WindowHitTest::NONE;
}
- sal_uInt16 nHitTest = WINDOW_HITTEST_INSIDE;
+ WindowHitTest nHitTest = WindowHitTest::Inside;
if ( mpWindowImpl->mbMouseTransparent )
- nHitTest |= WINDOW_HITTEST_TRANSPARENT;
+ nHitTest |= WindowHitTest::Transparent;
return nHitTest;
}
diff --git a/vcl/source/window/stacking.cxx b/vcl/source/window/stacking.cxx
index cb51c6d03e31..b9bab21e9392 100644
--- a/vcl/source/window/stacking.cxx
+++ b/vcl/source/window/stacking.cxx
@@ -661,8 +661,8 @@ vcl::Window* Window::ImplFindWindow( const Point& rFramePos )
if ( !mpWindowImpl->mbVisible )
return nullptr;
- sal_uInt16 nHitTest = ImplHitTest( rFramePos );
- if ( nHitTest & WINDOW_HITTEST_INSIDE )
+ WindowHitTest nHitTest = ImplHitTest( rFramePos );
+ if ( nHitTest & WindowHitTest::Inside )
{
// and then we check all child windows
pTempWindow = mpWindowImpl->mpFirstChild;
@@ -674,7 +674,7 @@ vcl::Window* Window::ImplFindWindow( const Point& rFramePos )
pTempWindow = pTempWindow->mpWindowImpl->mpNext;
}
- if ( nHitTest & WINDOW_HITTEST_TRANSPARENT )
+ if ( nHitTest & WindowHitTest::Transparent )
return nullptr;
else
return this;