summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/vcl/window.hxx18
-rw-r--r--vcl/source/window/paint.cxx26
2 files changed, 26 insertions, 18 deletions
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index 7c97bf977aa5..857f649ba15f 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -239,8 +239,16 @@ namespace o3tl
}
// Flags for Validate
-#define VALIDATE_CHILDREN ((sal_uInt16)0x0001)
-#define VALIDATE_NOCHILDREN ((sal_uInt16)0x0002)
+enum class ValidateFlags
+{
+ NONE = 0x0000,
+ Children = 0x0001,
+ NoChildren = 0x0002
+};
+namespace o3tl
+{
+ template<> struct typed_flags<ValidateFlags> : is_typed_flags<ValidateFlags, 0x0003> {};
+}
// Flags for Scroll
#define SCROLL_CLIP ((sal_uInt16)0x0001)
@@ -568,8 +576,8 @@ protected:
SAL_DLLPRIVATE Point ImplOutputToFrame( const Point& rPos );
SAL_DLLPRIVATE void ImplInvalidateParentFrameRegion( vcl::Region& rRegion );
- SAL_DLLPRIVATE void ImplValidateFrameRegion( const vcl::Region* rRegion, sal_uInt16 nFlags );
- SAL_DLLPRIVATE void ImplValidate( const vcl::Region* rRegion, sal_uInt16 nFlags );
+ SAL_DLLPRIVATE void ImplValidateFrameRegion( const vcl::Region* rRegion, ValidateFlags nFlags );
+ SAL_DLLPRIVATE void ImplValidate( const vcl::Region* rRegion, ValidateFlags nFlags );
SAL_DLLPRIVATE void ImplMoveInvalidateRegion( const Rectangle& rRect, long nHorzScroll, long nVertScroll, bool bChildren );
SAL_DLLPRIVATE void ImplMoveAllInvalidateRegions( const Rectangle& rRect, long nHorzScroll, long nVertScroll, bool bChildren );
@@ -1075,7 +1083,7 @@ public:
virtual void Invalidate( InvalidateFlags nFlags = InvalidateFlags::NONE );
virtual void Invalidate( const Rectangle& rRect, InvalidateFlags nFlags = InvalidateFlags::NONE );
virtual void Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags = InvalidateFlags::NONE );
- void Validate( sal_uInt16 nFlags = 0 );
+ void Validate( ValidateFlags nFlags = ValidateFlags::NONE );
bool HasPaintEvent() const;
void Update();
void Flush();
diff --git a/vcl/source/window/paint.cxx b/vcl/source/window/paint.cxx
index f04cf49f14ce..f97c2a632e91 100644
--- a/vcl/source/window/paint.cxx
+++ b/vcl/source/window/paint.cxx
@@ -843,7 +843,7 @@ void Window::ImplMoveAllInvalidateRegions( const Rectangle& rRect,
}
}
-void Window::ImplValidateFrameRegion( const vcl::Region* pRegion, sal_uInt16 nFlags )
+void Window::ImplValidateFrameRegion( const vcl::Region* pRegion, ValidateFlags nFlags )
{
if ( !pRegion )
mpWindowImpl->maInvalidateRegion.SetEmpty();
@@ -874,7 +874,7 @@ void Window::ImplValidateFrameRegion( const vcl::Region* pRegion, sal_uInt16 nFl
}
mpWindowImpl->mnPaintFlags &= ~IMPL_PAINT_PAINTALL;
- if ( nFlags & VALIDATE_CHILDREN )
+ if ( nFlags & ValidateFlags::Children )
{
vcl::Window* pChild = mpWindowImpl->mpFirstChild;
while ( pChild )
@@ -885,19 +885,19 @@ void Window::ImplValidateFrameRegion( const vcl::Region* pRegion, sal_uInt16 nFl
}
}
-void Window::ImplValidate( const vcl::Region* pRegion, sal_uInt16 nFlags )
+void Window::ImplValidate( const vcl::Region* pRegion, ValidateFlags nFlags )
{
// assemble region
bool bValidateAll = !pRegion;
- sal_uInt16 nOrgFlags = nFlags;
- if ( !(nFlags & (VALIDATE_CHILDREN | VALIDATE_NOCHILDREN)) )
+ ValidateFlags nOrgFlags = nFlags;
+ if ( !(nFlags & (ValidateFlags::Children | ValidateFlags::NoChildren)) )
{
if ( GetStyle() & WB_CLIPCHILDREN )
- nFlags |= VALIDATE_NOCHILDREN;
+ nFlags |= ValidateFlags::NoChildren;
else
- nFlags |= VALIDATE_CHILDREN;
+ nFlags |= ValidateFlags::Children;
}
- if ( (nFlags & VALIDATE_NOCHILDREN) && mpWindowImpl->mpFirstChild )
+ if ( (nFlags & ValidateFlags::NoChildren) && mpWindowImpl->mpFirstChild )
bValidateAll = false;
if ( bValidateAll )
ImplValidateFrameRegion( NULL, nFlags );
@@ -908,15 +908,15 @@ void Window::ImplValidate( const vcl::Region* pRegion, sal_uInt16 nFlags )
if ( pRegion )
aRegion.Intersect( *pRegion );
ImplClipBoundaries( aRegion, true, true );
- if ( nFlags & VALIDATE_NOCHILDREN )
+ if ( nFlags & ValidateFlags::NoChildren )
{
- nFlags &= ~VALIDATE_CHILDREN;
- if ( nOrgFlags & VALIDATE_NOCHILDREN )
+ nFlags &= ~ValidateFlags::Children;
+ if ( nOrgFlags & ValidateFlags::NoChildren )
ImplClipAllChildren( aRegion );
else
{
if ( ImplClipChildren( aRegion ) )
- nFlags |= VALIDATE_CHILDREN;
+ nFlags |= ValidateFlags::Children;
}
}
if ( !aRegion.IsEmpty() )
@@ -1180,7 +1180,7 @@ void Window::Invalidate( const vcl::Region& rRegion, InvalidateFlags nFlags )
}
}
-void Window::Validate( sal_uInt16 nFlags )
+void Window::Validate( ValidateFlags nFlags )
{
if ( !IsDeviceOutputNecessary() || !mnOutWidth || !mnOutHeight )