r22608 by craig - clazy and clang fixes, part 8
scribus-commit
scribus-commit at lists.scribus.net
Sun Aug 5 11:20:27 UTC 2018
Author: craig
Date: Sun Aug 5 11:20:27 2018
New Revision: 22608
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22608
Log:
clazy and clang fixes, part 8
Modified:
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12formatimpl.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134formatimpl.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13formatimpl.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150formatimpl.cpp
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp Sun Aug 5 11:20:27 2018
@@ -40,8 +40,7 @@
// Please don't implement the functionality of your plugin here; do that
// in scribus12formatimpl.h and scribus12formatimpl.cpp .
-Scribus12Format::Scribus12Format() :
- LoadSavePlugin()
+Scribus12Format::Scribus12Format()
{
VorlC = -1;
@@ -148,9 +147,7 @@
// Not gzip encoded, just load it
loadRawText(fileName, docBytes);
}
- if (docBytes.left(16) != "<SCRIBUSUTF8NEW " && (docBytes.left(12) == "<SCRIBUSUTF8" || docBytes.left(9) == "<SCRIBUS>"))
- return true;
- return false;
+ return docBytes.left(16) != "<SCRIBUSUTF8NEW " && (docBytes.left(12) == "<SCRIBUSUTF8" || docBytes.left(9) == "<SCRIBUS>");
}
QString Scribus12Format::readSLA(const QString & fileName)
@@ -527,14 +524,14 @@
currItem->setLayer(Buffer->LayerID);
currItem->PoLine = Buffer->PoLine.copy();
currItem->setTextFlowMode((PageItem::TextFlowMode) Buffer->TextflowMode);
- if (Buffer->ContourLine.size() == 0)
+ if (Buffer->ContourLine.empty())
currItem->ContourLine = currItem->PoLine.copy();
else
currItem->ContourLine = Buffer->ContourLine.copy();
if (!currItem->asLine())
{
// OBSOLETE CR 2005-02-06
- if ((currItem->PoLine.size() == 0) && (currItem->itemType() != PageItem::ItemType1))
+ if ((currItem->PoLine.empty()) && (currItem->itemType() != PageItem::ItemType1))
currItem->convertClip();
else
//
@@ -687,7 +684,7 @@
}
-void Scribus12Format::getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces)
+void Scribus12Format::getReplacedFontData(bool& getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces)
{
getNewReplacement=false;
getReplacedFonts.clear();
@@ -699,11 +696,11 @@
return 100000 * ((long long) itemNr) + pageNr;
}
-bool Scribus12Format::loadFile(const QString & fileName, const FileFormat & /* fmt */, int /* flags */, int /* index */)
+bool Scribus12Format::loadFile(const QString& fileName, const FileFormat & /* fmt */, int /* flags */, int /* index */)
{
- if (m_Doc==0 || m_View==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_View==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_View==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_View==nullptr || m_AvailableFonts==nullptr);
return false;
}
// ReplacedFonts.clear();
@@ -761,7 +758,7 @@
if (elem.hasAttribute("Version"))
newVersion = true;
QDomNode DOC=elem.firstChild();
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
{
m_mwProgressBar->setMaximum(DOC.childNodes().count());
m_mwProgressBar->setValue(0);
@@ -889,13 +886,13 @@
m_Doc->guidesPrefs().majorGridSpacing = ScCLocale::toDoubleC(dc.attribute("MAJGRID"), prefsManager->appPrefs.guidesPrefs.majorGridSpacing);
m_Doc->itemToolPrefs().lineStartArrow = 0;
m_Doc->itemToolPrefs().lineEndArrow = 0;
- m_Doc->LastAuto = 0;
+ m_Doc->LastAuto = nullptr;
QDomNode PAGE=DOC.firstChild();
counter = 0;
while(!PAGE.isNull())
{
ObCount++;
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
m_mwProgressBar->setValue(ObCount);
QDomElement pg=PAGE.toElement();
// 10/25/2004 pv - None is "reserved" color. cannot be defined in any file...
@@ -1118,19 +1115,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = m_Doc->Items->at(TableID[ta->TopLinkID]);
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = m_Doc->Items->at(TableID[ta->LeftLinkID]);
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = m_Doc->Items->at(TableID[ta->RightLinkID]);
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = m_Doc->Items->at(TableID[ta->BottomLinkID]);
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
}
@@ -1307,19 +1304,19 @@
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
{
PageItem* item = m_Doc->DocItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->MasterItems.count(); ++i)
{
PageItem* item = m_Doc->MasterItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
@@ -1366,7 +1363,7 @@
}
setCurrentComboItem(m_ScMW->unitSwitcher, unitGetStrFromIndex(m_Doc->unitIndex()));
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
m_mwProgressBar->setValue(DOC.childNodes().count());
ScMessageBox::warning(ScCore->primaryMainWindow(),
@@ -1814,9 +1811,9 @@
bool Scribus12Format::loadPage(const QString & fileName, int pageNumber, bool Mpage, QString /*renamedPageName*/)
{
// qDebug() << QString("loading page %2 from file '%1' from 1.2.x plugin").arg(fileName).arg(pageNumber);
- if (m_Doc==0 || m_View==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_View==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_View==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_View==nullptr|| m_AvailableFonts==nullptr);
return false;
}
@@ -2117,19 +2114,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = m_Doc->Items->at(TableID[ta->TopLinkID]);
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = m_Doc->Items->at(TableID[ta->LeftLinkID]);
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = m_Doc->Items->at(TableID[ta->RightLinkID]);
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = m_Doc->Items->at(TableID[ta->BottomLinkID]);
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
// reestablish textframe links
@@ -2155,19 +2152,19 @@
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
{
PageItem* item = m_Doc->DocItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->MasterItems.count(); ++i)
{
PageItem* item = m_Doc->MasterItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h Sun Aug 5 11:20:27 2018
@@ -46,7 +46,7 @@
virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
- virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
+ virtual void getReplacedFontData(bool& getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
private:
void registerFormats();
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12formatimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12formatimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12formatimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12formatimpl.cpp Sun Aug 5 11:20:27 2018
@@ -12,7 +12,7 @@
#include <QMessageBox>
// Initialize members here, if any
-Scribus12FormatImpl::Scribus12FormatImpl() : QObject(0)
+Scribus12FormatImpl::Scribus12FormatImpl() : QObject(nullptr)
{
}
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp Sun Aug 5 11:20:27 2018
@@ -151,10 +151,10 @@
QIODevice* Scribus134Format::slaReader(const QString & fileName)
{
- if (!fileSupported(0, fileName))
+ if (!fileSupported(nullptr, fileName))
return nullptr;
- QIODevice* ioDevice = 0;
+ QIODevice* ioDevice = nullptr;
if (fileName.right(2) == "gz")
{
aFile.setFileName(fileName);
@@ -187,9 +187,9 @@
bool Scribus134Format::loadFile(const QString & fileName, const FileFormat & /* fmt */, int /* flags */, int /* index */)
{
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ParagraphStyle vg;
@@ -202,9 +202,6 @@
QList<PageItem*> TableItems;
QList<PageItem*> TableItemsM;
QList<PageItem*> TableItemsF;
-// QMap<PageItem*, int> groupID;
-// QMap<PageItem*, int> groupIDM;
-// QMap<PageItem*, int> groupIDF;
QStack< QList<PageItem*> > groupStack;
QStack< QList<PageItem*> > groupStackF;
QStack< QList<PageItem*> > groupStackM;
@@ -221,7 +218,7 @@
int firstPage = 0;
int layerToSetActive = 0;
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
{
m_mwProgressBar->setMaximum(ioDevice->size());
m_mwProgressBar->setValue(0);
@@ -247,7 +244,7 @@
TableIDF.clear();
m_Doc->GroupCounter = 1;
- m_Doc->LastAuto = 0;
+ m_Doc->LastAuto = nullptr;
m_Doc->PageColors.clear();
m_Doc->Layers.clear();
@@ -266,7 +263,7 @@
QStringRef tagName = reader.name();
attrs = reader.scAttributes();
- if (m_mwProgressBar != 0)
+ if (m_mwProgressBar != nullptr)
{
int newProgress = qRound(ioDevice->pos() / (double) ioDevice->size() * 100);
if (newProgress != progress)
@@ -508,19 +505,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDF[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDF[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDF[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDF[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItemsM.count() != 0)
@@ -531,19 +528,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDM[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDM[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDM[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDM[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItems.count() != 0)
@@ -554,19 +551,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
//CB Add this in to set this in the file in memory. Its saved, why not load it.
@@ -613,7 +610,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->DocItems.count())
Its = m_Doc->DocItems.at(lc.key());
if (lc.value() < m_Doc->DocItems.count())
@@ -635,7 +632,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->MasterItems.count())
Its = m_Doc->MasterItems.at(lc.key());
if (lc.value() < m_Doc->MasterItems.count())
@@ -757,7 +754,7 @@
m_Doc->restartAutoSaveTimer();
// m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
m_mwProgressBar->setValue(reader.characterOffset());
return true;
// return false;
@@ -1889,7 +1886,7 @@
return true;
}
-bool Scribus134Format::readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, QString renamedPageName)
+bool Scribus134Format::readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, const QString& renamedPageName)
{
QStringRef tagName = reader.name();
ScXmlStreamAttributes attrs = reader.scAttributes();
@@ -1951,7 +1948,7 @@
info.groupLastItem = 0;
info.ownNr = doc->Items->indexOf(newItem);
- info.isGroupFlag = attrs.valueAsBool("isGroupControl", 0);
+ info.isGroupFlag = attrs.valueAsBool("isGroupControl", false);
if (info.isGroupFlag)
info.groupLastItem = attrs.valueAsInt("groupsLastItem", 0);
@@ -2211,19 +2208,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID2[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID2[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID2[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID2[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (groupStackP.count() > 0)
@@ -2519,7 +2516,7 @@
int z = 0;
struct ImageLoadRequest loadingInfo;
PageItem::ItemType pt = static_cast<PageItem::ItemType>(attrs.valueAsInt("PTYPE"));
- bool isGroupFlag = attrs.valueAsBool("isGroupControl", 0);
+ bool isGroupFlag = attrs.valueAsBool("isGroupControl", false);
if (isGroupFlag)
pt = PageItem::Group;
double x = attrs.valueAsDouble("XPOS");
@@ -3136,9 +3133,9 @@
bool Scribus134Format::loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName)
{
// qDebug() << QString("loading page %2 from file '%1' from 1.3.x plugin").arg(fileName).arg(pageNumber);
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ParagraphStyle vg;
@@ -3150,7 +3147,6 @@
QString tmp;
QMap<int,PageItem*> TableID;
QList<PageItem*> TableItems;
- QHash<PageItem*, int> groupID;
double pageX = 0, pageY = 0;
QMap<int,int> layerTrans;
int maxLayer = 0, maxLevel = 0, a = 0;
@@ -3418,19 +3414,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
@@ -3442,7 +3438,7 @@
{
if (itemRemap[lc.value()] >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->DocItems.count())
Its = m_Doc->DocItems.at(lc.key());
if (itemRemap[lc.value()] < m_Doc->DocItems.count())
@@ -3463,7 +3459,7 @@
{
if (itemRemapM[lc.value()] >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->MasterItems.count())
Its = m_Doc->MasterItems.at(lc.key());
if (itemRemapM[lc.value()] < m_Doc->MasterItems.count())
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h Sun Aug 5 11:20:27 2018
@@ -104,7 +104,7 @@
bool readLatexInfo(PageItem_LatexFrame* item, ScXmlStreamReader& reader);
void readLayers(ScLayer& layer, ScXmlStreamAttributes& attrs);
bool readMultiline(multiLine& ml, ScXmlStreamReader& reader);
- bool readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, QString renamedPageName = QString());
+ bool readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, const QString& renamedPageName = QString());
bool readPage(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader);
bool readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134formatimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134formatimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134formatimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134formatimpl.cpp Sun Aug 5 11:20:27 2018
@@ -12,7 +12,7 @@
#include <QMessageBox>
// Initialize members here, if any
-Scribus134FormatImpl::Scribus134FormatImpl() : QObject(0)
+Scribus134FormatImpl::Scribus134FormatImpl() : QObject(nullptr)
{
}
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp Sun Aug 5 11:20:27 2018
@@ -43,8 +43,7 @@
// Please don't implement the functionality of your plugin here; do that
// in scribus13formatimpl.h and scribus13formatimpl.cpp .
-Scribus13Format::Scribus13Format() :
- LoadSavePlugin()
+Scribus13Format::Scribus13Format()
{
// Set action info in languageChange, so we only have to do
// it in one place. This includes registering file formats.
@@ -127,9 +126,7 @@
// Not gzip encoded, just load it
loadRawText(fileName, docBytes);
}
- if (docBytes.left(16) == "<SCRIBUSUTF8NEW " && !docBytes.left(35).contains("Version=\"1.3.4"))
- return true;
- return false;
+ return docBytes.left(16) == "<SCRIBUSUTF8NEW " && !docBytes.left(35).contains("Version=\"1.3.4");
}
QString Scribus13Format::readSLA(const QString & fileName)
@@ -169,9 +166,9 @@
bool Scribus13Format::loadFile(const QString & fileName, const FileFormat & /* fmt */, int /* flags */, int /* index */)
{
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ReplacedFonts.clear();
@@ -225,7 +222,7 @@
if (elem.tagName() != "SCRIBUSUTF8NEW")
return false;
QDomNode DOC=elem.firstChild();
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
{
m_mwProgressBar->setMaximum(DOC.childNodes().count());
m_mwProgressBar->setValue(0);
@@ -452,13 +449,13 @@
m_Doc->clearCheckerProfiles();
m_Doc->setCurCheckProfile(dc.attribute("currentProfile"));
}
- m_Doc->LastAuto = 0;
+ m_Doc->LastAuto = nullptr;
QDomNode PAGE=DOC.firstChild();
counter = 0;
while (!PAGE.isNull())
{
ObCount++;
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
m_mwProgressBar->setValue(ObCount);
QDomElement pg=PAGE.toElement();
if (pg.tagName()=="PageSets")
@@ -1009,19 +1006,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = FrameItems.at(TableIDF[ta->TopLinkID]);
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = FrameItems.at(TableIDF[ta->LeftLinkID]);
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = FrameItems.at(TableIDF[ta->RightLinkID]);
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = FrameItems.at(TableIDF[ta->BottomLinkID]);
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItemsM.count() != 0)
@@ -1032,19 +1029,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = m_Doc->MasterItems.at(TableIDM[ta->TopLinkID]);
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = m_Doc->MasterItems.at(TableIDM[ta->LeftLinkID]);
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = m_Doc->MasterItems.at(TableIDM[ta->RightLinkID]);
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = m_Doc->MasterItems.at(TableIDM[ta->BottomLinkID]);
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItems.count() != 0)
@@ -1055,19 +1052,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = m_Doc->Items->at(TableID[ta->TopLinkID]);
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = m_Doc->Items->at(TableID[ta->LeftLinkID]);
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = m_Doc->Items->at(TableID[ta->RightLinkID]);
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = m_Doc->Items->at(TableID[ta->BottomLinkID]);
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
m_Doc->setMasterPageMode(false);
@@ -1100,7 +1097,7 @@
{
if (itemRemap[lc.value()] >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->Items->count())
Its = m_Doc->Items->at(lc.key());
if (itemRemap[lc.value()] < m_Doc->Items->count())
@@ -1129,19 +1126,19 @@
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
{
PageItem* item = m_Doc->DocItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->MasterItems.count(); ++i)
{
PageItem* item = m_Doc->MasterItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
@@ -1192,7 +1189,7 @@
m_Doc->restartAutoSaveTimer();
// m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
m_mwProgressBar->setValue(DOC.childNodes().count());
ScMessageBox::warning(ScCore->primaryMainWindow(),
@@ -1747,7 +1744,7 @@
IT=IT.nextSibling();
}
}
- if (tbValues.size() > 0)
+ if (!tbValues.empty())
pstyle.setTabValues(tbValues);
//FIXME: what if linked frames have different styles?
currItem->itemText.setDefaultStyle(pstyle);
@@ -2028,9 +2025,9 @@
bool Scribus13Format::loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName)
{
// qDebug() << QString("loading page %2 from file '%1' from 1.3.3.x plugin").arg(fileName).arg(pageNumber);
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ParagraphStyle vg;
@@ -2403,19 +2400,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = m_Doc->Items->at(TableID[ta->TopLinkID]);
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = m_Doc->Items->at(TableID[ta->LeftLinkID]);
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = m_Doc->Items->at(TableID[ta->RightLinkID]);
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = m_Doc->Items->at(TableID[ta->BottomLinkID]);
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
// reestablish textframe links
@@ -2426,7 +2423,7 @@
{
if (itemRemap[lc.value()] >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->Items->count())
Its = m_Doc->Items->at(lc.key());
if (itemRemap[lc.value()] < m_Doc->Items->count())
@@ -2455,19 +2452,19 @@
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
{
PageItem* item = m_Doc->DocItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->MasterItems.count(); ++i)
{
PageItem* item = m_Doc->MasterItems.at(i);
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (auto itf = m_Doc->FrameItems.begin(); itf != m_Doc->FrameItems.end(); ++itf)
{
PageItem *item = itf.value();
- if (item->prevInChain() == 0 && item->itemText.length() > 0)
+ if (item->prevInChain() == nullptr && item->itemText.length() > 0)
item->itemText.fixLegacyFormatting();
}
for (int i = 0; i < m_Doc->DocItems.count(); ++i)
@@ -2576,7 +2573,7 @@
}
}
-QString Scribus13Format::AskForFont(QString fStr, ScribusDoc *doc)
+QString Scribus13Format::AskForFont(const QString& fStr, ScribusDoc *doc)
{
PrefsManager *prefsManager=PrefsManager::instance();
// QFont fo;
@@ -2586,7 +2583,7 @@
if ((!prefsManager->appPrefs.fontPrefs.GFontSub.contains(tmpf)) || (!(*m_AvailableFonts)[prefsManager->appPrefs.fontPrefs.GFontSub[tmpf]].usable()))
{
qApp->setOverrideCursor(QCursor(Qt::ArrowCursor));
- MissingFont *dia = new MissingFont(0, tmpf, doc);
+ MissingFont *dia = new MissingFont(nullptr, tmpf, doc);
dia->exec();
tmpf = dia->getReplacementFont();
delete dia;
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h Sun Aug 5 11:20:27 2018
@@ -54,7 +54,7 @@
PageItem* PasteItem(QDomElement *obj, ScribusDoc *doc, const QString& baseDir, PageItem::ItemKind itemKind, int pagenr = -2 /* currentPage*/);
void GetStyle(QDomElement *pg, ParagraphStyle *vg, StyleSet<ParagraphStyle> *tempParagraphStyles, ScribusDoc* doc, bool fl);
QString readSLA(const QString & fileName);
- QString AskForFont(QString fStr, ScribusDoc *doc);
+ QString AskForFont(const QString& fStr, ScribusDoc *doc);
QMap<int, int> itemRemap;
QMap<int, int> itemNext;
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13formatimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13formatimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13formatimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13formatimpl.cpp Sun Aug 5 11:20:27 2018
@@ -11,7 +11,7 @@
#include <QMessageBox>
// Initialize members here, if any
-Scribus13FormatImpl::Scribus13FormatImpl() : QObject(0)
+Scribus13FormatImpl::Scribus13FormatImpl() : QObject(nullptr)
{
}
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp Sun Aug 5 11:20:27 2018
@@ -57,8 +57,7 @@
// Please don't implement the functionality of your plugin here; do that
// in scribus150formatimpl.h and scribus150formatimpl.cpp .
-Scribus150Format::Scribus150Format() :
- LoadSavePlugin()
+Scribus150Format::Scribus150Format()
{
// Set action info in languageChange, so we only have to do
// it in one place. This includes registering file formats.
@@ -153,10 +152,10 @@
QIODevice* Scribus150Format::slaReader(const QString & fileName)
{
- if (!fileSupported(0, fileName))
+ if (!fileSupported(nullptr, fileName))
return nullptr;
- QIODevice* ioDevice = 0;
+ QIODevice* ioDevice = nullptr;
if (fileName.right(2) == "gz")
{
aFile.setFileName(fileName);
@@ -422,19 +421,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = LinkID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = LinkID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = LinkID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = LinkID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -480,19 +479,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDF[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDF[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDF[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDF[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItemsM.count() != 0)
@@ -503,19 +502,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDM[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDM[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDM[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDM[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItems.count() != 0)
@@ -526,19 +525,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -563,7 +562,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->DocItems.count())
Its = m_Doc->DocItems.at(lc.key());
if (lc.value() < m_Doc->DocItems.count())
@@ -674,9 +673,9 @@
bool Scribus150Format::loadPalette(const QString & fileName)
{
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ParagraphStyle vg;
@@ -710,7 +709,7 @@
}
QString fileDir = QFileInfo(fileName).absolutePath();
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
{
m_mwProgressBar->setMaximum(f.length());
m_mwProgressBar->setValue(0);
@@ -734,7 +733,7 @@
WeldItems.clear();
m_Doc->GroupCounter = 1;
- m_Doc->LastAuto = 0;
+ m_Doc->LastAuto = nullptr;
// m_Doc->PageColors.clear();
// m_Doc->Layers.clear();
@@ -752,7 +751,7 @@
QStringRef tagName = reader.name();
attrs = reader.scAttributes();
- if (m_mwProgressBar != 0)
+ if (m_mwProgressBar != nullptr)
{
int newProgress = qRound(reader.characterOffset() / (double) f.length() * 100);
if (newProgress != progress)
@@ -921,19 +920,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = LinkID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = LinkID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = LinkID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = LinkID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -979,19 +978,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDF[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDF[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDF[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDF[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItemsM.count() != 0)
@@ -1002,19 +1001,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDM[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDM[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDM[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDM[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItems.count() != 0)
@@ -1025,19 +1024,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -1062,7 +1061,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->DocItems.count())
Its = m_Doc->DocItems.at(lc.key());
if (lc.value() < m_Doc->DocItems.count())
@@ -1083,7 +1082,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->MasterItems.count())
Its = m_Doc->MasterItems.at(lc.key());
if (lc.value() < m_Doc->MasterItems.count())
@@ -1197,7 +1196,7 @@
if (m_Doc->Layers.count() == 0)
m_Doc->Layers.newLayer( QObject::tr("Background") );
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
{
m_mwProgressBar->setValue(reader.characterOffset());
m_mwProgressBar->reset();
@@ -1207,9 +1206,9 @@
bool Scribus150Format::loadFile(const QString & fileName, const FileFormat & /* fmt */, int /* flags */, int /* index */)
{
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ParagraphStyle vg;
@@ -1253,7 +1252,7 @@
int firstPage = 0;
int layerToSetActive = 0;
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
{
m_mwProgressBar->setMaximum(ioDevice->size());
m_mwProgressBar->setValue(0);
@@ -1283,7 +1282,7 @@
LinkID.clear();
m_Doc->GroupCounter = 1;
- m_Doc->LastAuto = 0;
+ m_Doc->LastAuto = nullptr;
m_Doc->PageColors.clear();
m_Doc->Layers.clear();
@@ -1302,7 +1301,7 @@
QStringRef tagName = reader.name();
attrs = reader.scAttributes();
- if (m_mwProgressBar != 0)
+ if (m_mwProgressBar != nullptr)
{
int newProgress = qRound(ioDevice->pos() / (double) ioDevice->size() * 100);
if (newProgress != progress)
@@ -1585,7 +1584,7 @@
for (it = bookmarks.begin(); it != bookmarks.end(); ++it)
{
int elem = it.key();
- PageItem* item = LinkID.value(elem, (PageItem*) 0);
+ PageItem* item = LinkID.value(elem, (PageItem*) nullptr);
if (!item)
continue;
ScribusDoc::BookMa bookmark = it.value();
@@ -1604,19 +1603,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = LinkID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = LinkID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = LinkID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = LinkID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -1662,19 +1661,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDF[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDF[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDF[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDF[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItemsM.count() != 0)
@@ -1685,19 +1684,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableIDM[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableIDM[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableIDM[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableIDM[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (TableItems.count() != 0)
@@ -1708,19 +1707,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -1744,7 +1743,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->DocItems.count())
Its = m_Doc->DocItems.at(lc.key());
if (lc.value() < m_Doc->DocItems.count())
@@ -1765,7 +1764,7 @@
{
if (lc.value() >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->MasterItems.count())
Its = m_Doc->MasterItems.at(lc.key());
if (lc.value() < m_Doc->MasterItems.count())
@@ -1929,7 +1928,7 @@
m_Doc->restartAutoSaveTimer();
// m_Doc->autoSaveTimer->start(m_Doc->autoSaveTime());
- if (m_mwProgressBar!=0)
+ if (m_mwProgressBar!=nullptr)
m_mwProgressBar->setValue(reader.characterOffset());
return true;
}
@@ -3701,7 +3700,7 @@
return true;
}
-bool Scribus150Format::readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, QString renamedPageName)
+bool Scribus150Format::readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, const QString& renamedPageName)
{
QStringRef tagName = reader.name();
ScXmlStreamAttributes attrs = reader.scAttributes();
@@ -3781,10 +3780,10 @@
}
info.ownLink = newItem->isTableItem ? attrs.valueAsInt("OwnLINK", 0) : 0;
info.groupLastItem = 0;
- info.isGroupFlag = attrs.valueAsBool("isGroupControl", 0);
+ info.isGroupFlag = attrs.valueAsBool("isGroupControl", false);
if (info.isGroupFlag)
info.groupLastItem = attrs.valueAsInt("groupsLastItem", 0);
- info.isWeldFlag = attrs.valueAsBool("isWeldItem", 0);
+ info.isWeldFlag = attrs.valueAsBool("isWeldItem", false);
info.ownWeld = attrs.valueAsInt("WeldSource", 0);
info.ownNr = doc->Items->indexOf(newItem);
@@ -4337,19 +4336,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = LinkID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = LinkID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = LinkID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = LinkID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -4377,19 +4376,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID2[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID2[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID2[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID2[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -4483,8 +4482,6 @@
{
QStringRef tagName = reader.name();
ScXmlStreamAttributes attrs = reader.scAttributes();
-
- QList<ParagraphStyle::TabRecord> tabValues;
LastStyles * lastStyle = new LastStyles();
while (!reader.atEnd() && !reader.hasError())
@@ -4795,10 +4792,10 @@
int z = 0;
struct ImageLoadRequest loadingInfo;
PageItem::ItemType pt = static_cast<PageItem::ItemType>(attrs.valueAsInt("PTYPE"));
- bool isGroupFlag = attrs.valueAsBool("isGroupControl", 0);
+ bool isGroupFlag = attrs.valueAsBool("isGroupControl", false);
if (isGroupFlag)
pt = PageItem::Group;
- bool isNoteFrameFlag = attrs.valueAsBool("isNoteFrame", 0);
+ bool isNoteFrameFlag = attrs.valueAsBool("isNoteFrame", false);
if (isNoteFrameFlag && (pt == PageItem::TextFrame))
pt = PageItem::NoteFrame;
double xf, yf;
@@ -5972,9 +5969,9 @@
bool Scribus150Format::loadPage(const QString & fileName, int pageNumber, bool Mpage, QString renamedPageName)
{
// qDebug() << QString("loading page %2 from file '%1' from 1.3.x plugin").arg(fileName).arg(pageNumber);
- if (m_Doc==0 || m_AvailableFonts==0)
- {
- Q_ASSERT(m_Doc==0 || m_AvailableFonts==0);
+ if (m_Doc==nullptr || m_AvailableFonts==nullptr)
+ {
+ Q_ASSERT(m_Doc==nullptr || m_AvailableFonts==nullptr);
return false;
}
ParagraphStyle vg;
@@ -6351,7 +6348,7 @@
for (it = bookmarks.begin(); it != bookmarks.end(); ++it)
{
int elem = it.key();
- PageItem* item = LinkID.value(elem, (PageItem*) 0);
+ PageItem* item = LinkID.value(elem, (PageItem*) nullptr);
if (!item)
continue;
ScribusDoc::BookMa bookmark = it.value();
@@ -6369,19 +6366,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = LinkID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = LinkID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = LinkID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = LinkID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -6427,19 +6424,19 @@
if (ta->TopLinkID != -1)
ta->TopLink = TableID[ta->TopLinkID];
else
- ta->TopLink = 0;
+ ta->TopLink = nullptr;
if (ta->LeftLinkID != -1)
ta->LeftLink = TableID[ta->LeftLinkID];
else
- ta->LeftLink = 0;
+ ta->LeftLink = nullptr;
if (ta->RightLinkID != -1)
ta->RightLink = TableID[ta->RightLinkID];
else
- ta->RightLink = 0;
+ ta->RightLink = nullptr;
if (ta->BottomLinkID != -1)
ta->BottomLink = TableID[ta->BottomLinkID];
else
- ta->BottomLink = 0;
+ ta->BottomLink = nullptr;
}
}
if (WeldItems.count() != 0)
@@ -6464,7 +6461,7 @@
{
if (itemRemap[lc.value()] >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->Items->count())
Its = m_Doc->DocItems.at(lc.key());
if (itemRemap[lc.value()] < m_Doc->DocItems.count())
@@ -6485,7 +6482,7 @@
{
if (itemRemapM[lc.value()] >= 0)
{
- PageItem *Its(0), *Itn(0);
+ PageItem *Its(nullptr), *Itn(nullptr);
if (lc.key() < m_Doc->MasterItems.count())
Its = m_Doc->MasterItems.at(lc.key());
if (itemRemapM[lc.value()] < m_Doc->MasterItems.count())
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h Sun Aug 5 11:20:27 2018
@@ -119,7 +119,7 @@
bool readLatexInfo(PageItem_LatexFrame* item, ScXmlStreamReader& reader);
void readLayers(ScLayer& layer, ScXmlStreamAttributes& attrs);
bool readMultiline(multiLine& ml, ScXmlStreamReader& reader);
- bool readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, QString renamedPageName = QString());
+ bool readObject(ScribusDoc* doc, ScXmlStreamReader& reader, ItemInfo& info, const QString& baseDir, bool loadPage, const QString& renamedPageName = QString());
bool readPage(ScribusDoc* doc, ScXmlStreamReader& reader);
bool readPageItemAttributes(PageItem* item, ScXmlStreamReader& reader);
bool readPageSets(ScribusDoc* doc, ScXmlStreamReader& reader);
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp Sun Aug 5 11:20:27 2018
@@ -132,8 +132,8 @@
writeLinestyles(writer);
writePatterns(writer, fileDir, true, selection);
if (!emF.isEmpty())
- WriteObjects(m_Doc, writer, fileDir, 0, 0, ItemSelectionFrame, &emF);
- WriteObjects(m_Doc, writer, fileDir, 0, 0, ItemSelectionElements, &emG);
+ WriteObjects(m_Doc, writer, fileDir, nullptr, 0, ItemSelectionFrame, &emF);
+ WriteObjects(m_Doc, writer, fileDir, nullptr, 0, ItemSelectionElements, &emG);
writer.writeEndElement();
// writer.writeEndDocument();
documentStr.squeeze();
@@ -1513,14 +1513,14 @@
docu.writeAttribute("scaleY", pa.scaleY);
docu.writeAttribute("xoffset", pa.xoffset);
docu.writeAttribute("yoffset", pa.yoffset);
- WriteObjects(m_Doc, docu, baseDir, 0, 0, ItemSelectionPattern, &pa.items);
+ WriteObjects(m_Doc, docu, baseDir, nullptr, 0, ItemSelectionPattern, &pa.items);
docu.writeEndElement();
}
}
void Scribus150Format::writeContent(ScXmlStreamWriter & docu, const QString& baseDir)
{
- if (m_mwProgressBar != 0)
+ if (m_mwProgressBar != nullptr)
{
m_mwProgressBar->setMaximum(m_Doc->DocPages.count()+m_Doc->MasterPages.count()+m_Doc->DocItems.count()+m_Doc->MasterItems.count()+m_Doc->FrameItems.count());
m_mwProgressBar->setValue(0);
@@ -1544,7 +1544,7 @@
for (uint i = 0; i < pages; ++i)
{
ObCount++;
- if (dia2 != 0)
+ if (dia2 != nullptr)
dia2->setValue(ObCount);
if (master)
{
@@ -1799,7 +1799,7 @@
for (uint j = 0; j < objects;++j)
{
ObCount++;
- if (dia2 != 0)
+ if (dia2 != nullptr)
dia2->setValue(ObCount);
item = items->at(j);
switch (master)
@@ -2012,12 +2012,12 @@
if (item->asTextFrame() || item->asPathText() || item->asImageFrame())
{
- if (item->nextInChain() != 0)
+ if (item->nextInChain() != nullptr)
docu.writeAttribute("NEXTITEM", qHash(item->nextInChain()) & 0x7FFFFFFF);
else
docu.writeAttribute("NEXTITEM", -1);
- if (item->prevInChain() != 0 && items->contains(item->prevInChain()))
+ if (item->prevInChain() != nullptr && items->contains(item->prevInChain()))
docu.writeAttribute("BACKITEM", qHash(item->prevInChain()) & 0x7FFFFFFF);
else
{
@@ -2259,7 +2259,7 @@
#endif
if (item->asGroupFrame())
{
- WriteObjects(m_Doc, docu, baseDir, 0, 0, ItemSelectionGroup, &item->groupItemList);
+ WriteObjects(m_Doc, docu, baseDir, nullptr, 0, ItemSelectionGroup, &item->groupItemList);
}
//Write all the cells and their data to the document, as sub-elements of the pageitem.
if (item->isTable())
Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150formatimpl.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22608&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150formatimpl.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150formatimpl.cpp (original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150formatimpl.cpp Sun Aug 5 11:20:27 2018
@@ -12,7 +12,7 @@
#include <QMessageBox>
// Initialize members here, if any
-Scribus150FormatImpl::Scribus150FormatImpl() : QObject(0)
+Scribus150FormatImpl::Scribus150FormatImpl() : QObject(nullptr)
{
}
More information about the scribus-commit
mailing list