r22631 by craig - clazy and clang fixes, part 13
scribus-commit
scribus-commit at lists.scribus.net
Tue Aug 14 19:56:39 UTC 2018
Author: craig
Date: Tue Aug 14 19:56:39 2018
New Revision: 22631
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22631
Log:
clazy and clang fixes, part 13
Modified:
trunk/Scribus/scribus/scimage.cpp
trunk/Scribus/scribus/scimage.h
trunk/Scribus/scribus/scribusXml.cpp
trunk/Scribus/scribus/scribusdoc.cpp
trunk/Scribus/scribus/scribusdoc.h
trunk/Scribus/scribus/tableutils.cpp
trunk/Scribus/scribus/text/storytext.cpp
trunk/Scribus/scribus/text/storytext.h
trunk/Scribus/scribus/textwriter.cpp
trunk/Scribus/scribus/textwriter.h
trunk/Scribus/scribus/third_party/lib2geom/poly.cpp
trunk/Scribus/scribus/third_party/pgf/PGFimage.cpp
trunk/Scribus/scribus/third_party/wpg/WPG1Parser.cpp
trunk/Scribus/scribus/third_party/wpg/WPG2Parser.cpp
trunk/Scribus/scribus/third_party/wpg/WPGOLEStream.cpp
trunk/Scribus/scribus/third_party/wpg/WPGStreamImplementation.cpp
trunk/Scribus/scribus/third_party/wpg/WPGraphics.cpp
trunk/Scribus/scribus/tocgenerator.cpp
trunk/Scribus/scribus/tt/simpletreemodel/treemodel.cpp
trunk/Scribus/scribus/ui/aligndistribute.cpp
trunk/Scribus/scribus/ui/annot.cpp
trunk/Scribus/scribus/ui/applytemplatedialog.cpp
trunk/Scribus/scribus/ui/arcvectordialog.cpp
trunk/Scribus/scribus/ui/newtemp.cpp
trunk/Scribus/scribus/ui/prefs_fonts.cpp
trunk/Scribus/scribus/ui/scdockpalette.cpp
trunk/Scribus/scribus/ui/scdockpalette.h
trunk/Scribus/scribus/ui/scrapbookpalette.cpp
trunk/Scribus/scribus/ui/scrpalettebase.cpp
trunk/Scribus/scribus/ui/scrpalettebase.h
trunk/Scribus/scribus/ui/scrspinbox.cpp
trunk/Scribus/scribus/ui/smpstylewidget.cpp
Modified: trunk/Scribus/scribus/scimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/scimage.cpp
==============================================================================
--- trunk/Scribus/scribus/scimage.cpp (original)
+++ trunk/Scribus/scribus/scimage.cpp Tue Aug 14 19:56:39 2018
@@ -68,7 +68,7 @@
}
-ScImage::ScImage() : QImage()
+ScImage::ScImage()
{
initialize();
}
@@ -1567,20 +1567,20 @@
void ScImage::scaleImage32bpp(int nwidth, int nheight)
{
QImage dst(nwidth, nheight, QImage::Format_ARGB32);
- QRgb* xelrow = 0;
- QRgb* tempxelrow = 0;
- QRgb* xP;
- QRgb* nxP;
+ QRgb* xelrow = nullptr;
+ QRgb* tempxelrow = nullptr;
+ QRgb* xP = nullptr;
+ QRgb* nxP = nullptr;
int rows, cols, rowsread, newrows, newcols;
int row, col, needtoreadrow;
const uchar maxval = 255;
double xscale, yscale;
long sxscale, syscale;
long fracrowtofill, fracrowleft;
- long* as;
- long* rs;
- long* gs;
- long* bs;
+ long* as = nullptr;
+ long* rs = nullptr;
+ long* gs = nullptr;
+ long* bs = nullptr;
int rowswritten = 0;
int depth = this->depth();
@@ -1780,13 +1780,12 @@
d++;
}
}
- return;
}
void ScImage::scaleImageGeneric(int nwidth, int nheight)
{
- unsigned char* xelrow = 0;
- unsigned char* tempxelrow = 0;
+ unsigned char* xelrow = nullptr;
+ unsigned char* tempxelrow = nullptr;
unsigned char* xP;
unsigned char* nxP;
int rows, cols, rowsread, newrows, newcols;
@@ -1845,7 +1844,7 @@
for (int chIndex = 0; chIndex < nChannels; ++chIndex)
{
- xelrow = 0;
+ xelrow = nullptr;
rowsread = rowswritten = 0;
fracrowleft = syscale;
needtoreadrow = 1;
@@ -1954,8 +1953,7 @@
}
if (newrows != rows && tempxelrow)// Robust, tempxelrow might be 0 1 day
delete [] tempxelrow;
- if (ps) // Avoid purify complaint
- delete [] ps;
+ delete [] ps;
int scanWidth = dst.width() * nChannels;
QImage::operator=(QImage(nwidth, nheight, this->format()));
@@ -1965,10 +1963,9 @@
uchar *d = (scanLine( yi ));
memcpy(d, s, scanWidth);
}
- return;
-}
-
-bool ScImage::getAlpha(QString fn, int page, QByteArray& alpha, bool PDF, bool pdf14, int gsRes, int scaleXSize, int scaleYSize)
+}
+
+bool ScImage::getAlpha(const QString& fn, int page, QByteArray& alpha, bool PDF, bool pdf14, int gsRes, int scaleXSize, int scaleYSize)
{
bool gotAlpha = false;
QScopedPointer<ScImgDataLoader> pDataLoader;
@@ -2018,12 +2015,12 @@
if (pDataLoader.data())
pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
}
- else if (ext == "kra")
- {
- pDataLoader.reset( new ScImgDataLoader_KRA() );
- if (pDataLoader.data())
- pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
- }
+ else if (ext == "kra")
+ {
+ pDataLoader.reset( new ScImgDataLoader_KRA() );
+ if (pDataLoader.data())
+ pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
+ }
else if (ext == "pat")
pDataLoader.reset( new ScImgDataLoader_GIMP() );
else if (ext == "pgf")
@@ -2233,7 +2230,7 @@
bool isCMYK = false;
bool ret = false;
// bool inputProfIsEmbedded = false;
- if (realCMYK != 0)
+ if (realCMYK != nullptr)
*realCMYK = false;
bool bilevel = false;
// short resolutionunit = 0;
@@ -2298,11 +2295,11 @@
pDataLoader.reset( new ScImgDataLoader_ORA() );
pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
}
- else if (ext == "kra")
- {
- pDataLoader.reset( new ScImgDataLoader_KRA() );
- pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
- }
+ else if (ext == "kra")
+ {
+ pDataLoader.reset( new ScImgDataLoader_KRA() );
+ pDataLoader->setRequest(imgInfo.isRequest, imgInfo.RequestProps);
+ }
#ifdef GMAGICK_FOUND
else if (fmtImg.contains(ext))
pDataLoader.reset( new ScImgDataLoader_QT() );
@@ -2369,7 +2366,7 @@
{
QString profilePath;
//CB If this is null, customfiledialog/picsearch/ScPreview might be sending it
- Q_ASSERT(cmSettings.doc()!=0);
+ Q_ASSERT(cmSettings.doc()!=nullptr);
if (isCMYK)
{
if (ScCore->InputProfilesCMYK.contains(cmSettings.profileName()) && (cmSettings.profileName() != cmSettings.doc()->cmsSettings().DefaultImageCMYKProfile))
@@ -2488,7 +2485,7 @@
outputCSpace = screenCSpace;
break;
case RawData: // no Conversion just raw Data
- xform = 0;
+ xform = nullptr;
if (pDataLoader->useRawImage())
{
QImage::operator=(pDataLoader->r_image.convertToQImage(true, true));
Modified: trunk/Scribus/scribus/scimage.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/scimage.h
==============================================================================
--- trunk/Scribus/scribus/scimage.h (original)
+++ trunk/Scribus/scribus/scimage.h Tue Aug 14 19:56:39 2018
@@ -91,7 +91,7 @@
bool writePSImageToFilter(ScStreamFilter* filter, int pl) const;
bool writePSImageToFilter(ScStreamFilter* filter, const QByteArray& mask, int pl) const;
- bool getAlpha(QString fn, int page, QByteArray& alpha, bool PDF, bool pdf14, int gsRes = 72, int scaleXSize = 0, int scaleYSize = 0);
+ bool getAlpha(const QString& fn, int page, QByteArray& alpha, bool PDF, bool pdf14, int gsRes = 72, int scaleXSize = 0, int scaleYSize = 0);
bool convert2JPG(QString fn, int Quality, bool isCMYK, bool isGray);
// Image effects
Modified: trunk/Scribus/scribus/scribusXml.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/scribusXml.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusXml.cpp (original)
+++ trunk/Scribus/scribus/scribusXml.cpp Tue Aug 14 19:56:39 2018
@@ -145,7 +145,7 @@
const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_SLA150IMPORT);
if (fmt)
{
- fmt->setupTargets(doc, 0, doc->scMW(), 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
+ fmt->setupTargets(doc, nullptr, doc->scMW(), nullptr, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
fmt->loadElements(elementData, fileDir, toLayer, xPos, yPos, loc);
return true;
}
@@ -222,7 +222,7 @@
const FileFormat *fmt = LoadSavePlugin::getFormatById(FORMATID_SLA150EXPORT);
if (fmt)
{
- fmt->setupTargets(doc, 0, doc->scMW(), 0, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
+ fmt->setupTargets(doc, nullptr, doc->scMW(), nullptr, &(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts));
documentStr = fmt->saveElements(xp, yp, wp, hp, selection, ba);
}
return documentStr;
Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp (original)
+++ trunk/Scribus/scribus/scribusdoc.cpp Tue Aug 14 19:56:39 2018
@@ -212,7 +212,7 @@
m_modified(false),
m_ActiveLayer(0),
m_rotMode(0),
- m_automaticTextFrames(0),
+ m_automaticTextFrames(false),
m_masterPageMode(false),
m_symbolEditMode(false),
m_inlineEditMode(false),
@@ -232,7 +232,7 @@
rulerXoffset(0.0), rulerYoffset(0.0),
Pages(nullptr), MasterPages(), DocPages(),
MasterNames(),
- Items(0), MasterItems(), DocItems(), FrameItems(),
+ Items(nullptr), MasterItems(), DocItems(), FrameItems(),
m_Selection(new Selection(this, true)),
PageSp(1), PageSpa(0),
FirstPnum(1),
@@ -347,7 +347,7 @@
GuideLock(false),
minCanvasCoordinate(FPoint(0, 0)),
rulerXoffset(0.0), rulerYoffset(0.0),
- Pages(0), MasterPages(), DocPages(),
+ Pages(nullptr), MasterPages(), DocPages(),
MasterNames(),
Items(nullptr), MasterItems(), DocItems(), FrameItems(),
m_Selection(new Selection(this, true)),
@@ -757,14 +757,10 @@
else
(*AllFonts)[it3.key()].decreaseUsage();
}
- if (docHyphenator)
- delete docHyphenator;
- if (m_serializer)
- delete m_serializer;
- if (m_tserializer)
- delete m_tserializer;
- if (m_docUpdater)
- delete m_docUpdater;
+ delete docHyphenator;
+ delete m_serializer;
+ delete m_tserializer;
+ delete m_docUpdater;
if (!m_docPrefsData.docSetupPrefs.AutoSaveKeep)
{
if (autoSaveFiles.count() != 0)
@@ -800,17 +796,14 @@
bool ScribusDoc::inASpecialEditMode() const
{ // #12897, modes that use setSpecialEditMode() function in appmodehelper.cpp
- bool inSpecialEditMode = (appMode == modeDrawBezierLine ||
- appMode == modeEditArc ||
- appMode == modeEditGradientVectors ||
- appMode == modeEditMeshGradient ||
- appMode == modeEditMeshPatch ||
- appMode == modeEditPolygon ||
- appMode == modeEditSpiral ||
- appMode == modeEditWeldPoint
- ) ? true : false;
-
- return inSpecialEditMode;
+ return appMode == modeDrawBezierLine ||
+ appMode == modeEditArc ||
+ appMode == modeEditGradientVectors ||
+ appMode == modeEditMeshGradient ||
+ appMode == modeEditMeshPatch ||
+ appMode == modeEditPolygon ||
+ appMode == modeEditSpiral ||
+ appMode == modeEditWeldPoint;
}
QList<PageItem*> ScribusDoc::getAllItems(QList<PageItem*> &items)
@@ -2483,7 +2476,7 @@
void ScribusDoc::resetPage(int fp, MarginStruct* newMargins)
{
- if (newMargins!=0)
+ if (newMargins!=nullptr)
m_docPrefsData.docSetupPrefs.margins = *newMargins;
m_docPrefsData.docSetupPrefs.pagePositioning = fp;
}
@@ -2926,7 +2919,7 @@
Items->at(z)->isAutoText = true;
Items->at(z)->Cols = qRound(PageSp);
Items->at(z)->ColGap = PageSpa;
- if (LastAuto != 0)
+ if (LastAuto != nullptr)
LastAuto->link(Items->at(z));
else
FirstAuto = Items->at(z);
@@ -4961,72 +4954,62 @@
bool ScribusDoc::changePageProperties(const double initialTop, const double initialBottom, const double initialLeft, const double initialRight, const double initialHeight, const double initialWidth, const double height, const double width, const int orientation, const QString& pageSize, const int marginPreset, const bool moveObjects, const int pageNumber, const int pageType)
{
- bool retVal=true;
- if (pageNumber==-1)
- {
- //find page and set values
+ if (pageNumber==-1 || currentPage()==nullptr)
return false;
- }
- else
- {
- if (currentPage()==nullptr)
- retVal=false;
- else
- {
- QRectF pagebox(currentPage()->xOffset(), currentPage()->yOffset(), qMax( currentPage()->width(), width), qMax(currentPage()->height(), height));
- if (UndoManager::undoEnabled())
- {
- SimpleState *ss = new SimpleState(Um::ChangePageProps);//, QString("%1").arg(pageNumber), Um::IPage);
- ss->set("PAGE_CHANGEPROPS");
- ss->set("PAGE_NUM", pageNumber);
- ss->set("OLD_PAGE_INITIALTOP", currentPage()->initialMargins.top());
- ss->set("OLD_PAGE_INITIALBOTTOM", currentPage()->initialMargins.bottom());
- ss->set("OLD_PAGE_INITIALLEFT", currentPage()->initialMargins.left());
- ss->set("OLD_PAGE_INITIALRIGHT", currentPage()->initialMargins.right());
- ss->set("OLD_PAGE_INITIALHEIGHT", currentPage()->initialHeight());
- ss->set("OLD_PAGE_INITIALWIDTH", currentPage()->initialWidth());
- ss->set("OLD_PAGE_HEIGHT", currentPage()->height());
- ss->set("OLD_PAGE_WIDTH", currentPage()->width());
- ss->set("OLD_PAGE_ORIENTATION", currentPage()->orientation());
- ss->set("OLD_PAGE_SIZE", currentPage()->m_pageSize);
- ss->set("OLD_PAGE_TYPE", currentPage()->LeftPg);
- ss->set("OLD_PAGE_MARGINPRESET", currentPage()->marginPreset);
- ss->set("OLD_PAGE_MOVEOBJECTS", moveObjects);
- ss->set("NEW_PAGE_INITIALTOP", initialTop);
- ss->set("NEW_PAGE_INITIALBOTTOM", initialBottom);
- ss->set("NEW_PAGE_INITIALLEFT", initialLeft);
- ss->set("NEW_PAGE_INITIALRIGHT", initialRight);
- ss->set("NEW_PAGE_INITIALHEIGHT", initialHeight);
- ss->set("NEW_PAGE_INITIALWIDTH", initialWidth);
- ss->set("NEW_PAGE_HEIGHT", height);
- ss->set("NEW_PAGE_WIDTH", width);
- ss->set("NEW_PAGE_ORIENTATION", orientation);
- ss->set("NEW_PAGE_SIZE", pageSize);
- ss->set("NEW_PAGE_TYPE", pageType);
- ss->set("NEW_PAGE_MARGINPRESET", marginPreset);
- ss->set("MASTER_PAGE_MODE", masterPageMode());
- m_undoManager->action(this, ss);
- }
- //set the current page's values
- currentPage()->initialMargins.setTop(initialTop);
- currentPage()->initialMargins.setBottom(initialBottom);
- currentPage()->initialMargins.setLeft(initialLeft);
- currentPage()->initialMargins.setRight(initialRight);
- currentPage()->setInitialHeight(initialHeight);
- currentPage()->setInitialWidth(initialWidth);
- currentPage()->setHeight(height);
- currentPage()->setWidth(width);
- currentPage()->setOrientation(orientation);
- currentPage()->m_pageSize = pageSize;
- currentPage()->LeftPg = pageType;
- currentPage()->marginPreset = marginPreset;
- reformPages(moveObjects);
- invalidateRegion(pagebox);
- regionsChanged()->update(pagebox);
- changed();
- }
- }
- return retVal;
+
+ QRectF pagebox(currentPage()->xOffset(), currentPage()->yOffset(), qMax( currentPage()->width(), width), qMax(currentPage()->height(), height));
+ if (UndoManager::undoEnabled())
+ {
+ SimpleState *ss = new SimpleState(Um::ChangePageProps);//, QString("%1").arg(pageNumber), Um::IPage);
+ ss->set("PAGE_CHANGEPROPS");
+ ss->set("PAGE_NUM", pageNumber);
+ ss->set("OLD_PAGE_INITIALTOP", currentPage()->initialMargins.top());
+ ss->set("OLD_PAGE_INITIALBOTTOM", currentPage()->initialMargins.bottom());
+ ss->set("OLD_PAGE_INITIALLEFT", currentPage()->initialMargins.left());
+ ss->set("OLD_PAGE_INITIALRIGHT", currentPage()->initialMargins.right());
+ ss->set("OLD_PAGE_INITIALHEIGHT", currentPage()->initialHeight());
+ ss->set("OLD_PAGE_INITIALWIDTH", currentPage()->initialWidth());
+ ss->set("OLD_PAGE_HEIGHT", currentPage()->height());
+ ss->set("OLD_PAGE_WIDTH", currentPage()->width());
+ ss->set("OLD_PAGE_ORIENTATION", currentPage()->orientation());
+ ss->set("OLD_PAGE_SIZE", currentPage()->m_pageSize);
+ ss->set("OLD_PAGE_TYPE", currentPage()->LeftPg);
+ ss->set("OLD_PAGE_MARGINPRESET", currentPage()->marginPreset);
+ ss->set("OLD_PAGE_MOVEOBJECTS", moveObjects);
+ ss->set("NEW_PAGE_INITIALTOP", initialTop);
+ ss->set("NEW_PAGE_INITIALBOTTOM", initialBottom);
+ ss->set("NEW_PAGE_INITIALLEFT", initialLeft);
+ ss->set("NEW_PAGE_INITIALRIGHT", initialRight);
+ ss->set("NEW_PAGE_INITIALHEIGHT", initialHeight);
+ ss->set("NEW_PAGE_INITIALWIDTH", initialWidth);
+ ss->set("NEW_PAGE_HEIGHT", height);
+ ss->set("NEW_PAGE_WIDTH", width);
+ ss->set("NEW_PAGE_ORIENTATION", orientation);
+ ss->set("NEW_PAGE_SIZE", pageSize);
+ ss->set("NEW_PAGE_TYPE", pageType);
+ ss->set("NEW_PAGE_MARGINPRESET", marginPreset);
+ ss->set("MASTER_PAGE_MODE", masterPageMode());
+ m_undoManager->action(this, ss);
+ }
+ //set the current page's values
+ currentPage()->initialMargins.setTop(initialTop);
+ currentPage()->initialMargins.setBottom(initialBottom);
+ currentPage()->initialMargins.setLeft(initialLeft);
+ currentPage()->initialMargins.setRight(initialRight);
+ currentPage()->setInitialHeight(initialHeight);
+ currentPage()->setInitialWidth(initialWidth);
+ currentPage()->setHeight(height);
+ currentPage()->setWidth(width);
+ currentPage()->setOrientation(orientation);
+ currentPage()->m_pageSize = pageSize;
+ currentPage()->LeftPg = pageType;
+ currentPage()->marginPreset = marginPreset;
+ reformPages(moveObjects);
+ invalidateRegion(pagebox);
+ regionsChanged()->update(pagebox);
+ changed();
+
+ return true;
}
void ScribusDoc::recalculateColorsList(QList<PageItem*> *itemList)
@@ -7761,8 +7744,7 @@
UndoTransaction activeTransaction;
m_updateManager.setUpdatesDisabled();
if (UndoManager::undoEnabled() && selectedItemCount > 1)
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup,
- Um::IGroup, Um::LineWidth, "", Um::ILineStyle);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::LineWidth, "", Um::ILineStyle);
for (int i = 0; i < selectedItemCount; ++i)
{
@@ -7835,8 +7817,7 @@
UndoTransaction activeTransaction;
m_updateManager.setUpdatesDisabled();
if (UndoManager::undoEnabled() && selectedItemCount > 1)
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup,
- Um::IGroup, Um::LineStyle, "", Um::ILineStyle);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::LineStyle, "", Um::ILineStyle);
for (int i = 0; i < selectedItemCount; ++i)
{
m_Selection->itemAt(i)->setLineStyle(w);
@@ -7858,8 +7839,7 @@
UndoTransaction activeTransaction;
m_updateManager.setUpdatesDisabled();
if (UndoManager::undoEnabled() && selectedItemCount > 1)
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup,
- Um::IGroup, Um::LineJoin, "", Um::ILineStyle);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::LineJoin, "", Um::ILineStyle);
for (int i = 0; i < selectedItemCount; ++i)
{
m_Selection->itemAt(i)->setLineJoin(w);
@@ -7881,8 +7861,7 @@
UndoTransaction activeTransaction;
m_updateManager.setUpdatesDisabled();
if (UndoManager::undoEnabled() && selectedItemCount > 1)
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup,
- Um::IGroup, Um::LineEnd, "", Um::ILineStyle);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::LineEnd, "", Um::ILineStyle);
for (int i = 0; i < selectedItemCount; ++i)
{
m_Selection->itemAt(i)->setLineEnd(w);
@@ -9178,7 +9157,7 @@
newStyle.applyStyle(currItem->asNoteFrame()->masterFrame()->currentStyle());
}
else
- newStyle.setParent(currItem->itemText.defaultStyle().parent());
+ newStyle.setParent(currItem->itemText.defaultStyle().parent());
if (UndoManager::undoEnabled())
{
ScItemState<QPair<ParagraphStyle,ParagraphStyle> > *is = new ScItemState<QPair <ParagraphStyle,ParagraphStyle> >(Um::SetStyle);
@@ -9367,7 +9346,7 @@
void ScribusDoc::itemSelection_ApplyCharStyle(const CharStyle & newStyle, Selection* customSelection, const QString& ETEA)
{
- Selection* itemSelection = (customSelection != 0) ? customSelection : m_Selection;
+ Selection* itemSelection = (customSelection != nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
uint selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
@@ -10648,9 +10627,9 @@
if (UndoManager::undoEnabled() && docSelectionCount > 1)
{
if (m_Selection->itemAt(0)->locked())
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::UnLock, 0, Um::IUnLock);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::UnLock, nullptr, Um::IUnLock);
else
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::Lock, 0, Um::ILock);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::Lock, nullptr, Um::ILock);
}
for (uint a = 0; a < docSelectionCount; ++a)
{
@@ -10676,9 +10655,9 @@
if (UndoManager::undoEnabled() && selectedItemCount > 1)
{
if (m_Selection->itemAt(0)->sizeLocked())
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::SizeUnLock, 0, Um::IUnLock);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::SizeUnLock, nullptr, Um::IUnLock);
else
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::SizeLock, 0, Um::ILock);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::SizeLock, nullptr, Um::ILock);
}
for (int i = 0; i < selectedItemCount; ++i)
{
@@ -10727,9 +10706,9 @@
if (docSelectionCount > 1 && UndoManager::undoEnabled())
{
if (m_Selection->itemAt(0)->printEnabled())
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::DisablePrint, 0, Um::IDisablePrint);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::DisablePrint, nullptr, Um::IDisablePrint);
else
- activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::EnablePrint, 0, Um::IEnablePrint);
+ activeTransaction = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::EnablePrint, nullptr, Um::IEnablePrint);
}
for (int i = 0; i < docSelectionCount; ++i)
{
@@ -10743,7 +10722,7 @@
emit firstSelectedItemType(m_Selection->itemAt(0)->itemType());
}
-void ScribusDoc::itemSelection_Transform(int nrOfCopies, QTransform matrix, int basepoint)
+void ScribusDoc::itemSelection_Transform(int nrOfCopies, const QTransform& matrix, int basepoint)
{
int docSelectionCount=m_Selection->count();
if (docSelectionCount == 0)
@@ -10950,7 +10929,7 @@
return;
UndoTransaction trans;
if (UndoManager::undoEnabled())
- trans = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipH, 0, Um::IFlipH);
+ trans = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipH, nullptr, Um::IFlipH);
if (docSelectionCount > 1)
{
double gx, gy, gh, gw, ix, iy, iw, ih;
@@ -11070,7 +11049,7 @@
return;
UndoTransaction trans;
if (UndoManager::undoEnabled())
- trans = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipV, 0, Um::IFlipV);
+ trans = m_undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::FlipV, nullptr, Um::IFlipV);
if (docSelectionCount > 1)
{
double gx, gy, gh, gw, ix, iy, iw, ih;
@@ -11368,7 +11347,7 @@
void ScribusDoc::itemSelection_ClearItem(Selection* customSelection, bool useWarning)
{
- Selection* itemSelection = (customSelection != 0) ? customSelection : m_Selection;
+ Selection* itemSelection = (customSelection != nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
int selectedItemCount = itemSelection->count();
@@ -11399,7 +11378,7 @@
void ScribusDoc::itemSelection_TruncateItem(Selection* customSelection)
{
- Selection* itemSelection = (customSelection != 0) ? customSelection : m_Selection;
+ Selection* itemSelection = (customSelection != nullptr) ? customSelection : m_Selection;
assert(itemSelection != nullptr);
int selectedItemCount = itemSelection->count();
@@ -11938,7 +11917,7 @@
void ScribusDoc::itemSelection_SetImageScaleAndOffset(double sx, double sy, double ox, double oy, Selection* customSelection)
{
Selection* itemSelection = (customSelection!=nullptr) ? customSelection : m_Selection;
- assert(itemSelection !=0 );
+ assert(itemSelection !=nullptr );
int selectedItemCount = itemSelection->count();
if (selectedItemCount == 0)
return;
@@ -11958,7 +11937,7 @@
activeTransaction = m_undoManager->beginTransaction();
currItem->setImageXYScale(sx, sy);
currItem->setImageXYOffset(ox/sx, oy/sy);
- if (currItem->imageClip.size() != 0)
+ if (!currItem->imageClip.empty())
{
currItem->imageClip = currItem->pixm.imgInfo.PDSpathData[currItem->pixm.imgInfo.usedPath].copy();
QTransform cl;
@@ -14383,7 +14362,7 @@
return true;
}
-bool ScribusDoc::moveSizeItem(FPoint newX, FPoint newY, PageItem* currItem, bool fromMP, bool constrainRotation)
+bool ScribusDoc::moveSizeItem(const FPoint& newX, const FPoint& newY, PageItem* currItem, bool fromMP, bool constrainRotation)
{
QRectF oldR(currItem->getBoundingRect());
if (currItem->asLine())
@@ -17293,7 +17272,7 @@
NS->setName(newName);
}
-void ScribusDoc::deleteNotesStyle(QString nsName)
+void ScribusDoc::deleteNotesStyle(const QString& nsName)
{
NotesStyle* NS = getNotesStyle(nsName);
assert(NS != nullptr);
@@ -18031,7 +18010,7 @@
return nF;
}
-PageItem_NoteFrame *ScribusDoc::createNoteFrame(NotesStyle *nStyle, double x, double y, double w, double h, double w2, QString fill, QString outline)
+PageItem_NoteFrame *ScribusDoc::createNoteFrame(NotesStyle *nStyle, double x, double y, double w, double h, double w2, const QString& fill, const QString& outline)
{
PageItem_NoteFrame* nF = new PageItem_NoteFrame(nStyle, this, x, y, w, h, w2, fill, outline);
if (nStyle->isEndNotes())
Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h (original)
+++ trunk/Scribus/scribus/scribusdoc.h Tue Aug 14 19:56:39 2018
@@ -1171,7 +1171,7 @@
void rotateItem(double win, PageItem *currItem);
void moveRotated(PageItem *currItem, const FPoint& npv);
bool sizeItem(double newX, double newY, PageItem *pi, bool fromMP = false, bool DoUpdateClip = true, bool redraw = true);
- bool moveSizeItem(FPoint newX, FPoint newY, PageItem* currItem, bool fromMP = false, bool constrainRotation = false);
+ bool moveSizeItem(const FPoint& newX, const FPoint& newY, PageItem* currItem, bool fromMP = false, bool constrainRotation = false);
void adjustItemSize(PageItem *currItem, bool includeGroup = false, bool moveInGroup = true);
void moveGroup(double x, double y, Selection* customSelection = nullptr);
void rotateGroup(double angle, Selection* customSelection = nullptr);
@@ -1441,7 +1441,7 @@
void itemSelection_TogglePrintEnabled();
void itemSelection_ToggleBookMark(Selection* customSelection = nullptr);
void itemSelection_ToggleAnnotation(Selection* customSelection = nullptr);
- void itemSelection_Transform(int nrOfCopies, QTransform matrix, int basepoint);
+ void itemSelection_Transform(int nrOfCopies, const QTransform& matrix, int basepoint);
void itemSelection_ChangePreviewResolution(int id);
/*! \brief Change display quality of all images in document.
@@ -1734,14 +1734,14 @@
NotesStyle* newNotesStyle(const NotesStyle& NS);
void renameNotesStyle(NotesStyle* NS, const QString& newName);
//delete whole notes style with its notesframes and notes
- void deleteNotesStyle(QString nsName);
+ void deleteNotesStyle(const QString& nsName);
void undoSetNotesStyle(SimpleState* ss, NotesStyle* ns);
NotesStyle* getNotesStyle(const QString& nsName);
//delete note, if fromText than marks for given note will be removed
void deleteNote(TextNote* note);
void setUndoDelNote(TextNote* note);
PageItem_NoteFrame* createNoteFrame(PageItem_TextFrame* inFrame, NotesStyle *nStyle, int index = -1);
- PageItem_NoteFrame* createNoteFrame(NotesStyle *nStyle, double x, double y, double w, double h, double w2, QString fill, QString outline);
+ PageItem_NoteFrame* createNoteFrame(NotesStyle *nStyle, double x, double y, double w, double h, double w2, const QString& fill, const QString& outline);
//delete noteframe
void delNoteFrame(PageItem_NoteFrame *nF, bool removeMarks=true, bool forceDeletion = true);
//renumber notes for given notes style
Modified: trunk/Scribus/scribus/tableutils.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/tableutils.cpp
==============================================================================
--- trunk/Scribus/scribus/tableutils.cpp (original)
+++ trunk/Scribus/scribus/tableutils.cpp Tue Aug 14 19:56:39 2018
@@ -196,7 +196,7 @@
// Both borders are null, so return a null border.
return collapsedBorder;
}
- else if (firstBorder.isNull())
+ if (firstBorder.isNull())
{
// First border is null, so return second border.
collapsedBorder = secondBorder;
Modified: trunk/Scribus/scribus/text/storytext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/text/storytext.cpp
==============================================================================
--- trunk/Scribus/scribus/text/storytext.cpp (original)
+++ trunk/Scribus/scribus/text/storytext.cpp Tue Aug 14 19:56:39 2018
@@ -533,7 +533,7 @@
// const CharStyle* newP = & that->paragraphStyle(pos+1).charStyle();
// d->replaceParentStyle(pos, oldP, newP);
delete it->parstyle;
- it->parstyle = 0;
+ it->parstyle = nullptr;
}
// demote this parsep so the assert code in replaceCharStyleContextInParagraph()
// doesn't choke:
@@ -1442,7 +1442,7 @@
}
-void StoryText::replaceStyles(QMap<QString,QString> newNameForOld)
+void StoryText::replaceStyles(const QMap<QString,QString>& newNameForOld)
{
ResourceCollection newnames;
newnames.mapStyles(newNameForOld);
@@ -1615,16 +1615,14 @@
{
if (pos < length())
return pos+1;
- else
- return length();
+ return length();
}
int StoryText::prevChar(int pos)
{
if (pos > 0)
return pos - 1;
- else
- return 0;
+ return 0;
}
int StoryText::firstWord()
@@ -2598,8 +2596,7 @@
{
if (tag == ParagraphStyle::saxxDefaultElem)
{
- if (lastStyle)
- delete lastStyle;
+ delete lastStyle;
lastStyle = this->dig->top<ParagraphStyle>(0);
// qDebug() << QString("endstyle: %1 %2 %3").arg("?").arg(lastPos).arg((ulong)lastStyle);
}
@@ -2635,8 +2632,7 @@
~SpanAction_body()
{
- if (lastStyle)
- delete lastStyle;
+ delete lastStyle;
}
void begin(const Xml_string& tag, Xml_attr attr)
@@ -2646,8 +2642,7 @@
{
StoryText* story = this->dig->top<StoryText>();
lastPos = story->length();
- if (lastStyle)
- delete lastStyle;
+ delete lastStyle;
lastStyle = nullptr;
}
}
@@ -2657,8 +2652,7 @@
if (tag == CharStyle::saxxDefaultElem)
// qDebug() << QString("spanaction: end %1").arg(tag);
{
- if (lastStyle)
- delete lastStyle;
+ delete lastStyle;
lastStyle = this->dig->top<CharStyle>(0);
}
else if (tag == "span")
Modified: trunk/Scribus/scribus/text/storytext.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/text/storytext.h
==============================================================================
--- trunk/Scribus/scribus/text/storytext.h (original)
+++ trunk/Scribus/scribus/text/storytext.h Tue Aug 14 19:56:39 2018
@@ -186,7 +186,7 @@
void applyStyle(int pos, const ParagraphStyle& style, bool rmDirectFormatting = false);
void eraseCharStyle(int pos, uint len, const CharStyle& style);
void eraseStyle(int pos, const ParagraphStyle& style);
- void replaceStyles(QMap<QString,QString> newNameForOld);
+ void replaceStyles(const QMap<QString,QString>& newNameForOld);
void replaceCharStyles(QMap<QString,QString> newNameForOld);
// Cleanup legacy formatting for whole story, ie remove direct
Modified: trunk/Scribus/scribus/textwriter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/textwriter.cpp
==============================================================================
--- trunk/Scribus/scribus/textwriter.cpp (original)
+++ trunk/Scribus/scribus/textwriter.cpp Tue Aug 14 19:56:39 2018
@@ -32,7 +32,7 @@
TextWriter::TextWriter(ScribusDoc *doc)
{
m_document = doc;
- m_frame = 0;
+ m_frame = nullptr;
m_styledUptoPos = 0;
}
@@ -104,7 +104,7 @@
setStyle(pstyle);
}
-void TextWriter::defineCharStyle(const QString name, const CharStyle &cstyle)
+void TextWriter::defineCharStyle(const QString& name, const CharStyle &cstyle)
{
CharStyle* newStyle = m_charStyles.create(cstyle);
newStyle->setName(name);
@@ -139,4 +139,4 @@
ScribusDoc* TextWriter::currentDoc()
{
return m_document;
-}
+}
Modified: trunk/Scribus/scribus/textwriter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/textwriter.h
==============================================================================
--- trunk/Scribus/scribus/textwriter.h (original)
+++ trunk/Scribus/scribus/textwriter.h Tue Aug 14 19:56:39 2018
@@ -87,7 +87,7 @@
/**
Introduces a new named character style into the document
*/
- void defineCharStyle(const QString name, const CharStyle& cstyle);
+ void defineCharStyle(const QString& name, const CharStyle& cstyle);
/**
Introduces a new named paragraph style into the document
*/
Modified: trunk/Scribus/scribus/third_party/lib2geom/poly.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/lib2geom/poly.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/lib2geom/poly.cpp (original)
+++ trunk/Scribus/scribus/third_party/lib2geom/poly.cpp Tue Aug 14 19:56:39 2018
@@ -141,41 +141,41 @@
*/
Poly divide(Poly const &a, Poly const &b, Poly &r) {
- Poly c;
- r = a; // remainder
- assert(b.size() > 0);
-
- const unsigned k = a.degree();
- const unsigned l = b.degree();
- c.resize(k, 0.);
-
- for(unsigned i = k; i >= l; i--) {
- assert(i >= 0);
- double ci = r.back()/b.back();
- c[i-l] += ci;
- Poly bb = ci*b;
- //std::cout << ci <<"*(" << b.shifted(i-l) << ") = "
- // << bb.shifted(i-l) << " r= " << r << std::endl;
- r -= bb.shifted(i-l);
- r.pop_back();
- }
- //std::cout << "r= " << r << std::endl;
- r.normalize();
- c.normalize();
-
- return c;
+ Poly c;
+ r = a; // remainder
+ assert(!b.empty());
+
+ const unsigned k = a.degree();
+ const unsigned l = b.degree();
+ c.resize(k, 0.);
+
+ for(unsigned i = k; i >= l; i--) {
+ assert(i >= 0);
+ double ci = r.back()/b.back();
+ c[i-l] += ci;
+ Poly bb = ci*b;
+ //std::cout << ci <<"*(" << b.shifted(i-l) << ") = "
+ // << bb.shifted(i-l) << " r= " << r << std::endl;
+ r -= bb.shifted(i-l);
+ r.pop_back();
+ }
+ //std::cout << "r= " << r << std::endl;
+ r.normalize();
+ c.normalize();
+
+ return c;
}
Poly gcd(Poly const &a, Poly const &b, const double tol) {
- if(a.size() < b.size())
- return gcd(b, a);
- if(b.size() <= 0)
- return a;
- if(b.size() == 1)
- return a;
- Poly r;
- divide(a, b, r);
- return gcd(b, r);
+ if(a.size() < b.size())
+ return gcd(b, a);
+ if(b.empty())
+ return a;
+ if(b.size() == 1)
+ return a;
+ Poly r;
+ divide(a, b, r);
+ return gcd(b, r);
}
Modified: trunk/Scribus/scribus/third_party/pgf/PGFimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/pgf/PGFimage.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/pgf/PGFimage.cpp (original)
+++ trunk/Scribus/scribus/third_party/pgf/PGFimage.cpp Tue Aug 14 19:56:39 2018
@@ -930,7 +930,7 @@
#pragma omp parallel for default(shared)
#endif
for (int i=0; i < m_header.channels; i++) {
- DataT *temp = NULL;
+ DataT *temp = nullptr;
if (error == NoError) {
if (m_wtChannel[i]) {
ASSERT(m_channel[i]);
@@ -940,7 +940,7 @@
if (temp) {
memcpy(temp, m_channel[i], size*DataTSize);
delete m_wtChannel[i]; // also deletes m_channel
- m_channel[i] = NULL;
+ m_channel[i] = nullptr;
} else {
error = InsufficientMemory;
}
@@ -1231,7 +1231,7 @@
m_encoder->UpdateLevelLength();
}
// delete encoder
- delete m_encoder; m_encoder = NULL;
+ delete m_encoder; m_encoder = nullptr;
}
return nWrittenBytes;
@@ -1334,7 +1334,7 @@
const double dP = 1.0/m_header.height;
int defMap[] = { 0, 1, 2, 3, 4, 5, 6, 7 }; ASSERT(sizeof(defMap)/sizeof(defMap[0]) == MaxChannels);
- if (channelMap == NULL) channelMap = defMap;
+ if (channelMap == nullptr) channelMap = defMap;
switch(m_header.mode) {
case ImageModeBitmap:
Modified: trunk/Scribus/scribus/third_party/wpg/WPG1Parser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/wpg/WPG1Parser.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/wpg/WPG1Parser.cpp (original)
+++ trunk/Scribus/scribus/third_party/wpg/WPG1Parser.cpp Tue Aug 14 19:56:39 2018
@@ -159,32 +159,32 @@
{
{ 0x01, "Fill Attributes", &WPG1Parser::handleFillAttributes },
{ 0x02, "Line Attributes", &WPG1Parser::handleLineAttributes },
- { 0x03, "Marker Atttibutes", 0 },
- { 0x04, "Polymarker", 0 },
+ { 0x03, "Marker Atttibutes", nullptr },
+ { 0x04, "Polymarker", nullptr },
{ 0x05, "Line", &WPG1Parser::handleLine },
{ 0x06, "Polyline", &WPG1Parser::handlePolyline },
{ 0x07, "Rectangle", &WPG1Parser::handleRectangle },
{ 0x08, "Polygon", &WPG1Parser::handlePolygon },
{ 0x09, "Ellipse", &WPG1Parser::handleEllipse },
- { 0x0a, "Reserved", 0 },
+ { 0x0a, "Reserved", nullptr },
{ 0x0b, "Bitmap (Type 1)", &WPG1Parser::handleBitmapTypeOne },
- { 0x0c, "Graphics Text (Type 1)", 0 },
- { 0x0d, "Grephics Text Attributes", 0 },
+ { 0x0c, "Graphics Text (Type 1)", nullptr },
+ { 0x0d, "Grephics Text Attributes", nullptr },
{ 0x0e, "Colormap", &WPG1Parser::handleColormap },
{ 0x0f, "Start WPG", &WPG1Parser::handleStartWPG },
{ 0x10, "End WPG", &WPG1Parser::handleEndWPG },
{ 0x11, "Postscript Data (Type 1)", &WPG1Parser::handlePostscriptTypeOne },
- { 0x12, "Output Attributes", 0 },
+ { 0x12, "Output Attributes", nullptr },
{ 0x13, "Curved Polyline", &WPG1Parser::handleCurvedPolyline },
{ 0x14, "Bitmap (Type 2)", &WPG1Parser::handleBitmapTypeTwo },
- { 0x15, "Start Figure", 0 },
- { 0x16, "Start Chart", 0 },
- { 0x17, "Planperfect Data", 0 },
- { 0x18, "Graphics Text (Type 2)", 0 },
- { 0x19, "Start WPG (Type 2)", 0 },
- { 0x1a, "Graphics Text (Type 3)", 0 },
+ { 0x15, "Start Figure", nullptr },
+ { 0x16, "Start Chart", nullptr },
+ { 0x17, "Planperfect Data", nullptr },
+ { 0x18, "Graphics Text (Type 2)", nullptr },
+ { 0x19, "Start WPG (Type 2)", nullptr },
+ { 0x1a, "Graphics Text (Type 3)", nullptr },
{ 0x1b, "Postscript Data (Type 2)", &WPG1Parser::handlePostscriptTypeTwo },
- { 0x00, 0, 0 } // end marker
+ { 0x00, nullptr, nullptr } // end marker
};
// initialization
@@ -702,7 +702,7 @@
std::vector<unsigned char> buffer;
decodeRLE(buffer, width, height, depth);
- if (buffer.size() && buffer.size() == (size_t)((width*depth + 7)/8)*height)
+ if (!buffer.empty() && buffer.size() == (size_t)((width*depth + 7)/8)*height)
{
fillPixels(bitmap, &buffer[0], width, height, depth);
m_painter->drawBitmap(bitmap, hres, vres);
Modified: trunk/Scribus/scribus/third_party/wpg/WPG2Parser.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/wpg/WPG2Parser.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/wpg/WPG2Parser.cpp (original)
+++ trunk/Scribus/scribus/third_party/wpg/WPG2Parser.cpp Tue Aug 14 19:56:39 2018
@@ -250,19 +250,19 @@
{ 0x01, "Start WPG", &WPG2Parser::handleStartWPG },
{ 0x02, "End WPG", &WPG2Parser::handleEndWPG },
{ 0x03, "Form Settings", &WPG2Parser::handleFormSettings },
- { 0x04, "Ruler Settings", 0 }, // ignored
- { 0x05, "Grid Settings", 0 }, // ignored
+ { 0x04, "Ruler Settings", nullptr }, // ignored
+ { 0x05, "Grid Settings", nullptr }, // ignored
{ 0x06, "Layer", &WPG2Parser::handleLayer },
{ 0x08, "Pen Style Definition", &WPG2Parser::handlePenStyleDefinition },
- { 0x09, "Pattern Definition", 0 },
- { 0x0a, "Comment", 0 }, // ignored
- { 0x0b, "Color Transfer", 0 },
+ { 0x09, "Pattern Definition", nullptr },
+ { 0x0a, "Comment", nullptr }, // ignored
+ { 0x0b, "Color Transfer", nullptr },
{ 0x0c, "Color Palette", &WPG2Parser::handleColorPalette },
{ 0x0d, "DP Color Palette", &WPG2Parser::handleDPColorPalette },
{ 0x0e, "Bitmap Data", &WPG2Parser::handleBitmapData },
- { 0x0f, "Text Data", 0 },
- { 0x10, "Chart Style", 0 }, // ignored
- { 0x11, "Chart Data", 0 }, // ignored
+ { 0x0f, "Text Data", nullptr },
+ { 0x10, "Chart Style", nullptr }, // ignored
+ { 0x11, "Chart Data", nullptr }, // ignored
{ 0x12, "Object Image", &WPG2Parser::handleObjectImage },
{ 0x15, "Polyline", &WPG2Parser::handlePolyline },
{ 0x16, "Polyspline", &WPG2Parser::handlePolyspline },
@@ -295,17 +295,17 @@
{ 0x33, "Brush Back Color", &WPG2Parser::handleBrushBackColor },
{ 0x34, "DP Brush Back Color", &WPG2Parser::handleDPBrushBackColor },
{ 0x35, "Brush Pattern", &WPG2Parser::handleBrushPattern },
- { 0x36, "Horizontal Line", 0 },
- { 0x37, "Vertical Line", 0 },
- { 0x38, "Poster Settings", 0 },
- { 0x39, "Image State", 0 },
- { 0x3a, "Envelope Definition", 0 },
- { 0x3b, "Envelope", 0 },
- { 0x3c, "Texture Definition", 0 },
- { 0x3d, "Brush Texture", 0 },
- { 0x3e, "Texture Alignment", 0 },
- { 0x3f, "Pen Texture ", 0 },
- { 0x00, 0, 0 } // end marker
+ { 0x36, "Horizontal Line", nullptr },
+ { 0x37, "Vertical Line", nullptr },
+ { 0x38, "Poster Settings", nullptr },
+ { 0x39, "Image State", nullptr },
+ { 0x3a, "Envelope Definition", nullptr },
+ { 0x3b, "Envelope", nullptr },
+ { 0x3c, "Texture Definition", nullptr },
+ { 0x3d, "Brush Texture", nullptr },
+ { 0x3e, "Texture Alignment", nullptr },
+ { 0x3f, "Pen Texture ", nullptr },
+ { 0x00, nullptr, nullptr } // end marker
};
// initialization
Modified: trunk/Scribus/scribus/third_party/wpg/WPGOLEStream.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/wpg/WPGOLEStream.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/wpg/WPGOLEStream.cpp (original)
+++ trunk/Scribus/scribus/third_party/wpg/WPGOLEStream.cpp Tue Aug 14 19:56:39 2018
@@ -844,7 +844,7 @@
fail(false),
blocks(),
m_pos(0),
- cache_data(0),
+ cache_data(nullptr),
cache_size(4096),
cache_pos(0)
{
@@ -968,7 +968,7 @@
// =========== Storage ==========
libwpg::Storage::Storage( const std::stringstream &memorystream ) :
- io(NULL)
+ io(nullptr)
{
io = new StorageIO( this, memorystream );
}
Modified: trunk/Scribus/scribus/third_party/wpg/WPGStreamImplementation.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/wpg/WPGStreamImplementation.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/wpg/WPGStreamImplementation.cpp (original)
+++ trunk/Scribus/scribus/third_party/wpg/WPGStreamImplementation.cpp Tue Aug 14 19:56:39 2018
@@ -71,8 +71,8 @@
file(),
buffer(std::ios::binary | std::ios::in | std::ios::out),
streamSize(0),
- buf(0),
- readBuffer(0),
+ buf(nullptr),
+ readBuffer(nullptr),
readBufferLength(0),
readBufferPos(0)
{
@@ -89,7 +89,7 @@
WPGMemoryStreamPrivate::WPGMemoryStreamPrivate(const std::string str) :
buffer(str, std::ios::binary | std::ios::in),
streamSize(0),
- buf(0)
+ buf(nullptr)
{
}
Modified: trunk/Scribus/scribus/third_party/wpg/WPGraphics.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/third_party/wpg/WPGraphics.cpp
==============================================================================
--- trunk/Scribus/scribus/third_party/wpg/WPGraphics.cpp (original)
+++ trunk/Scribus/scribus/third_party/wpg/WPGraphics.cpp Tue Aug 14 19:56:39 2018
@@ -43,7 +43,7 @@
bool libwpg::WPGraphics::isSupported(WPXInputStream* input)
{
input->seek(0, WPX_SEEK_SET);
- WPXInputStream *graphics = 0;
+ WPXInputStream *graphics = nullptr;
bool isDocumentOLE = false;
if (input->isOLEStream())
@@ -83,9 +83,9 @@
bool libwpg::WPGraphics::parse(::WPXInputStream* input, libwpg::WPGPaintInterface* painter)
{
input->seek(0, WPX_SEEK_CUR);
- WPGXParser *parser = 0;
+ WPGXParser *parser = nullptr;
- WPXInputStream *graphics = 0;
+ WPXInputStream *graphics = nullptr;
bool isDocumentOLE = false;
if (input->isOLEStream())
@@ -137,8 +137,7 @@
return false;
}
- if (parser)
- delete parser;
+ delete parser;
if (graphics && isDocumentOLE)
delete graphics;
Modified: trunk/Scribus/scribus/tocgenerator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/tocgenerator.cpp
==============================================================================
--- trunk/Scribus/scribus/tocgenerator.cpp (original)
+++ trunk/Scribus/scribus/tocgenerator.cpp Tue Aug 14 19:56:39 2018
@@ -76,10 +76,10 @@
PageItem *currentDocItem;
QMap<QString, QString> tocMap;
- uint *pageCounter = new uint[m_doc->DocPages.count()];
+ int *pageCounter = new int[m_doc->DocPages.count()];
if (pageCounter == nullptr)
return;
- uint pageNumberWidth = QString("%1").arg(m_doc->DocPages.count()).length();
+ int pageNumberWidth = QString("%1").arg(m_doc->DocPages.count()).length();
for (int i = 0; i < m_doc->DocPages.count(); ++i)
pageCounter[i] = 0;
Modified: trunk/Scribus/scribus/tt/simpletreemodel/treemodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/tt/simpletreemodel/treemodel.cpp
==============================================================================
--- trunk/Scribus/scribus/tt/simpletreemodel/treemodel.cpp (original)
+++ trunk/Scribus/scribus/tt/simpletreemodel/treemodel.cpp Tue Aug 14 19:56:39 2018
@@ -52,7 +52,7 @@
TreeModel::TreeModel(QObject *parent )
{
- m_rootItem = 0;
+ m_rootItem = nullptr;
}
//! [0]
@@ -102,7 +102,7 @@
Qt::ItemFlags TreeModel::flags(const QModelIndex &index) const
{
if (!index.isValid())
- return 0;
+ return nullptr;
return Qt::ItemIsEnabled | Qt::ItemIsSelectable;
}
Modified: trunk/Scribus/scribus/ui/aligndistribute.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/aligndistribute.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/aligndistribute.cpp (original)
+++ trunk/Scribus/scribus/ui/aligndistribute.cpp Tue Aug 14 19:56:39 2018
@@ -47,7 +47,7 @@
//TODO Distribute with
-AlignDistributePalette::AlignDistributePalette( QWidget* parent, const char* name) : ScDockPalette( parent, name, 0 )
+AlignDistributePalette::AlignDistributePalette( QWidget* parent, const char* name) : ScDockPalette( parent, name, nullptr )
{
setupUi(this);
setSizePolicy( QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum));
Modified: trunk/Scribus/scribus/ui/annot.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/annot.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/annot.cpp (original)
+++ trunk/Scribus/scribus/ui/annot.cpp Tue Aug 14 19:56:39 2018
@@ -183,8 +183,8 @@
Passwd->setChecked(annotation.Flag() & Annotation::Flag_Password);
MaxChars->setMinimum(0);
MaxChars->setMaximum(32768);
- bool setter = annotation.MaxChar() != -1 ? true : false;
- MaxChars->setValue(setter == true ? annotation.MaxChar() : 0);
+ bool setter = annotation.MaxChar() != -1;
+ MaxChars->setValue(setter ? annotation.MaxChar() : 0);
Limit->setChecked(setter);
MaxChars->setEnabled(setter);
NoScroll->setChecked(annotation.Flag() & Annotation::Flag_DoNotScroll);
@@ -553,7 +553,7 @@
void ScAnnot::IconsEin()
{
- bool setter = !UseIcons->isChecked() ? false : true;
+ bool setter = UseIcons->isChecked();
IconN->setEnabled(setter);
IconP->setEnabled(setter);
IconR->setEnabled(setter);
@@ -562,9 +562,9 @@
PiconPrev->setEnabled(setter);
RiconPrev->setEnabled(setter);
PlaceIcon->setEnabled(setter);
- IconNR->setEnabled(!item->Pfile.isEmpty() ? true : false);
- IconPR->setEnabled(!item->Pfile2.isEmpty() ? true : false);
- IconRR->setEnabled(!item->Pfile3.isEmpty() ? true : false);
+ IconNR->setEnabled(!item->Pfile.isEmpty());
+ IconPR->setEnabled(!item->Pfile2.isEmpty());
+ IconRR->setEnabled(!item->Pfile3.isEmpty());
m_annotation.setUseIcons(UseIcons->isChecked());
}
@@ -938,7 +938,7 @@
void ScAnnot::HandleVali()
{
- bool setter = SimpleValid->isChecked() ? true : false;
+ bool setter = SimpleValid->isChecked();
MaxValid->setEnabled(setter);
MinValid->setEnabled(setter);
EditValScript->setEnabled(false);
@@ -974,7 +974,7 @@
void ScAnnot::HandleCalc()
{
- bool setter = SimpleCalc->isChecked() ? true : false;
+ bool setter = SimpleCalc->isChecked();
CalcFields->setEnabled(setter);
CalcArt->setEnabled(setter);
EditCalc->setEnabled(false);
@@ -1012,7 +1012,7 @@
void ScAnnot::SetCurr()
{
- bool setter = UseCurr->isChecked() ? true : false;
+ bool setter = UseCurr->isChecked();
CurSym->setEnabled(setter);
PreCurr->setEnabled(setter);
}
@@ -1447,8 +1447,8 @@
NoScroll->setChecked(annotation.Flag() & Annotation::Flag_DoNotScroll);
ChkStil->setCurrentIndex(annotation.ChkStil());
isChkd->setChecked(annotation.IsChk());
- setter = annotation.MaxChar() != -1 ? true : false;
- MaxChars->setValue(setter == true ? annotation.MaxChar() : 0);
+ setter = annotation.MaxChar() != -1;
+ MaxChars->setValue(setter ? annotation.MaxChar() : 0);
Limit->setChecked(setter);
MaxChars->setEnabled(setter);
connect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActionType(int)));
Modified: trunk/Scribus/scribus/ui/applytemplatedialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/applytemplatedialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/applytemplatedialog.cpp (original)
+++ trunk/Scribus/scribus/ui/applytemplatedialog.cpp Tue Aug 14 19:56:39 2018
@@ -188,12 +188,11 @@
{
if (currentPageRadioButton->isChecked())
return CurrentPage;
- else if (evenPagesRadioButton->isChecked())
+ if (evenPagesRadioButton->isChecked())
return EvenPages;
- else if (oddPagesRadioButton->isChecked())
+ if (oddPagesRadioButton->isChecked())
return OddPages;
- else
- return AllPages;
+ return AllPages;
}
void ApplyMasterPageDialog::checkRangeFrom()
Modified: trunk/Scribus/scribus/ui/arcvectordialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/arcvectordialog.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/arcvectordialog.cpp (original)
+++ trunk/Scribus/scribus/ui/arcvectordialog.cpp Tue Aug 14 19:56:39 2018
@@ -23,7 +23,7 @@
#include "arcvectordialog.h"
-ArcVectorDialog::ArcVectorDialog(QWidget* parent) : ScrPaletteBase( parent, "ArcVectorDialog", false, 0 )
+ArcVectorDialog::ArcVectorDialog(QWidget* parent) : ScrPaletteBase( parent, "ArcVectorDialog", false, nullptr )
{
setupUi(this);
startAngle->setNewUnit(6);
Modified: trunk/Scribus/scribus/ui/newtemp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/newtemp.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/newtemp.cpp (original)
+++ trunk/Scribus/scribus/ui/newtemp.cpp Tue Aug 14 19:56:39 2018
@@ -43,8 +43,8 @@
Layout2->addWidget( Answer );
QueryLayout->addLayout( Layout2 );
- Layout3 = 0;
- Links = 0;
+ Layout3 = nullptr;
+ Links = nullptr;
if (doc->pagePositioning() != singlePage)
{
Layout3 = new QHBoxLayout;
Modified: trunk/Scribus/scribus/ui/prefs_fonts.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/prefs_fonts.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_fonts.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_fonts.cpp Tue Aug 14 19:56:39 2018
@@ -69,7 +69,7 @@
// preferences, we let the user customize font search paths. Because things
// go rather badly if paths are changed/removed while a doc is open, the
// control is also not displayed if there is a document open.
- if (m_doc==0 && !ScCore->primaryMainWindow()->HaveDoc)
+ if (m_doc==nullptr && !ScCore->primaryMainWindow()->HaveDoc)
{
whyBlankLabel->resize(0,0);
whyBlankLabel->hide();
@@ -221,7 +221,7 @@
face.subset(fontListTableView->isFontSubsetted(i));
}
- if (m_doc==0)
+ if (m_doc==nullptr)
writePaths();
prefsData->fontPrefs.GFontSub.clear();
@@ -282,7 +282,7 @@
void Prefs_Fonts::readPaths()
{
- Q_ASSERT(m_doc==0); // should never be called in doc-specific prefs
+ Q_ASSERT(m_doc==nullptr); // should never be called in doc-specific prefs
PrefsContext *fontPrefsContext = PrefsManager::instance()->prefsFile->getContext("Fonts");
PrefsTable *fontPathTable = fontPrefsContext->getTable("ExtraFontDirs");
pathListWidget->clear();
@@ -292,7 +292,7 @@
void Prefs_Fonts::writePaths() const
{
- Q_ASSERT(m_doc==0); // should never be called in doc-specific prefs
+ Q_ASSERT(m_doc==nullptr); // should never be called in doc-specific prefs
PrefsContext *fontPrefsContext = PrefsManager::instance()->prefsFile->getContext("Fonts");
PrefsTable *fontPathTable = fontPrefsContext->getTable("ExtraFontDirs");
fontPathTable->clear();
@@ -302,7 +302,7 @@
void Prefs_Fonts::SelectPath(QListWidgetItem *c)
{
- if (m_doc==0)
+ if (m_doc==nullptr)
{
changeButton->setEnabled(true);
removeButton->setEnabled(true);
@@ -312,7 +312,7 @@
void Prefs_Fonts::AddPath()
{
- Q_ASSERT(m_doc==0); // should never be called in doc-specific prefs
+ Q_ASSERT(m_doc==nullptr); // should never be called in doc-specific prefs
PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");
CurrentPath = dirs->get("fontprefs", ".");
QString s = QFileDialog::getExistingDirectory(this, tr("Choose a Directory"), CurrentPath);
@@ -339,7 +339,7 @@
void Prefs_Fonts::ChangePath()
{
- Q_ASSERT(m_doc==0); // should never be called in doc-specific prefs
+ Q_ASSERT(m_doc==nullptr); // should never be called in doc-specific prefs
QString s = QFileDialog::getExistingDirectory(this, tr("Choose a Directory"), CurrentPath);
if (s.isEmpty())
return;
@@ -372,7 +372,7 @@
void Prefs_Fonts::DelPath()
{
- Q_ASSERT(m_doc==0); // should never be called in doc-specific prefs
+ Q_ASSERT(m_doc==nullptr); // should never be called in doc-specific prefs
QFile fx(PrefsManager::instance()->preferencesLocation()+"/scribusfont13.rc");
if (!fx.open(QIODevice::WriteOnly))
return;
Modified: trunk/Scribus/scribus/ui/scdockpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/scdockpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scdockpalette.cpp Tue Aug 14 19:56:39 2018
@@ -44,7 +44,7 @@
#else
: QDockWidget ( parent, f | Qt::Tool | Qt::CustomizeWindowHint ),
#endif
- palettePrefs(0),
+ palettePrefs(nullptr),
prefsContextName(QString::null),
visibleOnStartup(false)
{
@@ -64,7 +64,7 @@
");
}
originalParent=parent;
- tempParent=0;
+ tempParent=nullptr;
setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
setWindowIcon(IconManager::instance()->loadPixmap("AppIcon.png"));
setPrefsContext(prefsContext);
@@ -72,7 +72,7 @@
connect(PrefsManager::instance(), SIGNAL(prefsChanged()), this, SLOT(setFontSize()));
}
-void ScDockPalette::setPrefsContext(QString context)
+void ScDockPalette::setPrefsContext(const QString& context)
{
if (prefsContextName.isEmpty())
{
Modified: trunk/Scribus/scribus/ui/scdockpalette.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/scdockpalette.h
==============================================================================
--- trunk/Scribus/scribus/ui/scdockpalette.h (original)
+++ trunk/Scribus/scribus/ui/scdockpalette.h Tue Aug 14 19:56:39 2018
@@ -57,7 +57,7 @@
protected:
/** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
- virtual void setPrefsContext(QString context);
+ virtual void setPrefsContext(const QString& context);
void storePosition();
void storePosition(int newX, int newY);
void storeSize();
Modified: trunk/Scribus/scribus/ui/scrapbookpalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/scrapbookpalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrapbookpalette.cpp (original)
+++ trunk/Scribus/scribus/ui/scrapbookpalette.cpp Tue Aug 14 19:56:39 2018
@@ -471,11 +471,11 @@
QDomElement dc=DOC.toElement();
if (dc.tagName()=="OBJEKT")
{
- QFile fi(QDir::cleanPath(QDir::toNativeSeparators(newName + "/" + dc.attribute("NAME", 0) + ".sce")));
+ QFile fi(QDir::cleanPath(QDir::toNativeSeparators(newName + "/" + dc.attribute("NAME", nullptr) + ".sce")));
if(!fi.open(QIODevice::WriteOnly))
continue ;
QDataStream s(&fi);
- QString fn = dc.attribute("DATA", 0);
+ QString fn = dc.attribute("DATA", nullptr);
cf = isUtf8? fn.toUtf8() : fn.toLocal8Bit();
s.writeRawData(cf.data(), cf.length());
fi.close();
@@ -645,7 +645,7 @@
{
bool mode = false;
ScImage im;
- CMSettings cms(0, "", Intent_Perceptual);
+ CMSettings cms(nullptr, "", Intent_Perceptual);
cms.allowColorManagement(false);
if (im.loadPicture(QDir::cleanPath(QDir::toNativeSeparators(name + "/" + d5[dc])), 1, cms, ScImage::Thumbnail, 72, &mode))
{
@@ -699,7 +699,7 @@
}
/* This is the main Dialog-Class for the Scrapbook */
-Biblio::Biblio( QWidget* parent) : ScDockPalette( parent, "Sclib", 0)
+Biblio::Biblio( QWidget* parent) : ScDockPalette( parent, "Sclib", nullptr)
{
// resize( 230, 190 );
setObjectName(QString::fromLocal8Bit("Sclib"));
@@ -765,7 +765,7 @@
Frame3->addItem(tempBView, tr("Copied Items"));
tempBView->visibleName = tr("Copied Items");
tempCount = 0;
- actItem = 0;
+ actItem = nullptr;
BiblioLayout->addWidget( Frame3 );
setWidget( containerWidget );
@@ -1108,7 +1108,7 @@
{
emit pasteToActualPage(ite->text());
activeBView->clearSelection();
- actItem = 0;
+ actItem = nullptr;
}
}
@@ -1140,7 +1140,7 @@
{
emit pasteToActualPage(actItem->text());
activeBView->clearSelection();
- actItem = 0;
+ actItem = nullptr;
}
void Biblio::HandleMouse(QPoint p)
@@ -1149,7 +1149,7 @@
// scrapbook content, hence invalidating actItem while context menu is executing.
ScCore->fileWatcher->stop();
QListWidgetItem *ite = activeBView->itemAt(p);
- if (ite != 0)
+ if (ite != nullptr)
{
actItem = ite;
QMenu *pmenu = new QMenu();
@@ -1212,7 +1212,7 @@
delete pmenu;
}
activeBView->clearSelection();
- actItem = 0;
+ actItem = nullptr;
ScCore->fileWatcher->start();
}
@@ -1361,7 +1361,7 @@
delete activeBView->takeItem(activeBView->row(ite));
if (activeBView == tempBView)
emit updateRecentMenue();
- actItem = 0;
+ actItem = nullptr;
}
void Biblio::deleteAllObj()
@@ -1404,7 +1404,7 @@
activeBView->objectMap.clear();
if (activeBView == tempBView)
emit updateRecentMenue();
- actItem = 0;
+ actItem = nullptr;
}
void Biblio::renameObj()
@@ -1608,7 +1608,7 @@
if (activeBView->objectMap.contains(nam))
nam += "("+ tmp.setNum(tempCount) + ")";
}
- Query dia(this, "tt", 1, tr("&Name:"), tr("New Entry"));
+ Query dia(this, "tt", true, tr("&Name:"), tr("New Entry"));
dia.setValidator(QRegExp("[\\w()]+"));
dia.setEditText(nam, true);
dia.setTestList(activeBView->objectMap.keys());
@@ -1621,7 +1621,7 @@
{
bool mode = false;
ScImage im;
- CMSettings cms(0, "", Intent_Perceptual);
+ CMSettings cms(nullptr, "", Intent_Perceptual);
cms.allowColorManagement(false);
if (im.loadPicture(path, 1, cms, ScImage::Thumbnail, 72, &mode))
img = im.scaled(60, 60, Qt::KeepAspectRatio, Qt::SmoothTransformation);
Modified: trunk/Scribus/scribus/ui/scrpalettebase.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/scrpalettebase.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrpalettebase.cpp (original)
+++ trunk/Scribus/scribus/ui/scrpalettebase.cpp Tue Aug 14 19:56:39 2018
@@ -41,7 +41,7 @@
: QDialog ( parent, f | Qt::Tool | Qt::CustomizeWindowHint
| Qt::WindowTitleHint | Qt::WindowMinMaxButtonsHint
| Qt::WindowSystemMenuHint | Qt::WindowCloseButtonHint ),
- palettePrefs(0),
+ palettePrefs(nullptr),
prefsContextName(QString::null),
visibleOnStartup(false)
{
@@ -61,14 +61,14 @@
");
}
originalParent=parent;
- tempParent=0;
+ tempParent=nullptr;
setWindowIcon(IconManager::instance()->loadIcon("AppIcon.png"));
setPrefsContext(prefsContext);
setModal(modal);
connect(PrefsManager::instance(), SIGNAL(prefsChanged()), this, SLOT(setFontSize()));
}
-void ScrPaletteBase::setPrefsContext(QString context)
+void ScrPaletteBase::setPrefsContext(const QString& context)
{
if (prefsContextName.isEmpty())
{
@@ -259,12 +259,12 @@
int ScrPaletteBase::exec(QWidget* newParent)
{
- Q_ASSERT(tempParent==0 && newParent!=0);
+ Q_ASSERT(tempParent==nullptr && newParent!=nullptr);
tempParent=newParent;
Qt::WindowFlags wflags = windowFlags();
setParent(newParent, wflags);
int i=QDialog::exec();
setParent(originalParent, wflags);
- tempParent=0;
+ tempParent=nullptr;
return i;
}
Modified: trunk/Scribus/scribus/ui/scrpalettebase.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/scrpalettebase.h
==============================================================================
--- trunk/Scribus/scribus/ui/scrpalettebase.h (original)
+++ trunk/Scribus/scribus/ui/scrpalettebase.h Tue Aug 14 19:56:39 2018
@@ -59,7 +59,7 @@
protected:
/** @brief Set the Preferences context to be used for storage of startup visibility and position and size */
- virtual void setPrefsContext(QString context);
+ virtual void setPrefsContext(const QString& context);
void storePosition();
void storePosition(int newX, int newY);
void storeSize();
Modified: trunk/Scribus/scribus/ui/scrspinbox.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/scrspinbox.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/scrspinbox.cpp (original)
+++ trunk/Scribus/scribus/ui/scrspinbox.cpp Tue Aug 14 19:56:39 2018
@@ -41,7 +41,7 @@
setSuffix(unitGetSuffixFromIndex(m_unitIndex));
setDecimals(unitGetPrecisionFromIndex(m_unitIndex));
setSingleStep(1.0);
- lineEdit()->setValidator(0);
+ lineEdit()->setValidator(nullptr);
disconnect(this, SIGNAL(valueChanged(const QString &)), this, SLOT(textChanged()));
connect(this, SIGNAL(valueChanged(const QString &)), this, SLOT(textChanged()));
installEventFilter(this);
@@ -278,16 +278,10 @@
QValidator::State ScrSpinBox::validate ( QString & input, int & pos ) const
{
+// qDebug() << "spinbox validate intermediate:" << input;
if (input.endsWith(FinishTag))
- {
-// qDebug() << "spinbox validate acceptable:" << input;
return QValidator::Acceptable;
- }
- else
- {
-// qDebug() << "spinbox validate intermediate:" << input;
- return QValidator::Intermediate;
- }
+ return QValidator::Intermediate;
}
void ScrSpinBox::fixup ( QString & input ) const
Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22631&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp Tue Aug 14 19:56:39 2018
@@ -30,7 +30,7 @@
m_parentBul(false),
m_parentNum(false),
m_Doc(doc),
- m_currPStyle(0)
+ m_currPStyle(nullptr)
{
m_cstyles = cstyles;
More information about the scribus-commit
mailing list