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
#define WINDOW_DLGCTRL_MOD1TAB ((sal_uInt16)0x0004)
#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
enum class EndExtTextInputFlags
{
......@@ -963,7 +959,7 @@ public:
void SetWindowRegionPixel( const vcl::Region& rRegion );
const vcl::Region& GetWindowRegionPixel() const;
bool IsWindowRegionPixel() const;
vcl::Region GetWindowClipRegionPixel( sal_uInt16 nFlags = 0 ) const;
vcl::Region GetWindowClipRegionPixel() const;
vcl::Region GetPaintRegion() const;
bool IsInPaint() const;
// while IsInPaint returns true ExpandPaintClipRegion adds the
......
......@@ -1196,7 +1196,7 @@ bool SwViewShell::SmoothScroll( long lXDiff, long lYDiff, const Rectangle *pRect
// #i75172# isolated static conditions
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);
if(bSmoothScrollAllowed)
......
......@@ -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;
if ( nFlags & WINDOW_GETCLIPREGION_NOCHILDREN )
{
if ( mpWindowImpl->mbInitWinClipRegion )
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 ( mpWindowImpl->mbInitWinClipRegion )
const_cast<vcl::Window*>(this)->ImplInitWinClipRegion();
aWinClipRegion = mpWindowImpl->maWinClipRegion;
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 )
aWinClipRegion.SetNull();
}
if ( aWinRegion == aWinClipRegion )
aWinClipRegion.SetNull();
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