CppCheck : Several fixes

Add missing initializers
Guard potential null pointer access
This commit is contained in:
Magne Sjaastad
2018-08-02 19:22:03 +02:00
parent 39c4319fa4
commit fe07b60392
21 changed files with 184 additions and 148 deletions

View File

@@ -51,6 +51,8 @@ RimDerivedEnsembleCase::RimDerivedEnsembleCase() : m_summaryCase1(nullptr), m_su
CAF_PDM_InitObject("Summary Case",":/SummaryCase16x16.png","","");
CAF_PDM_InitFieldNoDefault(&m_summaryCase1, "SummaryCase1", "SummaryCase1", "", "", "");
CAF_PDM_InitFieldNoDefault(&m_summaryCase2, "SummaryCase2", "SummaryCase2", "", "", "");
m_inUse = false;
}
//--------------------------------------------------------------------------------------------------

View File

@@ -71,7 +71,5 @@ private:
caf::PdmField<bool> m_showCurveLabels;
caf::PdmField<cvf::Color3f> m_color;
RimSummaryCaseCollection* m_ensemble;
};

View File

@@ -148,17 +148,14 @@ QString RimSummaryCurveAutoName::curveNameX(const RifEclipseSummaryAddress& summ
if (summaryCurve && summaryCurve->summaryCaseX())
{
QString caseName = summaryCurve->summaryCaseX()->caseName();
bool skipSubString = nameHelper && nameHelper->isCaseInTitle();
if (m_caseName && !skipSubString)
{
if (summaryCurve && summaryCurve->summaryCaseX())
{
if (!text.empty()) text += ", ";
text += caseName.toStdString();
}
QString caseName = summaryCurve->summaryCaseX()->caseName();
if (!text.empty()) text += ", ";
text += caseName.toStdString();
}
}