From 2d83f8684157bfeb35f6dbb17ed2d5c14bd23697 Mon Sep 17 00:00:00 2001 From: Mariano Reingart Date: Mon, 29 Sep 2014 03:04:52 +0000 Subject: [PATCH] Allow NULL width and/or height pointer parameters in wxQT, thanks @seandepagnier git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@77915 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/qt/dc.cpp | 8 ++++---- src/qt/window.cpp | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 89f6c72811..a60a255ba1 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -82,14 +82,14 @@ bool wxQtDCImpl::CanGetTextExtent() const void wxQtDCImpl::DoGetSize(int *width, int *height) const { - *width = m_qtPainter->device()->width(); - *height = m_qtPainter->device()->height(); + if (width) *width = m_qtPainter->device()->width(); + if (height) *height = m_qtPainter->device()->height(); } void wxQtDCImpl::DoGetSizeMM(int* width, int* height) const { - *width = m_qtPainter->device()->widthMM(); - *height = m_qtPainter->device()->heightMM(); + if (width) *width = m_qtPainter->device()->widthMM(); + if (height) *height = m_qtPainter->device()->heightMM(); } int wxQtDCImpl::GetDepth() const diff --git a/src/qt/window.cpp b/src/qt/window.cpp index cc03c85c51..76c3ec29be 100644 --- a/src/qt/window.cpp +++ b/src/qt/window.cpp @@ -782,8 +782,8 @@ void wxWindowQt::DoGetSize(int *width, int *height) const wxASSERT( size.width() == rect.width() ); wxASSERT( size.height() == rect.height() ); - *width = rect.width(); - *height = rect.height(); + if (width) *width = rect.width(); + if (height) *height = rect.height(); } @@ -815,8 +815,8 @@ void wxWindowQt::DoSetSize(int x, int y, int width, int height, int sizeFlags ) void wxWindowQt::DoGetClientSize(int *width, int *height) const { QRect geometry = GetHandle()->geometry(); - *width = geometry.width(); - *height = geometry.height(); + if (width) *width = geometry.width(); + if (height) *height = geometry.height(); }