Call base class version from overridden DestroyClippingRegion()

No real changes, just call wxDCImpl::DestroyClippingRegion() from
the overridden versions in the derived classes instead of calling
ResetClipping(): this makes the code more clear as it follows the usual
pattern of the derived class doing something first and then forwarding
to the base class.

Also, as ResetClipping() is not really useful, add a comment documenting
that it shouldn't be used in the new code.
This commit is contained in:
Vadim Zeitlin 2018-06-18 22:52:23 +02:00
parent 110ace680b
commit 43ce00b5bd
4 changed files with 7 additions and 4 deletions

View File

@ -666,7 +666,10 @@ private:
wxDC *m_owner;
protected:
// unset clipping variables (after clipping region was destroyed)
// This method exists for backwards compatibility only (while it's not
// documented, there are derived classes using it outside wxWidgets
// itself), don't use it in any new code and just call wxDCImpl version of
// DestroyClippingRegion() to reset the clipping information instead.
void ResetClipping()
{
m_clipping = false;

View File

@ -376,7 +376,7 @@ void wxGCDCImpl::DestroyClippingRegion()
m_graphicContext->SetPen( m_pen );
m_graphicContext->SetBrush( m_brush );
ResetClipping();
wxDCImpl::DestroyClippingRegion();
m_isClipBoxValid = false;
}

View File

@ -115,7 +115,7 @@ void wxDFBDCImpl::DestroyClippingRegion()
m_surface->SetClip(NULL);
ResetClipping();
wxDCImpl::DestroyClippingRegion();
}
// ---------------------------------------------------------------------------

View File

@ -454,7 +454,7 @@ void wxQtDCImpl::DoSetDeviceClippingRegion(const wxRegion& region)
void wxQtDCImpl::DestroyClippingRegion()
{
ResetClipping();
wxDCImpl::DestroyClippingRegion();
m_clippingRegion->Clear();
if (m_qtPainter->isActive())