[Libreoffice-commits] core.git: 2 commits - include/vcl svx/source vcl/source
Noel Grandin
noel at peralex.com
Fri Jul 18 00:38:59 PDT 2014
include/vcl/floatwin.hxx | 13 ++++++++-----
svx/source/form/fmpgeimp.cxx | 10 ++++------
vcl/source/window/floatwin.cxx | 8 ++++----
vcl/source/window/winproc.cxx | 10 +++++-----
4 files changed, 21 insertions(+), 20 deletions(-)
New commits:
commit 09c95aba4a5208a23eaeca9f4408ff5d87c898b9
Author: Noel Grandin <noel at peralex.com>
Date: Fri Jul 18 09:36:48 2014 +0200
convert HITTEST #define to enum
Change-Id: I2a4066c66894e0bd9c349a7c5b8db3a8398451d2
diff --git a/include/vcl/floatwin.hxx b/include/vcl/floatwin.hxx
index 62d0086..45aefab 100644
--- a/include/vcl/floatwin.hxx
+++ b/include/vcl/floatwin.hxx
@@ -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; }
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index 5163b51..a77c38f 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -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;
}
diff --git a/vcl/source/window/winproc.cxx b/vcl/source/window/winproc.cxx
index 4fab948..0763780 100644
--- a/vcl/source/window/winproc.cxx
+++ b/vcl/source/window/winproc.cxx
@@ -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
commit 371c8f7a750adcdecd32aad9c93a8eb235b908be
Author: Noel Grandin <noel at peralex.com>
Date: Thu Jul 17 15:57:08 2014 +0200
inline unnecessary typedef
Change-Id: Ie33e6b9038d6c18482c2ba7aa47f62d23973ab08
diff --git a/svx/source/form/fmpgeimp.cxx b/svx/source/form/fmpgeimp.cxx
index 2a7a4fb..22a0a33 100644
--- a/svx/source/form/fmpgeimp.cxx
+++ b/svx/source/form/fmpgeimp.cxx
@@ -77,12 +77,10 @@ FmFormPageImpl::FmFormPageImpl( FmFormPage& _rPage )
namespace
{
- typedef Reference< XInterface > FormComponent;
-
class FormComponentInfo
{
public:
- size_t childCount( const FormComponent& _component ) const
+ size_t childCount( const Reference< XInterface >& _component ) const
{
Reference< XIndexAccess > xContainer( _component, UNO_QUERY );
if ( xContainer.is() )
@@ -90,14 +88,14 @@ namespace
return 0;
}
- FormComponent getChild( const FormComponent& _component, size_t _index ) const
+ Reference< XInterface > getChild( const Reference< XInterface >& _component, size_t _index ) const
{
Reference< XIndexAccess > xContainer( _component, UNO_QUERY_THROW );
- return FormComponent( xContainer->getByIndex( _index ), UNO_QUERY );
+ return Reference< XInterface >( xContainer->getByIndex( _index ), UNO_QUERY );
}
};
- typedef ::std::pair< FormComponent, FormComponent > FormComponentPair;
+ typedef ::std::pair< Reference< XInterface >, Reference< XInterface > > FormComponentPair;
class FormHierarchyComparator
{
More information about the Libreoffice-commits
mailing list