Kaydet (Commit) 173aa749 authored tarafından Noel Grandin's avatar Noel Grandin

convert INVERT flags to scoped enum

Change-Id: Iad8faee927de1ad646975157e36c3027c0ba8149
üst 79db3fc0
...@@ -273,8 +273,16 @@ namespace o3tl ...@@ -273,8 +273,16 @@ namespace o3tl
#define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002) #define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002)
// Flags for Invert() // Flags for Invert()
#define INVERT_HIGHLIGHT ((sal_uInt16)0x0001) enum class InvertFlags
#define INVERT_50 ((sal_uInt16)0x0002) {
NONE = 0x0000,
Highlight = 0x0001,
N50 = 0x0002,
};
namespace o3tl
{
template<> struct typed_flags<InvertFlags> : is_typed_flags<InvertFlags, 0x0003> {};
}
// Flags for ShowTracking() // Flags for ShowTracking()
#define SHOWTRACK_SMALL ((sal_uInt16)0x0001) #define SHOWTRACK_SMALL ((sal_uInt16)0x0001)
...@@ -1239,8 +1247,8 @@ public: ...@@ -1239,8 +1247,8 @@ public:
virtual void ShowFocus(const Rectangle& rRect); virtual void ShowFocus(const Rectangle& rRect);
void HideFocus(); void HideFocus();
void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 ); void Invert( const Rectangle& rRect, InvertFlags nFlags = InvertFlags::NONE );
void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 ); void Invert( const Polygon& rPoly, InvertFlags nFlags = InvertFlags::NONE );
// transparent background for selected or checked items in toolboxes etc. // transparent background for selected or checked items in toolboxes etc.
void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder, bool bDrawExtBorderOnly ); void DrawSelectionBackground( const Rectangle& rRect, sal_uInt16 highlight, bool bChecked, bool bDrawBorder, bool bDrawExtBorderOnly );
......
...@@ -1567,12 +1567,12 @@ void ScPreview::DrawInvert( long nDragPos, PointerStyle nFlags ) ...@@ -1567,12 +1567,12 @@ void ScPreview::DrawInvert( long nDragPos, PointerStyle nFlags )
if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit ) if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit )
{ {
Rectangle aRect( nDragPos, -aOffset.Y(), nDragPos + 1,(long)( ( nHeight * HMM_PER_TWIPS ) - aOffset.Y())); Rectangle aRect( nDragPos, -aOffset.Y(), nDragPos + 1,(long)( ( nHeight * HMM_PER_TWIPS ) - aOffset.Y()));
Invert( aRect,INVERT_50 ); Invert( aRect, InvertFlags::N50 );
} }
else if( nFlags == PointerStyle::VSizeBar ) else if( nFlags == PointerStyle::VSizeBar )
{ {
Rectangle aRect( -aOffset.X(), nDragPos,(long)( ( nWidth * HMM_PER_TWIPS ) - aOffset.X() ), nDragPos + 1 ); Rectangle aRect( -aOffset.X(), nDragPos,(long)( ( nWidth * HMM_PER_TWIPS ) - aOffset.X() ), nDragPos + 1 );
Invert( aRect,INVERT_50 ); Invert( aRect, InvertFlags::N50 );
} }
} }
......
...@@ -1160,7 +1160,7 @@ void ScrollBar::ImplInvert() ...@@ -1160,7 +1160,7 @@ void ScrollBar::ImplInvert()
aRect.Bottom() -= 2; aRect.Bottom() -= 2;
} }
Invert( aRect, 0 ); Invert( aRect );
} }
void ScrollBar::GetFocus() void ScrollBar::GetFocus()
......
...@@ -46,11 +46,11 @@ static void ImplCursorInvert( ImplCursorData* pData ) ...@@ -46,11 +46,11 @@ static void ImplCursorInvert( ImplCursorData* pData )
vcl::Window* pWindow = pData->mpWindow; vcl::Window* pWindow = pData->mpWindow;
bool bMapMode = pWindow->IsMapModeEnabled(); bool bMapMode = pWindow->IsMapModeEnabled();
pWindow->EnableMapMode( false ); pWindow->EnableMapMode( false );
sal_uInt16 nInvertStyle; InvertFlags nInvertStyle;
if ( pData->mnStyle & CURSOR_SHADOW ) if ( pData->mnStyle & CURSOR_SHADOW )
nInvertStyle = INVERT_50; nInvertStyle = InvertFlags::N50;
else else
nInvertStyle = 0; nInvertStyle = InvertFlags::NONE;
Rectangle aRect( pData->maPixPos, pData->maPixSize ); Rectangle aRect( pData->maPixPos, pData->maPixSize );
if ( pData->mnDirection != CursorDirection::NONE || pData->mnOrientation || pData->mnPixSlant ) if ( pData->mnDirection != CursorDirection::NONE || pData->mnOrientation || pData->mnPixSlant )
......
...@@ -127,7 +127,7 @@ void Window::HideFocus() ...@@ -127,7 +127,7 @@ void Window::HideFocus()
mpWindowImpl->mbInHideFocus = false; mpWindowImpl->mbInHideFocus = false;
} }
void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags ) void Window::Invert( const Rectangle& rRect, InvertFlags nFlags )
{ {
if ( !IsDeviceOutputNecessary() ) if ( !IsDeviceOutputNecessary() )
return; return;
...@@ -153,14 +153,14 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags ) ...@@ -153,14 +153,14 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
return; return;
SalInvert nSalFlags = 0; SalInvert nSalFlags = 0;
if ( nFlags & INVERT_HIGHLIGHT ) if ( nFlags & InvertFlags::Highlight )
nSalFlags |= SAL_INVERT_HIGHLIGHT; nSalFlags |= SAL_INVERT_HIGHLIGHT;
if ( nFlags & INVERT_50 ) if ( nFlags & InvertFlags::N50 )
nSalFlags |= SAL_INVERT_50; nSalFlags |= SAL_INVERT_50;
mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, this ); mpGraphics->Invert( aRect.Left(), aRect.Top(), aRect.GetWidth(), aRect.GetHeight(), nSalFlags, this );
} }
void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags ) void Window::Invert( const Polygon& rPoly, InvertFlags nFlags )
{ {
if ( !IsDeviceOutputNecessary() ) if ( !IsDeviceOutputNecessary() )
return; return;
...@@ -187,9 +187,9 @@ void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags ) ...@@ -187,9 +187,9 @@ void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
return; return;
SalInvert nSalFlags = 0; SalInvert nSalFlags = 0;
if ( nFlags & INVERT_HIGHLIGHT ) if ( nFlags & InvertFlags::Highlight )
nSalFlags |= SAL_INVERT_HIGHLIGHT; nSalFlags |= SAL_INVERT_HIGHLIGHT;
if ( nFlags & INVERT_50 ) if ( nFlags & InvertFlags::N50 )
nSalFlags |= SAL_INVERT_50; nSalFlags |= SAL_INVERT_50;
const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry()); const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry());
mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this ); mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment