additional code style improvements from github comments

This commit is contained in:
Sean D'Epagnier
2016-09-28 17:15:09 -04:00
committed by Vadim Zeitlin
parent 7338f32dfd
commit 1c249a6934
4 changed files with 10 additions and 8 deletions

View File

@@ -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);
};

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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];