Skip to content

Commit fbf2c37

Browse files
gerlachsdantti
authored andcommitted
Fix warnings: zero as null pointer constant
Fix more warnings: zero as null pointer constant
1 parent 8c9e89d commit fbf2c37

22 files changed

+103
-47
lines changed

QXlsx/header/xlsxchart.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ class QXLSX_EXPORT Chart : public AbstractOOXmlFile
5656

5757
public:
5858
void addSeries(const CellRange &range,
59-
AbstractSheet *sheet = NULL,
59+
AbstractSheet *sheet = nullptr,
6060
bool headerH = false,
6161
bool headerV = false,
6262
bool swapHeaders = false);

QXlsx/header/xlsxconditionalformatting.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ class QXLSX_EXPORT ConditionalFormatting
121121

122122
private:
123123
bool saveToXml(QXmlStreamWriter &writer) const;
124-
bool loadFromXml(QXmlStreamReader &reader, Styles *styles = NULL);
124+
bool loadFromXml(QXmlStreamReader &reader, Styles *styles = nullptr);
125125

126126
QSharedDataPointer<ConditionalFormattingPrivate> d;
127127
};

QXlsx/source/xlsxabstractsheet.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,9 @@ AbstractSheetPrivate::AbstractSheetPrivate(AbstractSheet *p, AbstractSheet::Crea
1616
sheetState = AbstractSheet::SS_Visible;
1717
}
1818

19-
AbstractSheetPrivate::~AbstractSheetPrivate() {}
19+
AbstractSheetPrivate::~AbstractSheetPrivate()
20+
{
21+
}
2022

2123
/*!
2224
\class AbstractSheet

QXlsx/source/xlsxcell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Cell::Cell(const Cell *const cell)
8585
*/
8686
Cell::~Cell()
8787
{
88-
if (NULL != d_ptr)
88+
if (nullptr != d_ptr)
8989
delete d_ptr;
9090
}
9191

QXlsx/source/xlsxcellformula.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,9 @@ CellFormulaPrivate::CellFormulaPrivate(const CellFormulaPrivate &other)
4040
{
4141
}
4242

43-
CellFormulaPrivate::~CellFormulaPrivate() {}
43+
CellFormulaPrivate::~CellFormulaPrivate()
44+
{
45+
}
4446

4547
/*!
4648
\class CellFormula
@@ -110,7 +112,9 @@ CellFormula &CellFormula::operator=(const CellFormula &other)
110112
/*!
111113
* Destroys this formula.
112114
*/
113-
CellFormula::~CellFormula() {}
115+
CellFormula::~CellFormula()
116+
{
117+
}
114118

115119
/*!
116120
* Returns the type of the formula.

QXlsx/source/xlsxcellrange.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,9 @@ CellRange::CellRange(const CellRange &other)
106106
/*!
107107
Destroys the range.
108108
*/
109-
CellRange::~CellRange() {}
109+
CellRange::~CellRange()
110+
{
111+
}
110112

111113
/*!
112114
Convert the range to string notation, such as "A1:B5".

QXlsx/source/xlsxcellreference.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ CellReference::CellReference(const CellReference &other)
127127
/*!
128128
Destroys the Reference.
129129
*/
130-
CellReference::~CellReference() {}
130+
CellReference::~CellReference()
131+
{
132+
}
131133

132134
/*!
133135
Convert the Reference to string notation, such as "A1" or "$A$1".

QXlsx/source/xlsxchart.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,9 @@ ChartPrivate::ChartPrivate(Chart *q, Chart::CreateFlag flag)
2020
{
2121
}
2222

23-
ChartPrivate::~ChartPrivate() {}
23+
ChartPrivate::~ChartPrivate()
24+
{
25+
}
2426

2527
/*!
2628
* \internal
@@ -42,7 +44,9 @@ Chart::Chart(AbstractSheet *parent, CreateFlag flag)
4244
/*!
4345
* Destroys the chart.
4446
*/
45-
Chart::~Chart() {}
47+
Chart::~Chart()
48+
{
49+
}
4650

4751
/*!
4852
* Add the data series which is in the range \a range of the \a sheet.
@@ -1320,7 +1324,7 @@ bool ChartPrivate::loadXmlAxisValAx(QXmlStreamReader &reader)
13201324
*/
13211325
bool ChartPrivate::loadXmlAxisEG_AxShared(QXmlStreamReader &reader, XlsxAxis *axis)
13221326
{
1323-
Q_ASSERT(NULL != axis);
1327+
Q_ASSERT(nullptr != axis);
13241328
Q_ASSERT(reader.name().endsWith(QLatin1String("Ax")));
13251329
QString name = reader.name().toString(); //
13261330

@@ -1999,7 +2003,7 @@ QString ChartPrivate::GetAxisPosString(XlsxAxis::AxisPos axisPos) const
19992003
QString ChartPrivate::GetAxisName(XlsxAxis *axis) const
20002004
{
20012005
QString strAxisName;
2002-
if (NULL == axis)
2006+
if (nullptr == axis)
20032007
return strAxisName;
20042008

20052009
QString pos = GetAxisPosString(axis->axisPos); // l, t, r, b

QXlsx/source/xlsxchartsheet.cpp

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,13 @@ QT_BEGIN_NAMESPACE_XLSX
1818

1919
ChartsheetPrivate::ChartsheetPrivate(Chartsheet *p, Chartsheet::CreateFlag flag)
2020
: AbstractSheetPrivate(p, flag)
21-
, chart(0)
21+
, chart(nullptr)
2222
{
2323
}
2424

25-
ChartsheetPrivate::~ChartsheetPrivate() {}
25+
ChartsheetPrivate::~ChartsheetPrivate()
26+
{
27+
}
2628

2729
/*!
2830
\class Chartsheet
@@ -66,13 +68,15 @@ Chartsheet *Chartsheet::copy(const QString &distName, int distId) const
6668
//: Todo
6769
Q_UNUSED(distName)
6870
Q_UNUSED(distId)
69-
return 0;
71+
return nullptr;
7072
}
7173

7274
/*!
7375
* Destroys this workssheet.
7476
*/
75-
Chartsheet::~Chartsheet() {}
77+
Chartsheet::~Chartsheet()
78+
{
79+
}
7680

7781
/*!
7882
* Returns the chart object of the sheet.

QXlsx/source/xlsxconditionalformatting.cpp

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,19 @@
1414

1515
QT_BEGIN_NAMESPACE_XLSX
1616

17-
ConditionalFormattingPrivate::ConditionalFormattingPrivate() {}
17+
ConditionalFormattingPrivate::ConditionalFormattingPrivate()
18+
{
19+
}
1820

1921
ConditionalFormattingPrivate::ConditionalFormattingPrivate(
2022
const ConditionalFormattingPrivate &other)
2123
: QSharedData(other)
2224
{
2325
}
2426

25-
ConditionalFormattingPrivate::~ConditionalFormattingPrivate() {}
27+
ConditionalFormattingPrivate::~ConditionalFormattingPrivate()
28+
{
29+
}
2630

2731
void ConditionalFormattingPrivate::writeCfVo(QXmlStreamWriter &writer,
2832
const XlsxCfVoData &cfvo) const
@@ -151,7 +155,9 @@ ConditionalFormatting &ConditionalFormatting::operator=(const ConditionalFormatt
151155
/*!
152156
* Destroy the object.
153157
*/
154-
ConditionalFormatting::~ConditionalFormatting() {}
158+
ConditionalFormatting::~ConditionalFormatting()
159+
{
160+
}
155161

156162
/*!
157163
* Add a hightlight rule with the given \a type, \a formula1, \a formula2,

0 commit comments

Comments
 (0)