convert HITTEST #define to enum
Change-Id: I2a4066c66894e0bd9c349a7c5b8db3a8398451d2
This commit is contained in:
parent
371c8f7a75
commit
09c95aba4a
3 changed files with 17 additions and 14 deletions
|
@ -61,8 +61,14 @@ class ToolBox;
|
|||
#define FLOATWIN_TITLE_NONE ((sal_uInt16)0x0008)
|
||||
|
||||
|
||||
// - FloatingWindow -
|
||||
enum HitTest
|
||||
{
|
||||
HITTEST_OUTSIDE,
|
||||
HITTEST_WINDOW,
|
||||
HITTEST_RECT
|
||||
};
|
||||
|
||||
// - FloatingWindow -
|
||||
|
||||
class VCL_DLLPUBLIC FloatingWindow : public SystemWindow
|
||||
{
|
||||
|
@ -100,10 +106,7 @@ protected:
|
|||
SAL_DLLPRIVATE void ImplLoadRes( const ResId& rResId );
|
||||
|
||||
public:
|
||||
#define IMPL_FLOATWIN_HITTEST_OUTSIDE ((sal_uInt16)0x0001)
|
||||
#define IMPL_FLOATWIN_HITTEST_WINDOW ((sal_uInt16)0x0002)
|
||||
#define IMPL_FLOATWIN_HITTEST_RECT ((sal_uInt16)0x0004)
|
||||
SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest );
|
||||
SAL_DLLPRIVATE FloatingWindow* ImplFloatHitTest( Window* pReference, const Point& rPos, HitTest& rHitTest );
|
||||
SAL_DLLPRIVATE FloatingWindow* ImplFindLastLevelFloat();
|
||||
SAL_DLLPRIVATE bool ImplIsFloatPopupModeWindow( const Window* pWindow );
|
||||
SAL_DLLPRIVATE void ImplSetMouseDown() { mbMouseDown = true; }
|
||||
|
|
|
@ -426,7 +426,7 @@ Point FloatingWindow::ImplCalcPos( Window* pWindow,
|
|||
return pW->OutputToScreenPixel( aPos );
|
||||
}
|
||||
|
||||
FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, sal_uInt16& rHitTest )
|
||||
FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Point& rPos, HitTest& rHitTest )
|
||||
{
|
||||
FloatingWindow* pWin = this;
|
||||
|
||||
|
@ -460,7 +460,7 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Poin
|
|||
Rectangle devRect( pBorderWin->ImplOutputToUnmirroredAbsoluteScreenPixel( Rectangle( aPt, pBorderWin->GetSizePixel()) ) ) ;
|
||||
if ( devRect.IsInside( aAbsolute ) )
|
||||
{
|
||||
rHitTest = IMPL_FLOATWIN_HITTEST_WINDOW;
|
||||
rHitTest = HITTEST_WINDOW;
|
||||
return pWin;
|
||||
}
|
||||
|
||||
|
@ -470,7 +470,7 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Poin
|
|||
// is already in absolute device coordinates
|
||||
if ( pWin->maFloatRect.IsInside( aAbsolute ) )
|
||||
{
|
||||
rHitTest = IMPL_FLOATWIN_HITTEST_RECT;
|
||||
rHitTest = HITTEST_RECT;
|
||||
return pWin;
|
||||
}
|
||||
|
||||
|
@ -478,7 +478,7 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Poin
|
|||
}
|
||||
while ( pWin );
|
||||
|
||||
rHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
|
||||
rHitTest = HITTEST_OUTSIDE;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
@ -73,7 +73,7 @@ static bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
|
|||
* #93895# since floats are system windows, coordinates have
|
||||
* to be converted to float relative for the hittest
|
||||
*/
|
||||
sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
|
||||
HitTest nHitTest = HITTEST_OUTSIDE;
|
||||
FloatingWindow* pFloat = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pChild, rMousePos, nHitTest );
|
||||
FloatingWindow* pLastLevelFloat;
|
||||
sal_uLong nPopupFlags;
|
||||
|
@ -82,7 +82,7 @@ static bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
|
|||
if ( bMouseLeave )
|
||||
return true;
|
||||
|
||||
if ( !pFloat || (nHitTest & IMPL_FLOATWIN_HITTEST_RECT) )
|
||||
if ( !pFloat || (nHitTest == HITTEST_RECT) )
|
||||
{
|
||||
if ( pSVData->maHelpData.mpHelpWin && !pSVData->maHelpData.mbKeyboardHelp )
|
||||
ImplDestroyHelpWindow( true );
|
||||
|
@ -107,7 +107,7 @@ static bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
|
|||
// else
|
||||
return true;
|
||||
}
|
||||
else if ( nHitTest & IMPL_FLOATWIN_HITTEST_RECT )
|
||||
else if ( nHitTest == HITTEST_RECT )
|
||||
{
|
||||
if ( !(pFloat->GetPopupModeFlags() & FLOATWIN_POPUPMODE_NOMOUSERECTCLOSE) )
|
||||
pFloat->ImplSetMouseDown();
|
||||
|
@ -118,7 +118,7 @@ static bool ImplHandleMouseFloatMode( Window* pChild, const Point& rMousePos,
|
|||
{
|
||||
if ( pFloat )
|
||||
{
|
||||
if ( nHitTest & IMPL_FLOATWIN_HITTEST_RECT )
|
||||
if ( nHitTest == HITTEST_RECT )
|
||||
{
|
||||
if ( pFloat->ImplIsMouseDown() )
|
||||
pFloat->EndPopupMode( FLOATWIN_POPUPMODEEND_CANCEL );
|
||||
|
@ -1420,7 +1420,7 @@ static bool ImplHandleWheelEvent( Window* pWindow, const SalWheelMouseEvent& rEv
|
|||
if ( pSVData->maWinData.mpFirstFloat && !pSVData->maWinData.mpCaptureWin &&
|
||||
!pSVData->maWinData.mpFirstFloat->ImplIsFloatPopupModeWindow( pWindow ) )
|
||||
{
|
||||
sal_uInt16 nHitTest = IMPL_FLOATWIN_HITTEST_OUTSIDE;
|
||||
HitTest nHitTest = HITTEST_OUTSIDE;
|
||||
pMouseWindow = pSVData->maWinData.mpFirstFloat->ImplFloatHitTest( pWindow, aMousePos, nHitTest );
|
||||
}
|
||||
// then try the window directly beneath the mouse
|
||||
|
|
Loading…
Reference in a new issue