Skip to content

Commit

Permalink
Fix warnings: zero as null pointer constant
Browse files Browse the repository at this point in the history
Fix more warnings: zero as null pointer constant
  • Loading branch information
gerlachs authored and dantti committed Sep 21, 2023
1 parent 8c9e89d commit 4678450
Show file tree
Hide file tree
Showing 22 changed files with 103 additions and 47 deletions.
2 changes: 1 addition & 1 deletion QXlsx/header/xlsxchart.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class QXLSX_EXPORT Chart : public AbstractOOXmlFile

public:
void addSeries(const CellRange &range,
AbstractSheet *sheet = NULL,
AbstractSheet *sheet = nullptr,
bool headerH = false,
bool headerV = false,
bool swapHeaders = false);
Expand Down
2 changes: 1 addition & 1 deletion QXlsx/header/xlsxconditionalformatting.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ class QXLSX_EXPORT ConditionalFormatting

private:
bool saveToXml(QXmlStreamWriter &writer) const;
bool loadFromXml(QXmlStreamReader &reader, Styles *styles = NULL);
bool loadFromXml(QXmlStreamReader &reader, Styles *styles = nullptr);

QSharedDataPointer<ConditionalFormattingPrivate> d;
};
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/source/xlsxabstractsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ AbstractSheetPrivate::AbstractSheetPrivate(AbstractSheet *p, AbstractSheet::Crea
sheetState = AbstractSheet::SS_Visible;
}

AbstractSheetPrivate::~AbstractSheetPrivate() {}
AbstractSheetPrivate::~AbstractSheetPrivate()
{
}

/*!
\class AbstractSheet
Expand Down
2 changes: 1 addition & 1 deletion QXlsx/source/xlsxcell.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ Cell::Cell(const Cell *const cell)
*/
Cell::~Cell()
{
if (NULL != d_ptr)
if (nullptr != d_ptr)
delete d_ptr;
}

Expand Down
8 changes: 6 additions & 2 deletions QXlsx/source/xlsxcellformula.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ CellFormulaPrivate::CellFormulaPrivate(const CellFormulaPrivate &other)
{
}

CellFormulaPrivate::~CellFormulaPrivate() {}
CellFormulaPrivate::~CellFormulaPrivate()
{
}

/*!
\class CellFormula
Expand Down Expand Up @@ -110,7 +112,9 @@ CellFormula &CellFormula::operator=(const CellFormula &other)
/*!
* Destroys this formula.
*/
CellFormula::~CellFormula() {}
CellFormula::~CellFormula()
{
}

/*!
* Returns the type of the formula.
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/source/xlsxcellrange.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,9 @@ CellRange::CellRange(const CellRange &other)
/*!
Destroys the range.
*/
CellRange::~CellRange() {}
CellRange::~CellRange()
{
}

/*!
Convert the range to string notation, such as "A1:B5".
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/source/xlsxcellreference.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,9 @@ CellReference::CellReference(const CellReference &other)
/*!
Destroys the Reference.
*/
CellReference::~CellReference() {}
CellReference::~CellReference()
{
}

/*!
Convert the Reference to string notation, such as "A1" or "$A$1".
Expand Down
12 changes: 8 additions & 4 deletions QXlsx/source/xlsxchart.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ ChartPrivate::ChartPrivate(Chart *q, Chart::CreateFlag flag)
{
}

ChartPrivate::~ChartPrivate() {}
ChartPrivate::~ChartPrivate()
{
}

/*!
* \internal
Expand All @@ -42,7 +44,9 @@ Chart::Chart(AbstractSheet *parent, CreateFlag flag)
/*!
* Destroys the chart.
*/
Chart::~Chart() {}
Chart::~Chart()
{
}

/*!
* Add the data series which is in the range \a range of the \a sheet.
Expand Down Expand Up @@ -1320,7 +1324,7 @@ bool ChartPrivate::loadXmlAxisValAx(QXmlStreamReader &reader)
*/
bool ChartPrivate::loadXmlAxisEG_AxShared(QXmlStreamReader &reader, XlsxAxis *axis)
{
Q_ASSERT(NULL != axis);
Q_ASSERT(nullptr != axis);
Q_ASSERT(reader.name().endsWith(QLatin1String("Ax")));
QString name = reader.name().toString(); //

Expand Down Expand Up @@ -1999,7 +2003,7 @@ QString ChartPrivate::GetAxisPosString(XlsxAxis::AxisPos axisPos) const
QString ChartPrivate::GetAxisName(XlsxAxis *axis) const
{
QString strAxisName;
if (NULL == axis)
if (nullptr == axis)
return strAxisName;

QString pos = GetAxisPosString(axis->axisPos); // l, t, r, b
Expand Down
12 changes: 8 additions & 4 deletions QXlsx/source/xlsxchartsheet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ QT_BEGIN_NAMESPACE_XLSX

ChartsheetPrivate::ChartsheetPrivate(Chartsheet *p, Chartsheet::CreateFlag flag)
: AbstractSheetPrivate(p, flag)
, chart(0)
, chart(nullptr)
{
}

ChartsheetPrivate::~ChartsheetPrivate() {}
ChartsheetPrivate::~ChartsheetPrivate()
{
}

/*!
\class Chartsheet
Expand Down Expand Up @@ -66,13 +68,15 @@ Chartsheet *Chartsheet::copy(const QString &distName, int distId) const
//: Todo
Q_UNUSED(distName)
Q_UNUSED(distId)
return 0;
return nullptr;
}

/*!
* Destroys this workssheet.
*/
Chartsheet::~Chartsheet() {}
Chartsheet::~Chartsheet()
{
}

/*!
* Returns the chart object of the sheet.
Expand Down
12 changes: 9 additions & 3 deletions QXlsx/source/xlsxconditionalformatting.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,19 @@

QT_BEGIN_NAMESPACE_XLSX

ConditionalFormattingPrivate::ConditionalFormattingPrivate() {}
ConditionalFormattingPrivate::ConditionalFormattingPrivate()
{
}

ConditionalFormattingPrivate::ConditionalFormattingPrivate(
const ConditionalFormattingPrivate &other)
: QSharedData(other)
{
}

ConditionalFormattingPrivate::~ConditionalFormattingPrivate() {}
ConditionalFormattingPrivate::~ConditionalFormattingPrivate()
{
}

void ConditionalFormattingPrivate::writeCfVo(QXmlStreamWriter &writer,
const XlsxCfVoData &cfvo) const
Expand Down Expand Up @@ -151,7 +155,9 @@ ConditionalFormatting &ConditionalFormatting::operator=(const ConditionalFormatt
/*!
* Destroy the object.
*/
ConditionalFormatting::~ConditionalFormatting() {}
ConditionalFormatting::~ConditionalFormatting()
{
}

/*!
* Add a hightlight rule with the given \a type, \a formula1, \a formula2,
Expand Down
8 changes: 6 additions & 2 deletions QXlsx/source/xlsxdatavalidation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ DataValidationPrivate::DataValidationPrivate(const DataValidationPrivate &other)
{
}

DataValidationPrivate::~DataValidationPrivate() {}
DataValidationPrivate::~DataValidationPrivate()
{
}

/*!
* \class DataValidation
Expand Down Expand Up @@ -143,7 +145,9 @@ DataValidation &DataValidation::operator=(const DataValidation &other)
/*!
* Destroy the object.
*/
DataValidation::~DataValidation() {}
DataValidation::~DataValidation()
{
}

/*!
Returns the validation type.
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/source/xlsxdatetype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@

QT_BEGIN_NAMESPACE_XLSX

DateType::DateType() {}
DateType::DateType()
{
}

/*
DateType::DateType(bool is1904)
Expand Down
8 changes: 4 additions & 4 deletions QXlsx/source/xlsxdocument.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ Chart *Document::insertChart(int row, int col, const QSize &size)
{
if (Worksheet *sheet = currentWorksheet())
return sheet->insertChart(row, col, size);
return 0;
return nullptr;
}

/*!
Expand Down Expand Up @@ -1012,7 +1012,7 @@ Cell *Document::cellAt(const CellReference &pos) const
{
if (Worksheet *sheet = currentWorksheet())
return sheet->cellAt(pos);
return 0;
return nullptr;
}

/*!
Expand All @@ -1025,7 +1025,7 @@ Cell *Document::cellAt(int row, int col) const
{
if (Worksheet *sheet = currentWorksheet())
return sheet->cellAt(row, col);
return 0;
return nullptr;
}

/*!
Expand Down Expand Up @@ -1209,7 +1209,7 @@ Worksheet *Document::currentWorksheet() const
if (st && st->sheetType() == AbstractSheet::ST_WorkSheet)
return static_cast<Worksheet *>(st);
else
return 0;
return nullptr;
}

/*!
Expand Down
12 changes: 8 additions & 4 deletions QXlsx/source/xlsxdrawinganchor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,9 @@ DrawingAnchor::DrawingAnchor(Drawing *drawing, ObjectType objectType)
m_id = m_drawing->anchors.size(); // must be unique in one drawing{x}.xml file.
}

DrawingAnchor::~DrawingAnchor() {}
DrawingAnchor::~DrawingAnchor()
{
}

void DrawingAnchor::setObjectPicture(const QImage &img)
{
Expand Down Expand Up @@ -898,9 +900,11 @@ void DrawingAnchor::saveXmlObjectShape(QXmlStreamWriter &writer) const
writer.writeStartElement(QStringLiteral("a:blip"));
writer.writeAttribute(
QStringLiteral("r:embed"),
QStringLiteral("rId%1").arg(m_drawing->relationships()->count())); // sp_blip_rembed
// QStringLiteral("rId%1").arg(m_drawing->relationships()->count())
// can't made new pic
QStringLiteral("rId%1").arg(
m_drawing->relationships()
->count())); // sp_blip_rembed
// QStringLiteral("rId%1").arg(m_drawing->relationships()->count())
// can't made new pic
writer.writeAttribute(
QStringLiteral("xmlns:r"),
QStringLiteral("http://schemas.openxmlformats.org/officeDocument/2006/relationships"));
Expand Down
8 changes: 6 additions & 2 deletions QXlsx/source/xlsxformat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ FormatPrivate::FormatPrivate(const FormatPrivate &other)
{
}

FormatPrivate::~FormatPrivate() {}
FormatPrivate::~FormatPrivate()
{
}

/*!
* \class Format
Expand Down Expand Up @@ -202,7 +204,9 @@ Format &Format::operator=(const Format &other)
/*!
* Destroys this format.
*/
Format::~Format() {}
Format::~Format()
{
}

/*!
* Returns the number format identifier.
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/source/xlsxrelationships.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ const QLatin1String schema_msPackage("http://schemas.microsoft.com/office/2006/r
const QLatin1String schema_package("http://schemas.openxmlformats.org/package/2006/relationships");
// const QString schema_worksheet =
// QStringLiteral("http://schemas.openxmlformats.org/officeDocument/2006/relationships");
Relationships::Relationships() {}
Relationships::Relationships()
{
}

QList<XlsxRelationship> Relationships::documentRelationships(const QString &relativeType) const
{
Expand Down
8 changes: 6 additions & 2 deletions QXlsx/source/xlsxrichstring.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,9 @@ RichStringPrivate::RichStringPrivate(const RichStringPrivate &other)
{
}

RichStringPrivate::~RichStringPrivate() {}
RichStringPrivate::~RichStringPrivate()
{
}

/*!
\class RichString
Expand Down Expand Up @@ -62,7 +64,9 @@ RichString::RichString(const RichString &other)
/*!
Destructs the string.
*/
RichString::~RichString() {}
RichString::~RichString()
{
}

/*!
Assigns \a other to this string and returns a reference to this string
Expand Down
4 changes: 3 additions & 1 deletion QXlsx/source/xlsxstyles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,9 @@ Styles::Styles(CreateFlag flag)
}
}

Styles::~Styles() {}
Styles::~Styles()
{
}

Format Styles::xfFormat(int idx) const
{
Expand Down
Loading

0 comments on commit 4678450

Please sign in to comment.