convert INVERT flags to scoped enum
Change-Id: Iad8faee927de1ad646975157e36c3027c0ba8149
This commit is contained in:
@@ -273,8 +273,16 @@ namespace o3tl
|
||||
#define PARENTCLIPMODE_NOCLIP ((sal_uInt16)0x0002)
|
||||
|
||||
// Flags for Invert()
|
||||
#define INVERT_HIGHLIGHT ((sal_uInt16)0x0001)
|
||||
#define INVERT_50 ((sal_uInt16)0x0002)
|
||||
enum class InvertFlags
|
||||
{
|
||||
NONE = 0x0000,
|
||||
Highlight = 0x0001,
|
||||
N50 = 0x0002,
|
||||
};
|
||||
namespace o3tl
|
||||
{
|
||||
template<> struct typed_flags<InvertFlags> : is_typed_flags<InvertFlags, 0x0003> {};
|
||||
}
|
||||
|
||||
// Flags for ShowTracking()
|
||||
#define SHOWTRACK_SMALL ((sal_uInt16)0x0001)
|
||||
@@ -1239,8 +1247,8 @@ public:
|
||||
virtual void ShowFocus(const Rectangle& rRect);
|
||||
void HideFocus();
|
||||
|
||||
void Invert( const Rectangle& rRect, sal_uInt16 nFlags = 0 );
|
||||
void Invert( const Polygon& rPoly, sal_uInt16 nFlags = 0 );
|
||||
void Invert( const Rectangle& rRect, InvertFlags nFlags = InvertFlags::NONE );
|
||||
void Invert( const Polygon& rPoly, InvertFlags nFlags = InvertFlags::NONE );
|
||||
|
||||
// transparent background for selected or checked items in toolboxes etc.
|
||||
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 )
|
||||
if( nFlags == PointerStyle::HSizeBar || nFlags == PointerStyle::HSplit )
|
||||
{
|
||||
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 )
|
||||
{
|
||||
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()
|
||||
aRect.Bottom() -= 2;
|
||||
}
|
||||
|
||||
Invert( aRect, 0 );
|
||||
Invert( aRect );
|
||||
}
|
||||
|
||||
void ScrollBar::GetFocus()
|
||||
|
@@ -46,11 +46,11 @@ static void ImplCursorInvert( ImplCursorData* pData )
|
||||
vcl::Window* pWindow = pData->mpWindow;
|
||||
bool bMapMode = pWindow->IsMapModeEnabled();
|
||||
pWindow->EnableMapMode( false );
|
||||
sal_uInt16 nInvertStyle;
|
||||
InvertFlags nInvertStyle;
|
||||
if ( pData->mnStyle & CURSOR_SHADOW )
|
||||
nInvertStyle = INVERT_50;
|
||||
nInvertStyle = InvertFlags::N50;
|
||||
else
|
||||
nInvertStyle = 0;
|
||||
nInvertStyle = InvertFlags::NONE;
|
||||
|
||||
Rectangle aRect( pData->maPixPos, pData->maPixSize );
|
||||
if ( pData->mnDirection != CursorDirection::NONE || pData->mnOrientation || pData->mnPixSlant )
|
||||
|
@@ -127,7 +127,7 @@ void Window::HideFocus()
|
||||
mpWindowImpl->mbInHideFocus = false;
|
||||
}
|
||||
|
||||
void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
|
||||
void Window::Invert( const Rectangle& rRect, InvertFlags nFlags )
|
||||
{
|
||||
if ( !IsDeviceOutputNecessary() )
|
||||
return;
|
||||
@@ -153,14 +153,14 @@ void Window::Invert( const Rectangle& rRect, sal_uInt16 nFlags )
|
||||
return;
|
||||
|
||||
SalInvert nSalFlags = 0;
|
||||
if ( nFlags & INVERT_HIGHLIGHT )
|
||||
if ( nFlags & InvertFlags::Highlight )
|
||||
nSalFlags |= SAL_INVERT_HIGHLIGHT;
|
||||
if ( nFlags & INVERT_50 )
|
||||
if ( nFlags & InvertFlags::N50 )
|
||||
nSalFlags |= SAL_INVERT_50;
|
||||
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() )
|
||||
return;
|
||||
@@ -187,9 +187,9 @@ void Window::Invert( const Polygon& rPoly, sal_uInt16 nFlags )
|
||||
return;
|
||||
|
||||
SalInvert nSalFlags = 0;
|
||||
if ( nFlags & INVERT_HIGHLIGHT )
|
||||
if ( nFlags & InvertFlags::Highlight )
|
||||
nSalFlags |= SAL_INVERT_HIGHLIGHT;
|
||||
if ( nFlags & INVERT_50 )
|
||||
if ( nFlags & InvertFlags::N50 )
|
||||
nSalFlags |= SAL_INVERT_50;
|
||||
const SalPoint* pPtAry = reinterpret_cast<const SalPoint*>(aPoly.GetConstPointAry());
|
||||
mpGraphics->Invert( nPoints, pPtAry, nSalFlags, this );
|
||||
|
Reference in New Issue
Block a user