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

simplify GetWindowClipRegionPixel

since it has only one call-site

Change-Id: I80344faf4beab9aa9427ba8d448b0cf3fd30c7b6
üst 5ad3886e
...@@ -354,10 +354,6 @@ enum class StateChangedType : sal_uInt16 ...@@ -354,10 +354,6 @@ enum class StateChangedType : sal_uInt16
#define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004) #define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004)
#define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008) #define WINDOW_DLGCTRL_FLOATWIN_POPUPMODEEND_CANCEL ((sal_uInt16)0x0008)
// GetWindowClipRegionPixel-Flags
#define WINDOW_GETCLIPREGION_NULL ((sal_uInt16)0x0001)
#define WINDOW_GETCLIPREGION_NOCHILDREN ((sal_uInt16)0x0002)
// EndExtTextInput() Flags // EndExtTextInput() Flags
enum class EndExtTextInputFlags enum class EndExtTextInputFlags
{ {
...@@ -963,7 +959,7 @@ public: ...@@ -963,7 +959,7 @@ public:
void SetWindowRegionPixel( const vcl::Region& rRegion ); void SetWindowRegionPixel( const vcl::Region& rRegion );
const vcl::Region& GetWindowRegionPixel() const; const vcl::Region& GetWindowRegionPixel() const;
bool IsWindowRegionPixel() const; bool IsWindowRegionPixel() const;
vcl::Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const; vcl::Region GetWindowClipRegionPixel() const;
vcl::Region GetPaintRegion() const; vcl::Region GetPaintRegion() const;
bool IsInPaint() const; bool IsInPaint() const;
// while IsInPaint returns true ExpandPaintClipRegion adds the // while IsInPaint returns true ExpandPaintClipRegion adds the
......
...@@ -1196,7 +1196,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect ...@@ -1196,7 +1196,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect
// #i75172# isolated static conditions // #i75172# isolated static conditions
const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax); const bool bOnlyYScroll(!lXDiff && std::abs(lYDiff) != 0 && std::abs(lYDiff) < lMax);
const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel(WINDOW_GETCLIPREGION_NOCHILDREN|WINDOW_GETCLIPREGION_NULL).IsNull()); const bool bAllowedWithChildWindows(GetWin()->GetWindowClipRegionPixel().IsNull());
const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows); const bool bSmoothScrollAllowed(bOnlyYScroll && mbEnableSmooth && GetViewOptions()->IsSmoothScroll() && bAllowedWithChildWindows);
if(bSmoothScrollAllowed) if(bSmoothScrollAllowed)
......
...@@ -112,37 +112,19 @@ void Window::ExpandPaintClipRegion( const vcl::Region& rRegion ) ...@@ -112,37 +112,19 @@ void Window::ExpandPaintClipRegion( const vcl::Region& rRegion )
} }
} }
vcl::Region Window::GetWindowClipRegionPixel( sal_uInt16 nFlags ) const vcl::Region Window::GetWindowClipRegionPixel() const
{ {
vcl::Region aWinClipRegion; vcl::Region aWinClipRegion;
if ( nFlags & WINDOW_GETCLIPREGION_NOCHILDREN ) if ( mpWindowImpl->mbInitWinClipRegion )
{ const_cast<vcl::Window*>(this)->ImplInitWinClipRegion();
if ( mpWindowImpl->mbInitWinClipRegion ) aWinClipRegion = mpWindowImpl->maWinClipRegion;
const_cast<vcl::Window*>(this)->ImplInitWinClipRegion();
aWinClipRegion = mpWindowImpl->maWinClipRegion;
}
else
{
vcl::Region* pWinChildClipRegion = const_cast<vcl::Window*>(this)->ImplGetWinChildClipRegion();
aWinClipRegion = *pWinChildClipRegion;
// --- RTL --- remirror clip region before passing it to somebody
if( ImplIsAntiparallel() )
{
const OutputDevice *pOutDev = GetOutDev();
pOutDev->ReMirror( aWinClipRegion );
}
}
if ( nFlags & WINDOW_GETCLIPREGION_NULL ) Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
{ vcl::Region aWinRegion( aWinRect );
Rectangle aWinRect( Point( mnOutOffX, mnOutOffY ), Size( mnOutWidth, mnOutHeight ) );
vcl::Region aWinRegion( aWinRect );
if ( aWinRegion == aWinClipRegion ) if ( aWinRegion == aWinClipRegion )
aWinClipRegion.SetNull(); aWinClipRegion.SetNull();
}
aWinClipRegion.Move( -mnOutOffX, -mnOutOffY ); aWinClipRegion.Move( -mnOutOffX, -mnOutOffY );
......
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