From 1c249a6934293d4450221a05928795bf3cd6d31a Mon Sep 17 00:00:00 2001 From: Sean D'Epagnier Date: Wed, 28 Sep 2016 17:15:09 -0400 Subject: [PATCH] additional code style improvements from github comments --- include/wx/qt/colour.h | 4 ++-- src/qt/colour.cpp | 6 +++--- src/qt/dc.cpp | 4 +++- src/qt/filedlg.cpp | 4 ++-- 4 files changed, 10 insertions(+), 8 deletions(-) diff --git a/include/wx/qt/colour.h b/include/wx/qt/colour.h index 9652fa8d8f..52018c500d 100644 --- a/include/wx/qt/colour.h +++ b/include/wx/qt/colour.h @@ -18,7 +18,7 @@ public: DEFINE_STD_WXCOLOUR_CONSTRUCTORS wxColour(const QColor& color); - virtual bool IsOk() const { return valid; } + virtual bool IsOk() const { return m_valid; } ChannelType Red() const { return m_red; } ChannelType Green() const { return m_green; } @@ -38,7 +38,7 @@ protected: private: ChannelType m_red, m_green, m_blue, m_alpha; - bool valid; + bool m_valid; wxDECLARE_DYNAMIC_CLASS(wxColour); }; diff --git a/src/qt/colour.cpp b/src/qt/colour.cpp index c1e1f6c57e..4192179d7b 100644 --- a/src/qt/colour.cpp +++ b/src/qt/colour.cpp @@ -46,7 +46,7 @@ int wxColour::GetPixel() const QColor wxColour::GetQColor() const { - if ( valid ) + if ( m_valid ) return QColor(m_red, m_green, m_blue, m_alpha); return QColor(); } @@ -54,11 +54,11 @@ QColor wxColour::GetQColor() const void wxColour::Init() { m_red = m_green = m_blue = m_alpha = 0; - valid = false; + m_valid = false; } void wxColour::InitRGBA(ChannelType r, ChannelType g, ChannelType b, ChannelType a) { m_red = r, m_green = g, m_blue = b, m_alpha = a; - valid = true; + m_valid = true; } diff --git a/src/qt/dc.cpp b/src/qt/dc.cpp index 8c45c841af..98c21fa739 100644 --- a/src/qt/dc.cpp +++ b/src/qt/dc.cpp @@ -651,7 +651,9 @@ void wxQtDCImpl::DoDrawBitmap(const wxBitmap &bmp, wxCoord x, wxCoord y, //Restore saved settings m_qtPainter->setBackground(savedBrush); m_qtPainter->setPen(savedPen); - } else { + } + else + { if ( useMask && bmp.GetMask() && bmp.GetMask()->GetHandle() ) pix.setMask(*bmp.GetMask()->GetHandle()); m_qtPainter->drawPixmap(x, y, pix); diff --git a/src/qt/filedlg.cpp b/src/qt/filedlg.cpp index 91ebf1777a..da26127ef0 100644 --- a/src/qt/filedlg.cpp +++ b/src/qt/filedlg.cpp @@ -105,7 +105,7 @@ wxString wxFileDialog::GetPath() const { wxArrayString paths; GetPaths(paths); - if (paths.size() == 0) + if (paths.empty()) return ""; return paths[0]; @@ -122,7 +122,7 @@ wxString wxFileDialog::GetFilename() const { wxArrayString filenames; GetFilenames(filenames); - if ( filenames.size() == 0 ) + if ( filenames.empty() ) return ""; return filenames[0];