X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/16eac072eb0d3af2ce40cc507946ae83fd6f16c9..a3a8d81d487ae4f03d8b70bce20bddbfc48c5776:/src/ribbon/page.cpp diff --git a/src/ribbon/page.cpp b/src/ribbon/page.cpp index 5e7562f4a0..3448462420 100644 --- a/src/ribbon/page.cpp +++ b/src/ribbon/page.cpp @@ -14,10 +14,9 @@ #pragma hdrstop #endif -#include "wx/ribbon/page.h" - #if wxUSE_RIBBON +#include "wx/ribbon/page.h" #include "wx/ribbon/art.h" #include "wx/ribbon/bar.h" #include "wx/dcbuffer.h" @@ -374,6 +373,8 @@ void wxRibbonPage::SetSizeWithScrollButtonAdjustment(int x, int y, int width, in } } } + if (width < 0) width = 0; + if (height < 0) height = 0; SetSize(x, y, width, height); } @@ -414,9 +415,12 @@ void wxRibbonPage::OnSize(wxSizeEvent& evt) { wxSize new_size = evt.GetSize(); - wxMemoryDC temp_dc; - wxRect invalid_rect = m_art->GetPageBackgroundRedrawArea(temp_dc, this, m_old_size, new_size); - Refresh(true, &invalid_rect); + if (m_art) + { + wxMemoryDC temp_dc; + wxRect invalid_rect = m_art->GetPageBackgroundRedrawArea(temp_dc, this, m_old_size, new_size); + Refresh(true, &invalid_rect); + } m_old_size = new_size;