calligra/calligra-3.2.1-Fix-comparison-between-QString-and-0.patch

72 lines
3.2 KiB
Diff

From 622e3ae6cca729e11e83e56a91db87e3a4ecbf6f Mon Sep 17 00:00:00 2001
From: David Faure <faure@kde.org>
Date: Thu, 18 Jun 2020 22:55:10 +0200
Subject: [PATCH 08/54] Fix comparison between QString and 0.
Detected with local hack to qstring.h
---
filters/stage/powerpoint/PptToOdp.cpp | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/filters/stage/powerpoint/PptToOdp.cpp b/filters/stage/powerpoint/PptToOdp.cpp
index f5646f7b089..245b314e7fe 100644
--- a/filters/stage/powerpoint/PptToOdp.cpp
+++ b/filters/stage/powerpoint/PptToOdp.cpp
@@ -3485,7 +3485,7 @@ void PptToOdp::processDeclaration(KoXmlWriter* xmlWriter)
#if 0
QString headerText = QString::fromLatin1(headerAtom->header, headerAtom->header.size());
QString hdrName = findDeclaration(Header, headerText);
- if (hdrName == 0 ) {
+ if (hdrName.isEmpty() ) {
hdrName = QString("hdr%1").arg(declaration.values(Header).count() + 1);
insertDeclaration(Header, hdrName, headerText);
}
@@ -3495,7 +3495,7 @@ void PptToOdp::processDeclaration(KoXmlWriter* xmlWriter)
if (headerFooterAtom && headerFooterAtom->fHasFooter && footerAtom) {
QString footerText = QString::fromUtf16(footerAtom->footer.data(), footerAtom->footer.size());
QString ftrName = findDeclaration(Footer, footerText);
- if ( ftrName == 0) {
+ if ( ftrName.isEmpty() ) {
ftrName = QString("ftr%1").arg((declaration.values(Footer).count() + 1));
insertDeclaration(Footer, ftrName, footerText);
}
@@ -3505,7 +3505,7 @@ void PptToOdp::processDeclaration(KoXmlWriter* xmlWriter)
if(headerFooterAtom->fHasUserDate && userDateAtom) {
QString userDate = QString::fromUtf16(userDateAtom->userDate.data(), userDateAtom->userDate.size());
QString dtdName = findDeclaration(DateTime, userDate);
- if ( dtdName == 0) {
+ if ( dtdName.isEmpty() ) {
dtdName = QString("dtd%1").arg((declaration.values(DateTime).count() + 1));
insertDeclaration(DateTime, dtdName, userDate);
}
@@ -3513,7 +3513,7 @@ void PptToOdp::processDeclaration(KoXmlWriter* xmlWriter)
}
if(headerFooterAtom->fHasTodayDate) {
QString dtdName = findDeclaration(DateTime, "");
- if ( dtdName == 0) {
+ if ( dtdName.isEmpty() ) {
dtdName = QString("dtd%1").arg((declaration.values(DateTime).count() + 1));
insertDeclaration(DateTime, dtdName, "");
}
@@ -3568,7 +3568,7 @@ QString PptToOdp::findDeclaration(DeclarationType type, const QString &text) con
return item.first;
}
}
- return 0;
+ return QString();
}
QString PptToOdp::findNotesDeclaration(DeclarationType type, const QString &text) const
@@ -3581,7 +3581,7 @@ QString PptToOdp::findNotesDeclaration(DeclarationType type, const QString &text
return item.first;
}
}
- return 0;
+ return QString();
}
void PptToOdp::insertDeclaration(DeclarationType type, const QString &name, const QString &text)
--
2.31.1