fix various flaws detected by PVS

This commit is contained in:
wmayer
2019-03-01 22:52:41 +01:00
parent 9032c4c587
commit 337c9c936f
5 changed files with 9 additions and 10 deletions

View File

@@ -50,7 +50,7 @@ int QuantityFormat::defaultDenominator = 8; // for 1/8"
QuantityFormat::QuantityFormat()
: option(static_cast<NumberOption>(OmitGroupSeparator | RejectGroupSeparator))
: option(OmitGroupSeparator | RejectGroupSeparator)
, format(Fixed)
, precision(UnitsApi::getDecimals())
, denominator(defaultDenominator)

View File

@@ -48,7 +48,8 @@ struct BaseExport QuantityFormat {
Scientific = 2
};
NumberOption option;
typedef int NumberOptions;
NumberOptions option;
NumberFormat format;
int precision;
int denominator;

View File

@@ -492,8 +492,7 @@ QPixmap BitmapFactoryInst::resize(int w, int h, const QPixmap& p, Qt::BGMode bgm
QColor dl = pal.color(QPalette::Disabled, QPalette::Light);
QColor dt = pal.color(QPalette::Disabled, QPalette::Text);
QPixmap pm = pix;
pm = QPixmap(w,h);
QPixmap pm(w,h);
pm.fill(dl);
QPainter pt;
@@ -575,15 +574,15 @@ QPixmap BitmapFactoryInst::merge(const QPixmap& p1, const QPixmap& p2, Position
switch (pos)
{
case Qt::TopLeftCorner:
case TopLeft:
break;
case Qt::TopRightCorner:
case TopRight:
x = p1.width () - p2.width ();
break;
case Qt::BottomLeftCorner:
case BottomLeft:
y = p1.height() - p2.height();
break;
case Qt::BottomRightCorner:
case BottomRight:
x = p1.width () - p2.width ();
y = p1.height() - p2.height();
break;

View File

@@ -210,7 +210,6 @@ private:
void updateText(const Base::Quantity&);
private:
QLabel* iconLabel;
QByteArray m_sPrefGrp;
bool validInput;

View File

@@ -1072,7 +1072,7 @@ bool SoFCCSysDragger::isShownTranslationY()
bool SoFCCSysDragger::isShownTranslationZ()
{
SoSwitch *sw = SO_GET_ANY_PART(this, "yTranslatorSwitch", SoSwitch);
SoSwitch *sw = SO_GET_ANY_PART(this, "zTranslatorSwitch", SoSwitch);
return (sw->whichChild.getValue() == SO_SWITCH_ALL);
}