r22607 by craig - clazy and clang fixes, part 7
scribus-commit
scribus-commit at lists.scribus.net
Sun Aug 5 10:59:42 UTC 2018
Author: craig
Date: Sun Aug 5 10:59:42 2018
New Revision: 22607
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22607
Log:
clazy and clang fixes, part 7
Modified:
trunk/Scribus/scribus/rawimage.cpp
trunk/Scribus/scribus/sampleitem.cpp
trunk/Scribus/scribus/sampleitem.h
trunk/Scribus/scribus/sccolorengine.cpp
trunk/Scribus/scribus/sccolorshade.cpp
trunk/Scribus/scribus/sccolorshade.h
trunk/Scribus/scribus/scdocoutput.cpp
trunk/Scribus/scribus/scdocoutput.h
trunk/Scribus/scribus/scdocoutput_ps2.cpp
trunk/Scribus/scribus/scdocoutput_ps2.h
trunk/Scribus/scribus/scdomelement.cpp
trunk/Scribus/scribus/scgtplugin.cpp
trunk/Scribus/scribus/scimagecachedir.cpp
trunk/Scribus/scribus/scimagecachedir.h
trunk/Scribus/scribus/scimagecachemanager.cpp
trunk/Scribus/scribus/scimagecacheproxy.cpp
trunk/Scribus/scribus/scmimedata.cpp
trunk/Scribus/scribus/scpageoutput.cpp
trunk/Scribus/scribus/scpainter.cpp
trunk/Scribus/scribus/scpainter.h
trunk/Scribus/scribus/scpainterexbase.cpp
trunk/Scribus/scribus/scpaths.cpp
trunk/Scribus/scribus/scpaths.h
trunk/Scribus/scribus/scplugin.cpp
trunk/Scribus/scribus/scpreview.cpp
trunk/Scribus/scribus/scpreview.h
trunk/Scribus/scribus/scribus.cpp
trunk/Scribus/scribus/scribus.h
trunk/Scribus/scribus/scribusXml.h
trunk/Scribus/scribus/scribusapp.cpp
trunk/Scribus/scribus/scribuscore.cpp
trunk/Scribus/scribus/scribuscore.h
trunk/Scribus/scribus/scribusstructs.h
trunk/Scribus/scribus/scribusview.cpp
trunk/Scribus/scribus/scribusview.h
trunk/Scribus/scribus/scstreamfilter_jpeg.cpp
trunk/Scribus/scribus/sctextstruct.cpp
trunk/Scribus/scribus/scxmlstreamreader.cpp
trunk/Scribus/scribus/scxmlstreamreader.h
trunk/Scribus/scribus/styleitem.cpp
trunk/Scribus/scribus/styles/cellstyle.cpp
trunk/Scribus/scribus/text/boxes.cpp
trunk/Scribus/scribus/text/frect.cpp
trunk/Scribus/scribus/text/glyphcluster.cpp
trunk/Scribus/scribus/text/glyphcluster.h
trunk/Scribus/scribus/text/index.cpp
trunk/Scribus/scribus/text/shapedtextfeed.cpp
trunk/Scribus/scribus/text/specialchars.cpp
trunk/Scribus/scribus/text/textlayout.cpp
trunk/Scribus/scribus/text/textshaper.cpp
Modified: trunk/Scribus/scribus/rawimage.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/rawimage.cpp
==============================================================================
--- trunk/Scribus/scribus/rawimage.cpp (original)
+++ trunk/Scribus/scribus/rawimage.cpp Sun Aug 5 10:59:42 2018
@@ -38,8 +38,7 @@
{
if (row < m_height)
return (uchar*)(data() + (row * m_channels * m_width));
- else
- return (uchar*)data();
+ return (uchar*)data();
}
void RawImage::setAlpha(int x, int y, int alpha)
Modified: trunk/Scribus/scribus/sampleitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/sampleitem.cpp
==============================================================================
--- trunk/Scribus/scribus/sampleitem.cpp (original)
+++ trunk/Scribus/scribus/sampleitem.cpp Sun Aug 5 10:59:42 2018
@@ -19,7 +19,7 @@
//Added by qt3to4:
#include <QPixmap>
-SampleItem::SampleItem() : QObject()
+SampleItem::SampleItem()
{
m_Doc = new ScribusDoc();
if (!m_Doc)
@@ -27,7 +27,7 @@
m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
m_Doc->setPage(1, 1, 0, 0, 0, 0, 0, 0, false, false);
m_Doc->addPage(0);
- m_Doc->setGUI(false, ScCore->primaryMainWindow(), 0);
+ m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
// tmp colors. to be removed in descrictor
m_Doc->PageColors.insert("__blackforpreview__", ScColor(0, 0, 0, 255));
m_Doc->PageColors.insert("__whiteforpreview__", ScColor(0, 0, 0, 0));
@@ -73,7 +73,7 @@
delete m_Doc;
}
-void SampleItem::setText(QString aText)
+void SampleItem::setText(const QString& aText)
{
m_text = aText;
}
@@ -92,7 +92,7 @@
m_tmpStyle = aStyle;
}
-void SampleItem::setBgColor(QColor c)
+void SampleItem::setBgColor(const QColor& c)
{
m_Doc->PageColors["__whiteforpreviewbg__"].fromQColor(c);
}
@@ -107,7 +107,7 @@
m_Doc->PageColors["__whiteforpreviewbg__"].setSpotColor(!enable);
}
-void SampleItem::setTxColor(QColor c)
+void SampleItem::setTxColor(const QColor& c)
{
m_Doc->PageColors["__blackforpreview__"].fromQColor(c);
}
@@ -152,7 +152,7 @@
m_tmpStyle.setGapAfter(gapAfter);
}
-void SampleItem::setFont(QString font)
+void SampleItem::setFont(const QString& font)
{
m_tmpStyle.charStyle().setFont(PrefsManager::instance()->appPrefs.fontPrefs.AvailFonts[font]);
}
@@ -199,7 +199,7 @@
m_tmpStyle.charStyle().setFeatures(static_cast<StyleFlag>(fontEffect).featureList());
}
-void SampleItem::setFColor(QString fColor)
+void SampleItem::setFColor(const QString& fColor)
{
m_tmpStyle.charStyle().setFillColor(fColor);
}
@@ -209,7 +209,7 @@
m_tmpStyle.charStyle().setFillShade(fShade);
}
-void SampleItem::setSColor(QString sColor)
+void SampleItem::setSColor(const QString& sColor)
{
m_tmpStyle.charStyle().setStrokeColor(sColor);
}
Modified: trunk/Scribus/scribus/sampleitem.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/sampleitem.h
==============================================================================
--- trunk/Scribus/scribus/sampleitem.h (original)
+++ trunk/Scribus/scribus/sampleitem.h Sun Aug 5 10:59:42 2018
@@ -32,20 +32,20 @@
/*! \brief Set sample text.
\param aText QString to set. */
- void setText(QString aText);
+ void setText(const QString& aText);
/*! \brief Use lorem ipsum generator as text source.
\param para count of the LI paragraphs */
void setLoremIpsum(int para);
/*! \brief Set backgroud color of the pixmap.
\param c a QColor */
- void setBgColor(QColor c);
+ void setBgColor(const QColor& c);
void setBgShade(int c);
/*! \brief Set color management for backgroud color of the pixmap.
\param enable if color management should be enabled */
void setBgColorMgmt(bool enable);
/*! \brief Set Text color of the pixmap.
\param c a QColor */
- void setTxColor(QColor c);
+ void setTxColor(const QColor& c);
void setTxShade(int c);
/*! \brief Set whole Scribus paragraph style in one.
@@ -60,7 +60,7 @@
void setFirst(double first);
void setGapBefore(double gapBefore);
void setGapAfter(double gapAfter);
- void setFont(QString font);
+ void setFont(const QString& font);
/*! \brief Set size of the font.
\param fontSize fontSize * 10.0 usually
\param autoLineSpa if true - use automatic line spacing computing */
@@ -72,9 +72,9 @@
void setDropLin(int dropLin);
void setParEffectDist(double dropDist);
void setFontEffect(int fontEffect);
- void setFColor(QString fColor);
+ void setFColor(const QString& fColor);
void setFShade(int fShade);
- void setSColor(QString sColor);
+ void setSColor(const QString& sColor);
void setSShade(int sShade);
void setBaseAdj(bool baseAdj);
void setTxtShadowX(int txtShadowX);
Modified: trunk/Scribus/scribus/sccolorengine.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/sccolorengine.cpp
==============================================================================
--- trunk/Scribus/scribus/sccolorengine.cpp (original)
+++ trunk/Scribus/scribus/sccolorengine.cpp Sun Aug 5 10:59:42 2018
@@ -494,8 +494,7 @@
}
}
-void ScColorEngine::getShadeColorCMYK(const ScColor& color, const ScribusDoc* doc,
- CMYKColorF& cmyk, double level)
+void ScColorEngine::getShadeColorCMYK(const ScColor& color, const ScribusDoc* doc, CMYKColorF& cmyk, double level)
{
if (color.getColorModel() == colorModelRGB)
{
Modified: trunk/Scribus/scribus/sccolorshade.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/sccolorshade.cpp
==============================================================================
--- trunk/Scribus/scribus/sccolorshade.cpp (original)
+++ trunk/Scribus/scribus/sccolorshade.cpp Sun Aug 5 10:59:42 2018
@@ -24,7 +24,7 @@
#include "sccolorshade.h"
#include "sccolorengine.h"
-ScColorShade::ScColorShade(void)
+ScColorShade::ScColorShade()
{
color.setColor( 0, 0, 0, 0 );
shade = 100;
@@ -42,19 +42,19 @@
shade = level;
}
-ScColor ScColorShade::getShadedColor(void)
+ScColor ScColorShade::getShadedColor()
{
ScColor value;
if (color.getColorModel() == colorModelRGB)
{
RGBColorF rgb;
- ScColorEngine::getShadeColorRGB(color, NULL, rgb, shade);
+ ScColorEngine::getShadeColorRGB(color, nullptr, rgb, shade);
value.setRgbColorF(rgb.r, rgb.g, rgb.b);
}
else if (color.getColorModel() == colorModelCMYK)
{
CMYKColorF cmyk;
- ScColorEngine::getShadeColorCMYK(color, NULL, cmyk, shade);
+ ScColorEngine::getShadeColorCMYK(color, nullptr, cmyk, shade);
value.setColorF(cmyk.c, cmyk.m, cmyk.y, cmyk.k);
}
else if (color.getColorModel() == colorModelLab)
Modified: trunk/Scribus/scribus/sccolorshade.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/sccolorshade.h
==============================================================================
--- trunk/Scribus/scribus/sccolorshade.h (original)
+++ trunk/Scribus/scribus/sccolorshade.h Sun Aug 5 10:59:42 2018
@@ -30,11 +30,11 @@
{
public:
- ScColorShade( void );
- ScColorShade( const QColor& c, int level );
- ScColorShade( const ScColor& c, int level );
+ ScColorShade();
+ ScColorShade(const QColor& c, int level);
+ ScColorShade(const ScColor& c, int level);
- ScColor getShadedColor(void);
+ ScColor getShadedColor();
ScColor color;
int shade;
Modified: trunk/Scribus/scribus/scdocoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scdocoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.cpp (original)
+++ trunk/Scribus/scribus/scdocoutput.cpp Sun Aug 5 10:59:42 2018
@@ -17,7 +17,7 @@
bool done = true;
ScPage* page;
- for (uint index = 0; index < pageNumbers.size(); index++)
+ for (int index = 0; index < pageNumbers.size(); index++)
{
page = doc->Pages->at( pageNumbers[index] - 1 );
ScPageOutput* outputComponent = createPageOutputComponent(index + 1);
Modified: trunk/Scribus/scribus/scdocoutput.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scdocoutput.h
==============================================================================
--- trunk/Scribus/scribus/scdocoutput.h (original)
+++ trunk/Scribus/scribus/scdocoutput.h Sun Aug 5 10:59:42 2018
@@ -23,7 +23,7 @@
virtual bool begin(void) { return true; }
virtual void end(void) {}
- virtual ScPageOutput* createPageOutputComponent(int pageIndex) { return NULL; }
+ virtual ScPageOutput* createPageOutputComponent(int pageIndex) { return nullptr; }
public:
virtual ~ScDocOutput() {}
Modified: trunk/Scribus/scribus/scdocoutput_ps2.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scdocoutput_ps2.cpp
==============================================================================
--- trunk/Scribus/scribus/scdocoutput_ps2.cpp (original)
+++ trunk/Scribus/scribus/scdocoutput_ps2.cpp Sun Aug 5 10:59:42 2018
@@ -35,7 +35,7 @@
m_file.close();
}
-bool ScDocOutput_Ps2::begin(void)
+bool ScDocOutput_Ps2::begin()
{
if (!m_file.open(QIODevice::WriteOnly))
{
@@ -68,7 +68,7 @@
return true;
}
-void ScDocOutput_Ps2::end(void)
+void ScDocOutput_Ps2::end()
{
m_stream << "%%Trailer\n";
m_stream << "end\n";
@@ -76,7 +76,7 @@
m_file.close();
}
-bool ScDocOutput_Ps2::initializeCmsTransforms(void)
+bool ScDocOutput_Ps2::initializeCmsTransforms()
{
bool success = false;
if (!m_options.outputProfile.isEmpty() && QFile::exists(m_options.outputProfile))
Modified: trunk/Scribus/scribus/scdocoutput_ps2.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scdocoutput_ps2.h
==============================================================================
--- trunk/Scribus/scribus/scdocoutput_ps2.h (original)
+++ trunk/Scribus/scribus/scdocoutput_ps2.h Sun Aug 5 10:59:42 2018
@@ -40,12 +40,12 @@
QRect m_clip;
- virtual bool begin(void);
- virtual void end(void);
+ virtual bool begin();
+ virtual void end();
virtual ScPageOutput* createPageOutputComponent(int pageIndex);
- bool initializeCmsTransforms(void);
+ bool initializeCmsTransforms();
public:
ScDocOutput_Ps2(ScribusDoc* doc, QString fileName, std::vector<int>& pageNumbers, QRect& clip, ScPs2OutputParams& options);
Modified: trunk/Scribus/scribus/scdomelement.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scdomelement.cpp
==============================================================================
--- trunk/Scribus/scribus/scdomelement.cpp (original)
+++ trunk/Scribus/scribus/scdomelement.cpp Sun Aug 5 10:59:42 2018
@@ -8,7 +8,7 @@
#include "scclocale.h"
#include "scdomelement.h"
-ScDomElement::ScDomElement() : QDomElement()
+ScDomElement::ScDomElement()
{
}
Modified: trunk/Scribus/scribus/scgtplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scgtplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/scgtplugin.cpp (original)
+++ trunk/Scribus/scribus/scgtplugin.cpp Sun Aug 5 10:59:42 2018
@@ -20,7 +20,7 @@
/***************************************************************************************/
/***************************************************************************************/
-ScGTPluginManager* ScGTPluginManager::instance_ = 0; // init static variables
+ScGTPluginManager* ScGTPluginManager::instance_ = nullptr; // init static variables
ScGTPluginManager::ScGTPluginManager()
{
@@ -37,7 +37,7 @@
void ScGTPluginManager::deleteInstance()
{
delete instance_;
- instance_ = 0;
+ instance_ = nullptr;
}
void ScGTPluginManager::registerGTPlugin(ScGTPlugin *plugin)
@@ -54,7 +54,7 @@
void ScGTPluginManager::run()
{
// TODO prefs
- ScGTFileDialog *dia = new ScGTFileDialog(".", fileFilter(), 0, "dia");
+ ScGTFileDialog *dia = new ScGTFileDialog(".", fileFilter(), nullptr, "dia");
if (dia->exec())
{
Modified: trunk/Scribus/scribus/scimagecachedir.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scimagecachedir.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecachedir.cpp (original)
+++ trunk/Scribus/scribus/scimagecachedir.cpp Sun Aug 5 10:59:42 2018
@@ -40,7 +40,7 @@
const QString ScImageCacheDir::accessFileName("access");
ScImageCacheDir::ScImageCacheDir(const QString & dir, ScImageCacheDir *parent, bool scanFiles, const QStringList & suffixList)
- : m_name(dir), m_suffix(suffixList), m_parent(parent), m_exists(false), m_lastAccessValid(false), m_dirs(0), m_files(0)
+ : m_name(dir), m_suffix(suffixList), m_parent(parent), m_exists(false), m_lastAccessValid(false), m_dirs(nullptr), m_files(nullptr)
{
while (m_name.endsWith('/'))
m_name.chop(1);
@@ -182,7 +182,7 @@
// newly created file
ScImageCacheFile *p = new ScImageCacheFile(info.fileName(), this);
Q_CHECK_PTR(p);
- if (p == 0)
+ if (p == nullptr)
return;
emit fileCreated(p, info);
m_files->insert(info.fileName(), p);
@@ -263,7 +263,7 @@
// create
ScImageCacheFile *p = new ScImageCacheFile(file, this);
Q_CHECK_PTR(p);
- if (p == 0)
+ if (p == nullptr)
return false;
emit fileCreated(p, info);
m_files->insert(file, p);
Modified: trunk/Scribus/scribus/scimagecachedir.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scimagecachedir.h
==============================================================================
--- trunk/Scribus/scribus/scimagecachedir.h (original)
+++ trunk/Scribus/scribus/scimagecachedir.h Sun Aug 5 10:59:42 2018
@@ -42,7 +42,7 @@
public:
typedef unsigned int AccessCounter;
- ScImageCacheDir(const QString & dir, ScImageCacheDir *parent = 0, bool scanFiles = false, const QStringList & suffixList = QStringList());
+ ScImageCacheDir(const QString& dir, ScImageCacheDir *parent = 0, bool scanFiles = false, const QStringList & suffixList = QStringList());
~ScImageCacheDir();
ScImageCacheDir *newSubDir(const QString & dir, bool scanFiles = false, const QStringList & suffixList = QStringList());
const QString & name() const { return m_name; }
Modified: trunk/Scribus/scribus/scimagecachemanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scimagecachemanager.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecachemanager.cpp (original)
+++ trunk/Scribus/scribus/scimagecachemanager.cpp Sun Aug 5 10:59:42 2018
@@ -349,15 +349,14 @@
ScImageCacheManager::ScImageCacheManager()
: m_isEnabled(false), m_haveMasterLock(false), m_inCleanup(false), m_writeLockCount(0),
m_compressionLevel(-1), m_maxEntries(0), m_maxSizeMiB(0), m_maxTotalSize(0),
- m_totalCacheSize(0), m_writeLockFile(0), m_root(0)
+ m_totalCacheSize(0), m_writeLockFile(nullptr), m_root(nullptr)
{
}
ScImageCacheManager::~ScImageCacheManager()
{
// no tryCleanup here, I guess we rather want Scribus to exit fast
- if (m_root)
- delete m_root;
+ delete m_root;
}
QString ScImageCacheManager::absolutePath(const QString & fn)
@@ -698,7 +697,7 @@
if (!d1)
{
delete m_root;
- m_root = 0;
+ m_root = nullptr;
return;
}
@@ -709,7 +708,7 @@
if (!d2)
{
delete m_root;
- m_root = 0;
+ m_root = nullptr;
return;
}
@@ -808,7 +807,7 @@
{
ScImageCacheFile *file;
- while ((file = m_metaAge.getOldest()) != 0)
+ while ((file = m_metaAge.getOldest()) != nullptr)
{
QFileInfo info(file->path());
if (!info.exists())
@@ -953,7 +952,7 @@
{
if (!m_haveMasterLock && m_writeLockCount == 0)
{
- Q_ASSERT(m_writeLockFile == 0);
+ Q_ASSERT(m_writeLockFile == nullptr);
if (!createLockDir())
{
scDebug() << "failed to create lock directory";
@@ -973,14 +972,14 @@
{
scDebug() << "failed to create write lock file";
delete m_writeLockFile;
- m_writeLockFile = 0;
+ m_writeLockFile = nullptr;
return false;
}
if (master.exists())
{
scDebug() << "master lock active";
delete m_writeLockFile;
- m_writeLockFile = 0;
+ m_writeLockFile = nullptr;
return false;
}
}
@@ -992,17 +991,17 @@
{
if (m_writeLockCount == 0)
{
- Q_ASSERT(m_writeLockFile == 0);
+ Q_ASSERT(m_writeLockFile == nullptr);
return false;
}
m_writeLockCount--;
if (!m_haveMasterLock)
{
- Q_ASSERT(m_writeLockFile != 0);
+ Q_ASSERT(m_writeLockFile != nullptr);
if (m_writeLockCount == 0)
{
delete m_writeLockFile;
- m_writeLockFile = 0;
+ m_writeLockFile = nullptr;
}
}
return true;
Modified: trunk/Scribus/scribus/scimagecacheproxy.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scimagecacheproxy.cpp
==============================================================================
--- trunk/Scribus/scribus/scimagecacheproxy.cpp (original)
+++ trunk/Scribus/scribus/scimagecacheproxy.cpp Sun Aug 5 10:59:42 2018
@@ -123,7 +123,7 @@
QString ScImageCacheProxy::getBaseName(const QString & metafile)
{
QString base;
- return loadMetadata(metafile, 0, 0, 0, &base) ? base : QString();
+ return loadMetadata(metafile, nullptr, nullptr, nullptr, &base) ? base : QString();
}
bool ScImageCacheProxy::loadMetadata(ScLockedFile *file, MetaMap *meta, MetaMap *mod, MetaMap *info, QString *base)
@@ -259,7 +259,7 @@
return false;
}
- if (!loadMetadata(&cmeta, &cmod, 0, &base))
+ if (!loadMetadata(&cmeta, &cmod, nullptr, &base))
{
scDebug() << "cannot use cached image, load metadata failed";
return false;
@@ -460,7 +460,7 @@
if (meta.exists())
{
- if (!loadMetadata(0, 0, 0, &oldBase))
+ if (!loadMetadata(nullptr, nullptr, nullptr, &oldBase))
{
scDebug() << "could not read metadata from" << meta.name();
return false;
Modified: trunk/Scribus/scribus/scmimedata.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scmimedata.cpp
==============================================================================
--- trunk/Scribus/scribus/scmimedata.cpp (original)
+++ trunk/Scribus/scribus/scmimedata.cpp Sun Aug 5 10:59:42 2018
@@ -139,7 +139,7 @@
return data;
}
-ScElemMimeData::ScElemMimeData() : QMimeData()
+ScElemMimeData::ScElemMimeData()
{
m_formats << "application/x-scribus-elem" << "text/plain";
}
Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Sun Aug 5 10:59:42 2018
@@ -38,7 +38,7 @@
#include "text/boxes.h"
-MarksOptions::MarksOptions(void)
+MarksOptions::MarksOptions()
{
markLength = 20.0;
markOffset = 0.0;
@@ -596,7 +596,7 @@
QPointF ipc = invMat.map(pc), ipd = invMat.map(pd);
painter->save();
- if (item->imageClip.size() != 0)
+ if (!item->imageClip.empty())
{
painter->setupPolygon(&item->imageClip);
painter->setClipPath();
@@ -795,7 +795,7 @@
pImage = &item->pixm;
painter->save();
- if (item->imageClip.size() != 0)
+ if (!item->imageClip.empty())
{
painter->setupPolygon(&item->imageClip);
painter->setClipPath();
Modified: trunk/Scribus/scribus/scpainter.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpainter.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainter.cpp (original)
+++ trunk/Scribus/scribus/scpainter.cpp Sun Aug 5 10:59:42 2018
@@ -158,7 +158,7 @@
if (la.pushed)
{
cairo_pop_group_to_source (m_cr);
- if (la.groupClip.size() != 0)
+ if (!la.groupClip.empty())
{
if( m_fillRule )
cairo_set_fill_rule (m_cr, CAIRO_FILL_RULE_EVEN_ODD);
@@ -284,7 +284,7 @@
cairo_line_to( m_cr, x, y);
}
-void ScPainter::curveTo( FPoint p1, FPoint p2, FPoint p3 )
+void ScPainter::curveTo(const FPoint& p1, const FPoint& p2, const FPoint& p3 )
{
cairo_curve_to(m_cr, p1.x(), p1.y(), p2.x(), p2.y(), p3.x(), p3.y());
}
Modified: trunk/Scribus/scribus/scpainter.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpainter.h
==============================================================================
--- trunk/Scribus/scribus/scpainter.h (original)
+++ trunk/Scribus/scribus/scpainter.h Sun Aug 5 10:59:42 2018
@@ -59,7 +59,7 @@
// drawing
virtual void moveTo( const double &, const double & );
virtual void lineTo( const double &, const double & );
- virtual void curveTo( FPoint p1, FPoint p2, FPoint p3 );
+ virtual void curveTo(const FPoint& p1, const FPoint& p2, const FPoint& p3 );
virtual void newPath();
virtual void closePath();
virtual void fillPath();
Modified: trunk/Scribus/scribus/scpainterexbase.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpainterexbase.cpp
==============================================================================
--- trunk/Scribus/scribus/scpainterexbase.cpp (original)
+++ trunk/Scribus/scribus/scpainterexbase.cpp Sun Aug 5 10:59:42 2018
@@ -27,9 +27,9 @@
#include "scpainterexbase.h"
-ScPainterExBase::ScPainterExBase(void)
+ScPainterExBase::ScPainterExBase()
{
m_capabilities = 0;
- m_pattern = 0;
- m_maskPattern = 0;
+ m_pattern = nullptr;
+ m_maskPattern = nullptr;
}
Modified: trunk/Scribus/scribus/scpaths.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpaths.cpp
==============================================================================
--- trunk/Scribus/scribus/scpaths.cpp (original)
+++ trunk/Scribus/scribus/scpaths.cpp Sun Aug 5 10:59:42 2018
@@ -48,8 +48,7 @@
// Singleton's public destructor
void ScPaths::destroy()
{
- if (ScPaths::m_instance)
- delete ScPaths::m_instance;
+ delete ScPaths::m_instance;
}
// Protected "real" constructor
@@ -444,7 +443,7 @@
return iccProfDirs;
}
-QStringList ScPaths::dirsFromEnvVar(const QString envVar, const QString dirToFind)
+QStringList ScPaths::dirsFromEnvVar(const QString& envVar, const QString& dirToFind)
{
QChar sep(':');
#ifdef _WIN32
Modified: trunk/Scribus/scribus/scpaths.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpaths.h
==============================================================================
--- trunk/Scribus/scribus/scpaths.h (original)
+++ trunk/Scribus/scribus/scpaths.h Sun Aug 5 10:59:42 2018
@@ -68,7 +68,7 @@
/** @brief Return paths to system create project directories*/
static QStringList systemCreatePalettesDirs();
/** @brief Return paths to directories held in an environment variable*/
- static QStringList dirsFromEnvVar(const QString envVar, const QString dirToFind);
+ static QStringList dirsFromEnvVar(const QString& envVar, const QString& dirToFind);
/** @brief Return path to application prefs dir*/
static QString preferencesDir(bool createIfNotExists = false);
/** @brief Return path to application data dir*/
Modified: trunk/Scribus/scribus/scplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/scplugin.cpp (original)
+++ trunk/Scribus/scribus/scplugin.cpp Sun Aug 5 10:59:42 2018
@@ -64,15 +64,12 @@
// ie most specific to least specific.
if (inherits("LoadSavePlugin"))
return tr("Load/Save/Import/Export");
- else if (inherits("ScPersistentPlugin"))
+ if (inherits("ScPersistentPlugin"))
return tr("Persistent", "plugin manager plugin type");
- else if (inherits("ScActionPlugin"))
+ if (inherits("ScActionPlugin"))
return tr("Action", "plugin manager plugin type");
- else
- {
- qDebug("Unknown plugin type: %s", metaObject()->className());
- return tr("Unknown");
- }
+ qDebug("Unknown plugin type: %s", metaObject()->className());
+ return tr("Unknown");
}
void ScPlugin::setDoc(ScribusDoc* )
@@ -174,57 +171,52 @@
{
if (ai.needsNumObjects == -1)
return true;
+
+
+ if (ai.needsNumObjects > 2)
+ {
+ bool setter = true;
+ for (int bx = 0; bx < docSelectionCount; ++bx)
+ {
+ if (ai.notSuitableFor.contains(doc->m_Selection->itemAt(bx)->itemType()))
+ setter = false;
+ }
+ return setter;
+ }
+
+
+ if (docSelectionCount == ai.needsNumObjects)
+ {
+ if (ai.needsNumObjects == 2)
+ {
+ int sel1 = doc->m_Selection->itemAt(0)->itemType();
+ int sel2 = doc->m_Selection->itemAt(1)->itemType();
+ if (ai.notSuitableFor.contains(sel1))
+ return false;
+ if (ai.notSuitableFor.contains(sel2))
+ return false;
+ if ((ai.firstObjectType.count() == 0) && (ai.secondObjectType.count() == 0))
+ return true;
+ if ((ai.firstObjectType.count() == 0) && (ai.secondObjectType.count() != 0))
+ {
+ if ((ai.secondObjectType.contains(sel2)) || (ai.secondObjectType.contains(sel1)))
+ return true;
+ }
+ else if ((ai.firstObjectType.count() != 0) && (ai.secondObjectType.count() == 0))
+ {
+ if ((ai.firstObjectType.contains(sel2)) || (ai.firstObjectType.contains(sel1)))
+ return true;
+ }
+ if (((ai.firstObjectType.contains(sel1)) && (ai.secondObjectType.contains(sel2))) || ((ai.firstObjectType.contains(sel2)) && (ai.secondObjectType.contains(sel1))))
+ return true;
+ }
+ else if (!ai.notSuitableFor.contains(SelectedType))
+ return true;
+ else
+ return false;
+ }
else
- {
- if (ai.needsNumObjects > 2)
- {
- bool setter = true;
- for (int bx = 0; bx < docSelectionCount; ++bx)
- {
- if (ai.notSuitableFor.contains(doc->m_Selection->itemAt(bx)->itemType()))
- setter = false;
- }
- return setter;
- }
- else
- {
- if (docSelectionCount == ai.needsNumObjects)
- {
- if (ai.needsNumObjects == 2)
- {
- int sel1 = doc->m_Selection->itemAt(0)->itemType();
- int sel2 = doc->m_Selection->itemAt(1)->itemType();
- if (ai.notSuitableFor.contains(sel1))
- return false;
- else if (ai.notSuitableFor.contains(sel2))
- return false;
- else
- {
- if ((ai.firstObjectType.count() == 0) && (ai.secondObjectType.count() == 0))
- return true;
- else if ((ai.firstObjectType.count() == 0) && (ai.secondObjectType.count() != 0))
- {
- if ((ai.secondObjectType.contains(sel2)) || (ai.secondObjectType.contains(sel1)))
- return true;
- }
- else if ((ai.firstObjectType.count() != 0) && (ai.secondObjectType.count() == 0))
- {
- if ((ai.firstObjectType.contains(sel2)) || (ai.firstObjectType.contains(sel1)))
- return true;
- }
- if (((ai.firstObjectType.contains(sel1)) && (ai.secondObjectType.contains(sel2))) || ((ai.firstObjectType.contains(sel2)) && (ai.secondObjectType.contains(sel1))))
- return true;
- }
- }
- else if (!ai.notSuitableFor.contains(SelectedType))
- return true;
- else
- return false;
- }
- else
- return false;
- }
- }
+ return false;
}
else
return false;
@@ -240,13 +232,10 @@
{
if (ai.needsNumObjects == -1)
return true;
- else if ((ai.needsNumObjects > 2) && (docSelectionCount > 0))
+ if ((ai.needsNumObjects > 2) && (docSelectionCount > 0))
return true;
- else
- return false;
+ return false;
}
- else
- return false;
}
return false;
}
Modified: trunk/Scribus/scribus/scpreview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpreview.cpp
==============================================================================
--- trunk/Scribus/scribus/scpreview.cpp (original)
+++ trunk/Scribus/scribus/scpreview.cpp Sun Aug 5 10:59:42 2018
@@ -20,7 +20,7 @@
{
}
-QImage ScPreview::createPreview(QString data)
+QImage ScPreview::createPreview(const QString& data)
{
PrefsManager *prefsManager = PrefsManager::instance();
double gx, gy, gw, gh;
@@ -40,55 +40,43 @@
tmp.loadFromData(inlineImageData);
return tmp;
}
- else
+
+ ScribusDoc *m_Doc = new ScribusDoc();
+ m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
+ m_Doc->setPage(gw, gh, 0, 0, 0, 0, 0, 0, false, false);
+ m_Doc->addPage(0);
+ m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
+ m_Doc->setLoading(true);
+ m_Doc->DoDrawing = false;
+ if(ss.ReadElem(data, prefsManager->appPrefs.fontPrefs.AvailFonts, m_Doc, 0, 0, false, true, prefsManager->appPrefs.fontPrefs.GFontSub))
{
- ScribusDoc *m_Doc = new ScribusDoc();
- m_Doc->setup(0, 1, 1, 1, 1, "Custom", "Custom");
- m_Doc->setPage(gw, gh, 0, 0, 0, 0, 0, 0, false, false);
- m_Doc->addPage(0);
- m_Doc->setGUI(false, ScCore->primaryMainWindow(), 0);
- m_Doc->setLoading(true);
- m_Doc->DoDrawing = false;
- if(ss.ReadElem(data, prefsManager->appPrefs.fontPrefs.AvailFonts, m_Doc, 0, 0, false, true, prefsManager->appPrefs.fontPrefs.GFontSub))
+ QList<PageItem*> Elements = *m_Doc->Items;
+ Selection *tmpSel = new Selection(m_Doc, false);
+ if (Elements.count() > 0)
{
- QList<PageItem*> Elements = *m_Doc->Items;
- Selection *tmpSel = new Selection(m_Doc, false);
- if (Elements.count() > 0)
+ if (Elements.count() > 1)
+ m_Doc->groupObjectsList(Elements);
+ m_Doc->DoDrawing = true;
+ m_Doc->m_Selection->delaySignalsOn();
+ for (int dre=0; dre<Elements.count(); ++dre)
{
- if (Elements.count() > 1)
- m_Doc->groupObjectsList(Elements);
- m_Doc->DoDrawing = true;
- m_Doc->m_Selection->delaySignalsOn();
- for (int dre=0; dre<Elements.count(); ++dre)
- {
- tmpSel->addItem(Elements.at(dre), true);
- }
- tmpSel->setGroupRect();
- double xs = tmpSel->width();
- double ys = tmpSel->height();
+ tmpSel->addItem(Elements.at(dre), true);
+ }
+ tmpSel->setGroupRect();
+ double xs = tmpSel->width();
+ double ys = tmpSel->height();
// double sc = 60.0 / qMax(xs, ys);
// m_Doc->scaleGroup(sc, sc, true, tmpSel);
- QImage tmpImage = Elements.at(0)->DrawObj_toImage(128);
- tmpImage.setText("XSize", QString("%1").arg(xs));
- tmpImage.setText("YSize", QString("%1").arg(ys));
- m_Doc->m_Selection->delaySignalsOff();
- delete tmpSel;
- delete m_Doc;
- return tmpImage;
- }
- else
- {
- delete m_Doc;
- return QImage();
- }
- }
- else
- {
+ QImage tmpImage = Elements.at(0)->DrawObj_toImage(128);
+ tmpImage.setText("XSize", QString("%1").arg(xs));
+ tmpImage.setText("YSize", QString("%1").arg(ys));
+ m_Doc->m_Selection->delaySignalsOff();
+ delete tmpSel;
delete m_Doc;
- return QImage();
+ return tmpImage;
}
}
+ delete m_Doc;
}
- else
- return QImage();
+ return QImage();
}
Modified: trunk/Scribus/scribus/scpreview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scpreview.h
==============================================================================
--- trunk/Scribus/scribus/scpreview.h (original)
+++ trunk/Scribus/scribus/scpreview.h Sun Aug 5 10:59:42 2018
@@ -18,7 +18,7 @@
public:
ScPreview();
~ScPreview() {};
- QImage createPreview(QString data);
+ QImage createPreview(const QString& data);
};
#endif
Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Sun Aug 5 10:59:42 2018
@@ -390,7 +390,7 @@
initKeyboardShortcuts();
resize(610, 600);
- connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow *)));
+ connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
//Connect windows cascade and tile actions to the workspace after its created. Only depends on mdiArea created.
connect( scrActions["windowsCascade"], SIGNAL(triggered()) , mdiArea, SLOT(cascadeSubWindows()) );
connect( scrActions["windowsTile"], SIGNAL(triggered()) , mdiArea, SLOT(tileSubWindows()) );
@@ -463,14 +463,10 @@
ScribusMainWindow::~ScribusMainWindow()
{
- if (actionManager)
- delete actionManager;
- if (appModeHelper)
- delete appModeHelper;
- if (m_doc)
- delete m_doc;
- if (m_tocGenerator)
- delete m_tocGenerator;
+ delete actionManager;
+ delete appModeHelper;
+ delete m_doc;
+ delete m_tocGenerator;
}
void ScribusMainWindow::addScToolBar(ScToolBar *tb, QString name)
@@ -606,19 +602,19 @@
// these must be filtered too as they take control of the palettes events
outlinePalette = new OutlinePalette(this);
outlinePalette->setMainWindow(this);
- connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)) );
+ connect( scrActions["toolsOutline"], SIGNAL(toggled(bool)) , outlinePalette, SLOT(setPaletteShown(bool)));
connect( outlinePalette, SIGNAL(paletteShown(bool)), scrActions["toolsOutline"], SLOT(setChecked(bool)));
propertiesPalette = new PropertiesPalette(this);
propertiesPalette->setMainWindow(this);
- connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)) );
+ connect( scrActions["toolsProperties"], SIGNAL(toggled(bool)) , propertiesPalette, SLOT(setPaletteShown(bool)));
connect( propertiesPalette, SIGNAL(paletteShown(bool)), scrActions["toolsProperties"], SLOT(setChecked(bool)));
emit UpdateRequest(reqDefFontListUpdate);
propertiesPalette->installEventFilter(this);
textPalette = new TextPalette(this);
textPalette->setMainWindow(this);
- connect( scrActions["toolsText"], SIGNAL(toggled(bool)) , textPalette, SLOT(setPaletteShown(bool)) );
+ connect( scrActions["toolsText"], SIGNAL(toggled(bool)) , textPalette, SLOT(setPaletteShown(bool)));
connect( textPalette, SIGNAL(paletteShown(bool)), scrActions["toolsText"], SLOT(setChecked(bool)));
emit UpdateRequest(reqDefFontListUpdate);
textPalette->installEventFilter(this);
@@ -627,12 +623,12 @@
layerPalette = new LayerPalette(this);
guidePalette = new GuideManager(this);
charPalette = new CharSelect(this);
- connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)) );
+ connect( scrActions["toolsLayers"], SIGNAL(toggled(bool)) , layerPalette, SLOT(setPaletteShown(bool)));
connect( layerPalette, SIGNAL(paletteShown(bool)), scrActions["toolsLayers"], SLOT(setChecked(bool)));
layerPalette->installEventFilter(this);
layerPalette->Table->installEventFilter(this);
scrapbookPalette = new Biblio(this);
- connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)) );
+ connect( scrActions["toolsScrapbook"], SIGNAL(toggled(bool)) , scrapbookPalette, SLOT(setPaletteShown(bool)));
connect( scrapbookPalette, SIGNAL(paletteShown(bool)), scrActions["toolsScrapbook"], SLOT(setChecked(bool)));
connect( scrapbookPalette, SIGNAL(pasteToActualPage(QString)), this, SLOT(pasteFromScrapbook(QString)));
connect( scrapbookPalette, SIGNAL(scrapbookListChanged()), this, SLOT(rebuildScrapbookMenu()));
@@ -649,7 +645,7 @@
connect( scrActions["toolsDownloads"], SIGNAL(toggled(bool)) , downloadsPalette, SLOT(setPaletteShown(bool)) );
connect( downloadsPalette, SIGNAL(paletteShown(bool)), scrActions["toolsDownloads"], SLOT(setChecked(bool)));
downloadsPalette->installEventFilter(this);
- connect( scrActions["toolsMeasurements"], SIGNAL(toggledData(bool, int)) , this, SLOT(setAppModeByToggle(bool, int)) );
+ connect( scrActions["toolsMeasurements"], SIGNAL(toggledData(bool,int)) , this, SLOT(setAppModeByToggle(bool,int)) );
docCheckerPalette = new CheckDocument(this, false);
connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , docCheckerPalette, SLOT(setPaletteShown(bool)) );
connect( scrActions["toolsPreflightVerifier"], SIGNAL(toggled(bool)) , this, SLOT(docCheckToggle(bool)) );
@@ -713,11 +709,11 @@
connect( nsEditor, SIGNAL(paletteShown(bool)), scrActions["editNotesStyles"], SLOT(setChecked(bool)));
nsEditor->installEventFilter(this);
- connect(docCheckerPalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
- connect(docCheckerPalette, SIGNAL(selectElement(PageItem *, bool, int)), this, SLOT(selectItemFromOutlines(PageItem *, bool, int)));
+ connect(docCheckerPalette, SIGNAL(selectElementByItem(PageItem*,bool)), this, SLOT(selectItemsFromOutlines(PageItem*,bool)));
+ connect(docCheckerPalette, SIGNAL(selectElement(PageItem*,bool,int)), this, SLOT(selectItemFromOutlines(PageItem*,bool,int)));
connect(docCheckerPalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
connect(docCheckerPalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
- connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem *, bool)));
+ connect(outlinePalette, SIGNAL(selectElementByItem(PageItem *, bool)), this, SLOT(selectItemsFromOutlines(PageItem*,bool)));
connect(outlinePalette, SIGNAL(editElementByItem(PageItem *)), this, SLOT(editItemsFromOutlines(PageItem *)));
connect(outlinePalette, SIGNAL(selectPage(int)), this, SLOT(selectPagesFromOutlines(int)));
connect(outlinePalette, SIGNAL(selectMasterPage(QString)), this, SLOT(editMasterPagesStart(QString)));
@@ -1960,7 +1956,7 @@
if (tw == ActWin)
{
ce->ignore();
- connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(newActWin(QMdiSubWindow *)));
+ connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
return;
}
}
@@ -2880,7 +2876,7 @@
Q_ASSERT(ixplug);
ScActionPlugin::ActionInfo ai(ixplug->actionInfo());
pluginAction = ScCore->primaryMainWindow()->scrActions[ai.name];
- if (pluginAction != 0)
+ if (pluginAction != nullptr)
pluginAction->setEnabled(ixplug->handleSelection(doc, SelectedType));
}
}
@@ -3055,7 +3051,7 @@
doPasteRecent(scrapbookPalette->tempBView->objectMap[fn].Data);
}
-void ScribusMainWindow::doPasteRecent(QString data)
+void ScribusMainWindow::doPasteRecent(const QString& data)
{
if (!HaveDoc)
return;
@@ -3143,7 +3139,7 @@
QString allFormats = tr("All Supported Formats")+" (";
int fmtCode = FORMATID_FIRSTUSER;
const FileFormat *fmt = LoadSavePlugin::getFormatById(fmtCode);
- while (fmt != 0)
+ while (fmt != nullptr)
{
if (fmt->load)
{
@@ -3303,7 +3299,7 @@
bool ret = false;
UndoTransaction activeTransaction;
if (UndoManager::undoEnabled())
- activeTransaction = m_undoManager->beginTransaction(Um::ImportPage, Um::IGroup, Um::ImportPage, 0, Um::ILock);
+ activeTransaction = m_undoManager->beginTransaction(Um::ImportPage, Um::IGroup, Um::ImportPage, nullptr, Um::ILock);
m_mainWindowStatusLabel->setText( tr("Importing Pages..."));
qApp->setOverrideCursor(QCursor(Qt::WaitCursor));
@@ -3398,7 +3394,7 @@
return ret;
}
-bool ScribusMainWindow::loadPage(QString fileName, int Nr, bool Mpa, const QString& renamedPageName)
+bool ScribusMainWindow::loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName)
{
bool ret = false;
if (!fileName.isEmpty())
@@ -3850,7 +3846,7 @@
connect(mdiArea, SIGNAL(subWindowActivated(QMdiSubWindow*)), this, SLOT(newActWin(QMdiSubWindow*)));
connect(ScCore->fileWatcher, SIGNAL(fileChanged(QString)), doc, SLOT(updatePict(QString)));
connect(ScCore->fileWatcher, SIGNAL(fileDeleted(QString)), doc, SLOT(removePict(QString)));
- connect(ScCore->fileWatcher, SIGNAL(dirChanged(QString)), doc, SLOT(updatePictDir(QString )));
+ connect(ScCore->fileWatcher, SIGNAL(dirChanged(QString)), doc, SLOT(updatePictDir(QString)));
connect(m_undoManager, SIGNAL(undoRedoBegin()), doc, SLOT(undoRedoBegin()));
connect(m_undoManager, SIGNAL(undoRedoDone()), doc, SLOT(undoRedoDone()));
connect(m_undoManager, SIGNAL(undoRedoDone()), view, SLOT(DrawNew()));
@@ -4314,7 +4310,7 @@
textPalette->unsetDoc();
inlinePalette->unsetDoc();
symbolPalette->unsetDoc();
- pagePalette->setView(0);
+ pagePalette->setView(nullptr);
pagePalette->Rebuild();
if (doc->appMode == modeEditClip)
view->requestMode(submodeEndNodeEdit);
@@ -4727,7 +4723,7 @@
if (!ScMimeData::clipboardHasScribusData() && (!internalCopy))
return;
if (UndoManager::undoEnabled())
- activeTransaction = m_undoManager->beginTransaction(doc->currentPage()->getUName(), 0, Um::Paste, "", Um::IPaste);
+ activeTransaction = m_undoManager->beginTransaction(doc->currentPage()->getUName(), nullptr, Um::Paste, "", Um::IPaste);
PageItem* selItem = doc->m_Selection->itemAt(0);
if (((doc->appMode == modeEdit) || (doc->appMode == modeEditTable)) && selItem && (selItem->isTextFrame() || selItem->isTable()))
{
@@ -5098,14 +5094,14 @@
currItem = currItem->asTable()->activeCell().textFrame();
PageItem *nextItem = currItem;
nextItem->itemText.selectAll();
- while (nextItem != 0)
- {
- if (nextItem->prevInChain() != 0)
+ while (nextItem != nullptr)
+ {
+ if (nextItem->prevInChain() != nullptr)
nextItem = nextItem->prevInChain();
else
break;
}
- while (nextItem != 0)
+ while (nextItem != nullptr)
{
nextItem->HasSel = true;
nextItem = nextItem->nextInChain();
Modified: trunk/Scribus/scribus/scribus.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribus.h
==============================================================================
--- trunk/Scribus/scribus/scribus.h (original)
+++ trunk/Scribus/scribus/scribus.h Sun Aug 5 10:59:42 2018
@@ -158,7 +158,7 @@
int ShowSubs();
void applyNewMaster(const QString& name);
void updateRecent(const QString& fn);
- void doPasteRecent(QString data);
+ void doPasteRecent(const QString& data);
bool getPDFDriver(const QString & filename, const QString & name, int components, const std::vector<int> & pageNumbers, const QMap<int, QImage> & thumbs, QString& error, bool* cancelled = nullptr);
bool DoSaveAsEps(QString fn, QString& error);
QString CFileDialog(QString workingDirectory = ".", QString dialogCaption = "", QString fileFilter = "", QString defNa = "",
@@ -320,7 +320,7 @@
bool slotFileNew();
void newFileFromTemplate();
bool slotPageImport();
- bool loadPage(QString fileName, int Nr, bool Mpa, const QString& renamedPageName=QString::null);
+ bool loadPage(const QString& fileName, int Nr, bool Mpa, const QString& renamedPageName=QString::null);
void GotoLa(int l);
void slotGetContent();
void slotGetContent2(); // kk2006
Modified: trunk/Scribus/scribus/scribusXml.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribusXml.h
==============================================================================
--- trunk/Scribus/scribus/scribusXml.h (original)
+++ trunk/Scribus/scribus/scribusXml.h Sun Aug 5 10:59:42 2018
@@ -47,9 +47,9 @@
\param file filename of file to test
\retval bool true = Scribus format file, false : not Scribus
*/
- bool ReadElemHeader(QString file, bool isFile, double *x, double *y, double *w, double *h);
- bool ReadElem(QString fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub);
- bool ReadElemToLayer(QString fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub, int toLayer);
+ bool ReadElemHeader(const QString& file, bool isFile, double *x, double *y, double *w, double *h);
+ bool ReadElem(const QString& fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub);
+ bool ReadElemToLayer(const QString& fileNameOrData, SCFonts &avail, ScribusDoc *doc, double xPos, double yPos, bool isDataFromFile, bool loc, QMap<QString,QString> &FontSub, int toLayer);
static QString WriteElem(ScribusDoc *doc, Selection *selection);
static ScElemMimeData* WriteToMimeData(ScribusDoc *doc, Selection *selection);
Modified: trunk/Scribus/scribus/scribusapp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribusapp.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusapp.cpp (original)
+++ trunk/Scribus/scribus/scribusapp.cpp Sun Aug 5 10:59:42 2018
@@ -116,10 +116,8 @@
ScribusQApp::~ScribusQApp()
{
- if (m_ScCore)
- delete m_ScCore;
- if (m_scDLMgr)
- delete m_scDLMgr;
+ delete m_ScCore;
+ delete m_scDLMgr;
PrefsManager::deleteInstance();
LocaleManager::deleteInstance();
LanguageManager::deleteInstance();
@@ -194,7 +192,7 @@
}
break;
}
- else if ((arg == ARG_LANG || arg == ARG_LANG_SHORT))
+ if ((arg == ARG_LANG || arg == ARG_LANG_SHORT))
{
if (++argi < argsc)
m_lang = args[argi];
@@ -371,8 +369,7 @@
* and delete if (true)
*/
// if (useGUI)
- if (true)
- retVal=ScCore->startGUI(m_showSplash, m_showFontInfo, m_showProfileInfo, m_lang);
+ retVal=ScCore->startGUI(m_showSplash, m_showFontInfo, m_showProfileInfo, m_lang);
// A hook for plugins and scripts to trigger on. Some plugins and scripts
// require the app to be fully set up (in particular, the main window to be
@@ -481,24 +478,24 @@
void ScribusQApp::installTranslators(const QStringList & langs)
{
- static QTranslator *transQt = 0;
- static QTranslator *trans = 0;
+ static QTranslator *transQt = nullptr;
+ static QTranslator *trans = nullptr;
if (transQt)
{
removeTranslator( transQt );
delete transQt;
- transQt=0;
+ transQt=nullptr;
}
if (trans)
{
removeTranslator( trans );
delete trans;
- trans=0;
- }
-
- transQt = new QTranslator(0);
- trans = new QTranslator(0);
+ trans=nullptr;
+ }
+
+ transQt = new QTranslator(nullptr);
+ trans = new QTranslator(nullptr);
QString path(ScPaths::instance().translationDir());
bool loadedQt = false;
@@ -512,20 +509,18 @@
m_GUILang=lang;
break;
}
- else
- {
- //CB: This might need adjusting for qm files distribution locations
- if (transQt->load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
- loadedQt = true;
- if (trans->load(QString("scribus." + lang), path))
- loadedScribus = true;
- if (!loadedScribus)
- {
- QString altLang(LanguageManager::instance()->getAlternativeAbbrevfromAbbrev(lang));
- if (!altLang.isEmpty())
- if (trans->load(QString("scribus." + altLang), path))
- loadedScribus = true;
- }
+
+ //CB: This might need adjusting for qm files distribution locations
+ if (transQt->load("qt_" + lang, QLibraryInfo::location(QLibraryInfo::TranslationsPath)))
+ loadedQt = true;
+ if (trans->load(QString("scribus." + lang), path))
+ loadedScribus = true;
+ if (!loadedScribus)
+ {
+ QString altLang(LanguageManager::instance()->getAlternativeAbbrevfromAbbrev(lang));
+ if (!altLang.isEmpty())
+ if (trans->load(QString("scribus." + altLang), path))
+ loadedScribus = true;
}
}
if (loadedQt)
@@ -572,7 +567,7 @@
/*! \brief Format an arguments line for printing
Helper procedure */
-static void printArgLine(QTextStream & ts, const char * smallArg, const char* fullArg, const QString desc)
+static void printArgLine(QTextStream & ts, const char * smallArg, const char* fullArg, const QString& desc)
{
ts << QString(" %1 %2 %3").arg(QString("%1,").arg(smallArg), -5).arg(fullArg, -32).arg(desc);
endl(ts);
Modified: trunk/Scribus/scribus/scribuscore.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribuscore.cpp
==============================================================================
--- trunk/Scribus/scribus/scribuscore.cpp (original)
+++ trunk/Scribus/scribus/scribuscore.cpp Sun Aug 5 10:59:42 2018
@@ -47,18 +47,18 @@
extern ScribusQApp* ScQApp;
-ScribusCore::ScribusCore() : QObject(), defaultEngine(colorMgmtEngineFactory.createDefaultEngine())
+ScribusCore::ScribusCore() : defaultEngine(colorMgmtEngineFactory.createDefaultEngine())
{
m_ScribusInitialized = false;
m_currScMW = 0;
- pluginManager = 0;
- fileWatcher = 0;
-
- m_SplashScreen = 0;
- m_iconManager = 0;
- m_undoManager = 0;
- m_prefsManager = 0;
+ pluginManager = nullptr;
+ fileWatcher = nullptr;
+
+ m_SplashScreen = nullptr;
+ m_iconManager = nullptr;
+ m_undoManager = nullptr;
+ m_prefsManager = nullptr;
m_UseGUI = false;
m_HaveCMS = false;
@@ -106,7 +106,7 @@
return ScQApp->currGUILanguage();
}
-int ScribusCore::startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage)
+int ScribusCore::startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage)
{
ScribusMainWindow* scribus = new ScribusMainWindow();
Q_CHECK_PTR(scribus);
@@ -159,8 +159,7 @@
return EXIT_SUCCESS;
}
-int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo,
- const QString newGuiLanguage)
+int ScribusCore::initScribusCore(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage)
{
CommonStrings::languageChange();
m_iconManager = IconManager::instance();
@@ -292,7 +291,7 @@
closeSplash();
QString mess = tr("There are no fonts found on your system.");
mess += "\n" + tr("Exiting now.");
- ScMessageBox::critical(0, tr("Fatal Error"), mess);
+ ScMessageBox::critical(nullptr, tr("Fatal Error"), mess);
}
else
setSplashStatus( tr("Font System Initialized") );
@@ -328,7 +327,7 @@
m_HaveCMS = false;
}
-void ScribusCore::getCMSProfilesDir(QString pfad, bool showInfo, bool recursive)
+void ScribusCore::getCMSProfilesDir(const QString& pfad, bool showInfo, bool recursive)
{
QString profileName;
QList<ScColorProfileInfo> profileInfos = defaultEngine.getAvailableProfileInfo(pfad, recursive);
@@ -412,7 +411,7 @@
}
}
-void ScribusCore::InitDefaultColorTransforms(void)
+void ScribusCore::InitDefaultColorTransforms()
{
QString defaultRGBString = "sRGB IEC61966-2.1";
QString defaultCMYKString = "Fogra27L CMYK Coated Press";
@@ -479,7 +478,7 @@
}
}
-void ScribusCore::ResetDefaultColorTransforms(void)
+void ScribusCore::ResetDefaultColorTransforms()
{
defaultRGBProfile = ScColorProfile();
defaultCMYKProfile = ScColorProfile();
@@ -547,10 +546,10 @@
ScribusMainWindow * ScribusCore::primaryMainWindow()
{
if (m_ScMWList.count() == 0 || m_currScMW > m_ScMWList.count())
- return 0;
+ return nullptr;
ScribusMainWindow* mw=m_ScMWList.at(m_currScMW);
if (!mw)
- return 0;
+ return nullptr;
return mw;
}
Modified: trunk/Scribus/scribus/scribuscore.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribuscore.h
==============================================================================
--- trunk/Scribus/scribus/scribuscore.h (original)
+++ trunk/Scribus/scribus/scribuscore.h Sun Aug 5 10:59:42 2018
@@ -76,7 +76,7 @@
void closeSplash();
void setSplashStatus(const QString&);
bool usingGUI() const;
- int startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString newGuiLanguage);
+ int startGUI(bool showSplash, bool showFontInfo, bool showProfileInfo, const QString& newGuiLanguage);
/**
* @brief Are we trying to adhere to Apple Mac HIG ?
* @retval bool true if we are on Qt/Mac
@@ -92,9 +92,9 @@
bool havePNGAlpha() const {return m_HavePngAlpha;}
bool haveTIFFSep() const {return m_HaveTiffSep;}
void getCMSProfiles(bool showInfo);
- void getCMSProfilesDir(QString pfad, bool showInfo, bool recursive);
- void InitDefaultColorTransforms(void);
- void ResetDefaultColorTransforms(void);
+ void getCMSProfilesDir(const QString& pfad, bool showInfo, bool recursive);
+ void InitDefaultColorTransforms();
+ void ResetDefaultColorTransforms();
bool fileWatcherActive() const;
void recheckGS();
Modified: trunk/Scribus/scribus/scribusstructs.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribusstructs.h
==============================================================================
--- trunk/Scribus/scribus/scribusstructs.h (original)
+++ trunk/Scribus/scribus/scribusstructs.h Sun Aug 5 10:59:42 2018
@@ -44,6 +44,7 @@
int r;
int g;
int b;
+ RGBColor() {r=g=b=0;}
void getValues(int& vr, int& vg, int& vb) { vr = r; vg = g; vb = b; }
};
@@ -52,6 +53,7 @@
double r;
double g;
double b;
+ RGBColorF() {r=g=b=0.0;}
void getValues(double& vr, double& vg, double& vb) { vr = r; vg = g; vb = b; }
};
@@ -61,7 +63,8 @@
int m;
int y;
int k;
- void getValues(int& vc, int& vm, int& vy, int& vk) { vc = c; vm = m; vy = y; vk = k; }
+ CMYKColor() {c=m=y=k=0;}
+ void getValues(int& vc, int& vm, int& vy, int& vk) { vc = c; vm = m; vy = y; vk = k; }
};
struct CMYKColorF
@@ -70,6 +73,7 @@
double m;
double y;
double k;
+ CMYKColorF() {c=m=y=k=0.0;}
void getValues(double& vc, double& vm, double& vy, double& vk) { vc = c; vm = m; vy = y; vk = k; }
};
Modified: trunk/Scribus/scribus/scribusview.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribusview.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusview.cpp (original)
+++ trunk/Scribus/scribus/scribusview.cpp Sun Aug 5 10:59:42 2018
@@ -611,13 +611,11 @@
void ScribusView::enterEvent(QEvent * e)
{
m_canvasMode->enterEvent(e);
- return;
}
void ScribusView::leaveEvent(QEvent *e)
{
m_canvasMode->leaveEvent(e);
- return;
}
void ScribusView::contentsDragEnterEvent(QDragEnterEvent *e)
@@ -1046,9 +1044,9 @@
if (b->itemText.length() != 0)
{
int t = ScMessageBox::warning(this, CommonStrings::trWarning, tr("Do you really want to clear all your text?"),
- QMessageBox::Yes | QMessageBox::No,
- QMessageBox::No, // GUI default
- QMessageBox::Yes); // batch default
+ QMessageBox::Yes | QMessageBox::No,
+ QMessageBox::No, // GUI default
+ QMessageBox::Yes); // batch default
if (t == QMessageBox::No)
{
delete gt;
@@ -1086,7 +1084,7 @@
{
Deselect(true);
int oldDocItemCount = Doc->Items->count();
- if (((!img) || (vectorFile)) && (Doc->DraggedElem == 0))
+ if (((!img) || (vectorFile)) && (Doc->DraggedElem == nullptr))
{
activeTransaction = undoManager->beginTransaction(Um::SelectionGroup, Um::IGroup, Um::Create, "", Um::ICreate);
if (fi.exists())
@@ -1179,7 +1177,7 @@
}
else
{
- if (Doc->DraggedElem != 0)
+ if (Doc->DraggedElem != nullptr)
{
if (!Doc->leaveDrag)
{
@@ -1227,12 +1225,12 @@
{
bb = pasted.at(dre);
currItem = Doc->m_Selection->itemAt(dre);
- if ((currItem->asTextFrame()) && ((currItem->nextInChain() != 0) || (currItem->prevInChain() != 0)))
+ if ((currItem->asTextFrame()) && ((currItem->nextInChain() != nullptr) || (currItem->prevInChain() != nullptr)))
{
PageItem* before = currItem->prevInChain();
PageItem* after = currItem->nextInChain();
currItem->unlink();
- if (before != 0)
+ if (before != nullptr)
{
fin = Doc->m_Selection->findItem(before);
if (fin != -1)
@@ -1240,7 +1238,7 @@
before->unlink();
before->link(bb);
}
- if (after != 0)
+ if (after != nullptr)
{
fin = Doc->m_Selection->findItem(after);
if (fin != -1)
@@ -1255,7 +1253,7 @@
}
if ((!img) && ((re == 0)))
emit LoadElem(QString(text), dropPosDoc.x(), dropPosDoc.y(), false, false, Doc, this);
- Doc->DraggedElem = 0;
+ Doc->DraggedElem = nullptr;
Doc->DragElements.clear();
Selection tmpSelection(this, false);
tmpSelection.copy(*Doc->m_Selection, true);
@@ -1747,14 +1745,11 @@
emit ItemTextAlign(textFrame->itemText.paragraphStyle(pos).alignment());
return true;
}
- else
- {
- Doc->currentStyle.charStyle() = textFrame->itemText.defaultStyle().charStyle();
- emit ItemCharStyle(textFrame->itemText.defaultStyle().charStyle());
- emit ItemTextEffects(textFrame->itemText.defaultStyle().charStyle().effects());
- emit ItemTextAlign(0);
- return true;
- }
+ Doc->currentStyle.charStyle() = textFrame->itemText.defaultStyle().charStyle();
+ emit ItemCharStyle(textFrame->itemText.defaultStyle().charStyle());
+ emit ItemTextEffects(textFrame->itemText.defaultStyle().charStyle().effects());
+ emit ItemTextAlign(0);
+ return true;
}
return false;
}
@@ -1912,12 +1907,12 @@
UndoTransaction activeTransaction;
int ac = Doc->Items->count();
if (UndoManager::undoEnabled())
- activeTransaction = undoManager->beginTransaction(Doc->currentPage()->getUName(), 0, Um::Paste, "", Um::IPaste);
+ activeTransaction = undoManager->beginTransaction(Doc->currentPage()->getUName(), nullptr, Um::Paste, "", Um::IPaste);
QString buffer = ScMimeData::clipboardScribusElem();
emit LoadElem(buffer, dragX, dragY, false, false, Doc, this);
- Doc->DraggedElem = 0;
+ Doc->DraggedElem = nullptr;
Doc->DragElements.clear();
updateContents();
Selection newObjects(this, false);
@@ -2050,8 +2045,8 @@
void ScribusView::startGroupTransaction(const QString& action, const QString& description, QPixmap* actionIcon, Selection* customSelection)
{
- Selection* itemSelection = (customSelection!=0) ? customSelection : Doc->m_Selection;
- assert(itemSelection!=0);
+ Selection* itemSelection = (customSelection!=nullptr) ? customSelection : Doc->m_Selection;
+ assert(itemSelection!=nullptr);
int selectedItemCount=itemSelection->count();
Q_ASSERT(selectedItemCount > 0);
if (!m_groupTransaction)
@@ -2177,9 +2172,9 @@
ScPage* ScribusView::addPage(int nr, bool mov)
{
ScPage* fe=Doc->Pages->at(nr);
- Q_ASSERT(fe!=0);
- if (fe==0)
- return 0;
+ Q_ASSERT(fe!=nullptr);
+ if (fe==nullptr)
+ return nullptr;
//Note this picks up the new page or master page depending on the mode.
// reformPages(mov);
Doc->reformPages(mov);
@@ -2667,7 +2662,7 @@
resizeContents(qRound((Doc->maxCanvasCoordinate.x() - Doc->minCanvasCoordinate.x()) * m_canvas->scale()), qRound((Doc->maxCanvasCoordinate.y() - Doc->minCanvasCoordinate.y()) * m_canvas->scale()));
}
-QImage ScribusView::MPageToPixmap(QString name, int maxGr, bool drawFrame)
+QImage ScribusView::MPageToPixmap(const QString& name, int maxGr, bool drawFrame)
{
QImage pm;
QImage im;
@@ -3230,20 +3225,20 @@
Selection tmpSelection(this, false);
tmpSelection.copy(*Doc->m_Selection, false);
PageItem *currItem = tmpSelection.itemAt(0);
- if ((currItem->prevInChain() != 0) || (currItem->nextInChain() != 0))
+ if ((currItem->prevInChain() != nullptr) || (currItem->nextInChain() != nullptr))
{
// select whole chain
PageItem *backItem = currItem;
- while (backItem->prevInChain() != 0)
+ while (backItem->prevInChain() != nullptr)
backItem = backItem->prevInChain();
currItem = backItem;
Deselect(true);
tmpSelection.addItem(currItem);
backItem = currItem->nextInChain();
- while (backItem != 0)
+ while (backItem != nullptr)
{
tmpSelection.addItem(backItem);
- if (backItem->nextInChain() != 0)
+ if (backItem->nextInChain() != nullptr)
backItem = backItem->nextInChain();
else
break;
@@ -3254,7 +3249,7 @@
int selectedItemCount = tmpSelection.count();
if (selectedItemCount != 0)
{
- UndoTransaction trans(undoManager->beginTransaction(currItem->getUName(), currItem->getUPixmap(), Um::ToOutlines, "", 0));
+ UndoTransaction trans(undoManager->beginTransaction(currItem->getUName(), currItem->getUPixmap(), Um::ToOutlines, "", nullptr));
int offset=0;
for(int i=0; i<selectedItemCount; ++i)
{
Modified: trunk/Scribus/scribus/scribusview.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scribusview.h
==============================================================================
--- trunk/Scribus/scribus/scribusview.h (original)
+++ trunk/Scribus/scribus/scribusview.h Sun Aug 5 10:59:42 2018
@@ -162,7 +162,7 @@
void showInlinePage(int id);
void hideInlinePage();
QImage PageToPixmap(int Nr, int maxGr, PageToPixmapFlags flags = Pixmap_DrawFrame | Pixmap_DrawBackground);
- QImage MPageToPixmap(QString name, int maxGr, bool drawFrame = true);
+ QImage MPageToPixmap(const QString& name, int maxGr, bool drawFrame = true);
void RecalcPicturesRes();
/**
* Called when the ruler origin is dragged
Modified: trunk/Scribus/scribus/scstreamfilter_jpeg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scstreamfilter_jpeg.cpp
==============================================================================
--- trunk/Scribus/scribus/scstreamfilter_jpeg.cpp (original)
+++ trunk/Scribus/scribus/scstreamfilter_jpeg.cpp Sun Aug 5 10:59:42 2018
@@ -112,8 +112,7 @@
ScJpegEncodeFilterData::~ScJpegEncodeFilterData()
{
- if (cdest)
- delete cdest;
+ delete cdest;
if (row_pointer[0])
delete [] row_pointer[0];
}
@@ -143,8 +142,7 @@
void ScJpegEncodeFilter::freeData()
{
- if (m_filterData)
- delete m_filterData;
+ delete m_filterData;
m_filterData = nullptr;
}
@@ -162,7 +160,7 @@
struct ScJpegErrorMgr jerr;
jerr.pub.error_exit = ScJpegErrorMgr::jpegErrorExit;
m_filterData->cinfo.err = jpeg_std_error (&jerr.pub);
- m_filterData->row_pointer[0] = 0;
+ m_filterData->row_pointer[0] = nullptr;
m_filterData->cdest = new ScJpegDestinationMgr(this);
if (m_filterData->cdest == nullptr)
Modified: trunk/Scribus/scribus/sctextstruct.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/sctextstruct.cpp
==============================================================================
--- trunk/Scribus/scribus/sctextstruct.cpp (original)
+++ trunk/Scribus/scribus/sctextstruct.cpp Sun Aug 5 10:59:42 2018
@@ -21,8 +21,7 @@
ScText::~ScText()
{
- if (parstyle)
- delete parstyle;
+ delete parstyle;
parstyle = nullptr;
mark = nullptr;
}
@@ -40,8 +39,7 @@
{
if (MRK == nullptr)
return mark != nullptr;
- else
- return mark == MRK;
+ return mark == MRK;
}
return false;
}
Modified: trunk/Scribus/scribus/scxmlstreamreader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scxmlstreamreader.cpp
==============================================================================
--- trunk/Scribus/scribus/scxmlstreamreader.cpp (original)
+++ trunk/Scribus/scribus/scxmlstreamreader.cpp Sun Aug 5 10:59:42 2018
@@ -9,7 +9,7 @@
#include "scclocale.h"
-ScXmlStreamAttributes::ScXmlStreamAttributes(void) : QXmlStreamAttributes()
+ScXmlStreamAttributes::ScXmlStreamAttributes()
{
}
@@ -155,7 +155,7 @@
return retValue;
}
-QString ScXmlStreamAttributes::valueAsString (const QString& attrName, const QString def) const
+QString ScXmlStreamAttributes::valueAsString (const QString& attrName, const QString& def) const
{
QString retValue = def;
QStringRef att = value(attrName);
@@ -164,13 +164,13 @@
return retValue;
}
-ScXmlStreamAttributes ScXmlStreamReader::scAttributes(void) const
+ScXmlStreamAttributes ScXmlStreamReader::scAttributes() const
{
ScXmlStreamAttributes attrs(attributes());
return attrs;
}
-void ScXmlStreamReader::readToElementEnd(void)
+void ScXmlStreamReader::readToElementEnd()
{
if (!isStartElement())
return;
Modified: trunk/Scribus/scribus/scxmlstreamreader.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/scxmlstreamreader.h
==============================================================================
--- trunk/Scribus/scribus/scxmlstreamreader.h (original)
+++ trunk/Scribus/scribus/scxmlstreamreader.h Sun Aug 5 10:59:42 2018
@@ -30,7 +30,7 @@
double valueAsDouble (const char* attrName, double def = 0.0) const;
double valueAsDouble (const QString& attrName, double def = 0.0) const;
QString valueAsString (const char* attrName, const QString def = QString()) const;
- QString valueAsString (const QString& attrName, const QString def = QString()) const;
+ QString valueAsString (const QString& attrName, const QString& def = QString()) const;
};
class SCRIBUS_API ScXmlStreamReader : public QXmlStreamReader
Modified: trunk/Scribus/scribus/styleitem.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/styleitem.cpp
==============================================================================
--- trunk/Scribus/scribus/styleitem.cpp (original)
+++ trunk/Scribus/scribus/styleitem.cpp Sun Aug 5 10:59:42 2018
@@ -7,13 +7,13 @@
#include "styleitem.h"
-StyleItem::StyleItem() : QObject()
+StyleItem::StyleItem()
{}
StyleItem::~StyleItem()
{}
-StyleItem::StyleItem(const StyleItem&) : QObject()
+StyleItem::StyleItem(const StyleItem&)
{}
void StyleItem::operator=(const StyleItem&)
Modified: trunk/Scribus/scribus/styles/cellstyle.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/styles/cellstyle.cpp
==============================================================================
--- trunk/Scribus/scribus/styles/cellstyle.cpp (original)
+++ trunk/Scribus/scribus/styles/cellstyle.cpp Sun Aug 5 10:59:42 2018
@@ -20,8 +20,7 @@
return CommonStrings::trDefaultCellStyle;
if (hasName() || !hasParent() || !m_context)
return name();
- else
- return parentStyle()->displayName() + "+";
+ return parentStyle()->displayName() + "+";
}
bool CellStyle::equiv(const BaseStyle& other) const
Modified: trunk/Scribus/scribus/text/boxes.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/boxes.cpp
==============================================================================
--- trunk/Scribus/scribus/text/boxes.cpp (original)
+++ trunk/Scribus/scribus/text/boxes.cpp Sun Aug 5 10:59:42 2018
@@ -513,7 +513,7 @@
}
if (((selectionFirst >= 0 && item->isSelected()) ||
- ((item->nextInChain() != 0 || item->prevInChain() != 0) && selectionFirst >= 0)) &&
+ ((item->nextInChain() != nullptr || item->prevInChain() != nullptr) && selectionFirst >= 0)) &&
(item->doc()->appMode == modeEdit || item->doc()->appMode == modeEditTable))
{
if (selectionFirst == firstChar() && selectionLast == lastChar())
@@ -567,7 +567,7 @@
p->setStrokeWidth(0);
if (((selectionFirst >= 0 && item->isSelected()) ||
- ((item->nextInChain() != 0 || item->prevInChain() != 0) && selectionFirst >= 0)) &&
+ ((item->nextInChain() != nullptr || item->prevInChain() != nullptr) && selectionFirst >= 0)) &&
(item->doc()->appMode == modeEdit || item->doc()->appMode == modeEditTable))
{
if (selectionFirst == firstChar() && selectionLast == lastChar())
Modified: trunk/Scribus/scribus/text/frect.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/frect.cpp
==============================================================================
--- trunk/Scribus/scribus/text/frect.cpp (original)
+++ trunk/Scribus/scribus/text/frect.cpp Sun Aug 5 10:59:42 2018
@@ -40,51 +40,51 @@
//#include "qdatastream.h"
/*!
- \class FRect
- \brief The FRect class defines a rectangle in the plane.
-
- \ingroup images
- \ingroup graphics
- \mainclass
-
- A rectangle is internally represented as an upper-left corner and
- a bottom-right corner, but it is normally expressed as an
- upper-left corner and a size.
-
- The coordinate type is qreal (defined in \c qwindowdefs.h as \c
- int). The minimum value of qreal is qreal_MIN (-2147483648) and
- the maximum value is qreal_MAX (2147483647).
-
- Note that the size (width and height) of a rectangle might be
- different from what you are used to. If the top-left corner and
- the bottom-right corner are the same, the height and the width of
- the rectangle will both be 1.
-
- Generally, \e{width = right - left + 1} and \e{height = bottom -
- top + 1}. We designed it this way to make it correspond to
- rectangular spaces used by drawing functions in which the width
- and height denote a number of pixels. For example, drawing a
- rectangle with width and height 1 draws a single pixel.
-
- The default coordinate system has origin (0, 0) in the top-left
- corner. The positive direction of the y axis is down, and the
- positive x axis is from left to right.
-
- A FRect can be constructed with a set of left, top, width and
- height integers, from two FPoints or from a FPoint and a FSize.
- After creation the dimensions can be changed, e.g. with setLeft(),
- setRight(), setTop() and setBottom(), or by setting sizes, e.g.
- setWidth(), setHeight() and setSize(). The dimensions can also be
- changed with the move functions, e.g. moveBy(), moveCenter(),
- moveBottomRight(), etc. You can also add coordinates to a
- rectangle with addCoords().
-
- You can test to see if a FRect contains a specific point with
- contains(). You can also test to see if two FRects intersect with
- intersects() (see also intersect()). To get the bounding rectangle
- of two FRects use unite().
-
- \sa FPoint, FSize
+ \class FRect
+ \brief The FRect class defines a rectangle in the plane.
+
+ \ingroup images
+ \ingroup graphics
+ \mainclass
+
+ A rectangle is internally represented as an upper-left corner and
+ a bottom-right corner, but it is normally expressed as an
+ upper-left corner and a size.
+
+ The coordinate type is qreal (defined in \c qwindowdefs.h as \c
+ int). The minimum value of qreal is qreal_MIN (-2147483648) and
+ the maximum value is qreal_MAX (2147483647).
+
+ Note that the size (width and height) of a rectangle might be
+ different from what you are used to. If the top-left corner and
+ the bottom-right corner are the same, the height and the width of
+ the rectangle will both be 1.
+
+ Generally, \e{width = right - left + 1} and \e{height = bottom -
+ top + 1}. We designed it this way to make it correspond to
+ rectangular spaces used by drawing functions in which the width
+ and height denote a number of pixels. For example, drawing a
+ rectangle with width and height 1 draws a single pixel.
+
+ The default coordinate system has origin (0, 0) in the top-left
+ corner. The positive direction of the y axis is down, and the
+ positive x axis is from left to right.
+
+ A FRect can be constructed with a set of left, top, width and
+ height integers, from two FPoints or from a FPoint and a FSize.
+ After creation the dimensions can be changed, e.g. with setLeft(),
+ setRight(), setTop() and setBottom(), or by setting sizes, e.g.
+ setWidth(), setHeight() and setSize(). The dimensions can also be
+ changed with the move functions, e.g. moveBy(), moveCenter(),
+ moveBottomRight(), etc. You can also add coordinates to a
+ rectangle with addCoords().
+
+ You can test to see if a FRect contains a specific point with
+ contains(). You can also test to see if two FRects intersect with
+ intersects() (see also intersect()). To get the bounding rectangle
+ of two FRects use unite().
+
+ \sa FPoint, FSize
*/
@@ -93,817 +93,813 @@
*****************************************************************************/
/*!
- \fn FRect::FRect()
-
- Constructs an invalid rectangle.
-*/
-
-/*!
- Constructs a rectangle with \a topLeft as the top-left corner and
- \a bottomRight as the bottom-right corner.
+ \fn FRect::FRect()
+
+ Constructs an invalid rectangle.
+*/
+
+/*!
+ Constructs a rectangle with \a topLeft as the top-left corner and
+ \a bottomRight as the bottom-right corner.
*/
FRect::FRect( FPoint &topLeft, FPoint &bottomRight )
{
- x1 = (qreal)topLeft.x();
- y1 = (qreal)topLeft.y();
- x2 = (qreal)bottomRight.x();
- y2 = (qreal)bottomRight.y();
-}
-
-/*!
- Constructs a rectangle with \a topLeft as the top-left corner and
- \a size as the rectangle size.
+ x1 = (qreal)topLeft.x();
+ y1 = (qreal)topLeft.y();
+ x2 = (qreal)bottomRight.x();
+ y2 = (qreal)bottomRight.y();
+}
+
+/*!
+ Constructs a rectangle with \a topLeft as the top-left corner and
+ \a size as the rectangle size.
*/
FRect::FRect( FPoint &topLeft, FSize &size )
{
- x1 = (qreal)topLeft.x();
- y1 = (qreal)topLeft.y();
- x2 = (qreal)(x1+size.width());
- y2 = (qreal)(y1+size.height());
-}
-
-/*!
- \fn FRect::FRect( qreal left, qreal top, qreal width, qreal height )
-
- Constructs a rectangle with the \a top, \a left corner and \a
- width and \a height.
-
- Example (creates three identical rectangles):
- \code
+ x1 = (qreal)topLeft.x();
+ y1 = (qreal)topLeft.y();
+ x2 = (qreal)(x1+size.width());
+ y2 = (qreal)(y1+size.height());
+}
+
+/*!
+ \fn FRect::FRect( qreal left, qreal top, qreal width, qreal height )
+
+ Constructs a rectangle with the \a top, \a left corner and \a
+ width and \a height.
+
+ Example (creates three identical rectangles):
+ \code
FRect r1( FPoint(100,200), FPoint(110,215) );
FRect r2( FPoint(100,200), FSize(11,16) );
FRect r3( 100, 200, 11, 16 );
- \endcode
-*/
-
-
-/*!
- \fn bool FRect::isNull() const
-
- Returns TRUE if the rectangle is a null rectangle; otherwise
- returns FALSE.
-
- A null rectangle has both the width and the height set to 0, that
- is right() == left() - 1 and bottom() == top() - 1.
-
- Note that if right() == left() and bottom() == top(), then the
- rectangle has width 1 and height 1.
-
- A null rectangle is also empty.
-
- A null rectangle is not valid.
-
- \sa isEmpty(), isValid()
-*/
-
-/*!
- \fn bool FRect::isEmpty() const
-
- Returns TRUE if the rectangle is empty; otherwise returns FALSE.
-
- An empty rectangle has a left() \> right() or top() \> bottom().
-
- An empty rectangle is not valid. \c{isEmpty() == !isValid()}
-
- \sa isNull(), isValid(), normalize()
-*/
-
-/*!
- \fn bool FRect::isValid() const
-
- Returns TRUE if the rectangle is valid; otherwise returns FALSE.
-
- A valid rectangle has a left() \<= right() and top() \<= bottom().
-
- Note that non-trivial operations like intersections are not defined
- for invalid rectangles.
-
- \c{isValid() == !isEmpty()}
-
- \sa isNull(), isEmpty(), normalize()
-*/
-
-
-/*!
- Returns a normalized rectangle, i.e. a rectangle that has a
- non-negative width and height.
-
- It swaps left and right if left() \> right(), and swaps top and
- bottom if top() \> bottom().
-
- \sa isValid()
+ \endcode
+*/
+
+
+/*!
+ \fn bool FRect::isNull() const
+
+ Returns TRUE if the rectangle is a null rectangle; otherwise
+ returns FALSE.
+
+ A null rectangle has both the width and the height set to 0, that
+ is right() == left() - 1 and bottom() == top() - 1.
+
+ Note that if right() == left() and bottom() == top(), then the
+ rectangle has width 1 and height 1.
+
+ A null rectangle is also empty.
+
+ A null rectangle is not valid.
+
+ \sa isEmpty(), isValid()
+*/
+
+/*!
+ \fn bool FRect::isEmpty() const
+
+ Returns TRUE if the rectangle is empty; otherwise returns FALSE.
+
+ An empty rectangle has a left() \> right() or top() \> bottom().
+
+ An empty rectangle is not valid. \c{isEmpty() == !isValid()}
+
+ \sa isNull(), isValid(), normalize()
+*/
+
+/*!
+ \fn bool FRect::isValid() const
+
+ Returns TRUE if the rectangle is valid; otherwise returns FALSE.
+
+ A valid rectangle has a left() \<= right() and top() \<= bottom().
+
+ Note that non-trivial operations like intersections are not defined
+ for invalid rectangles.
+
+ \c{isValid() == !isEmpty()}
+
+ \sa isNull(), isEmpty(), normalize()
+*/
+
+
+/*!
+ Returns a normalized rectangle, i.e. a rectangle that has a
+ non-negative width and height.
+
+ It swaps left and right if left() \> right(), and swaps top and
+ bottom if top() \> bottom().
+
+ \sa isValid()
*/
FRect FRect::normalize() const
{
- FRect r;
- if ( x2 < x1 ) { // swap bad x values
- r.x1 = x2;
- r.x2 = x1;
- } else {
- r.x1 = x1;
- r.x2 = x2;
- }
- if ( y2 < y1 ) { // swap bad y values
- r.y1 = y2;
- r.y2 = y1;
- } else {
- r.y1 = y1;
- r.y2 = y2;
- }
- return r;
-}
-
-
-/*!
- \fn qreal FRect::left() const
-
- Returns the left coordinate of the rectangle. Identical to x().
-
- \sa setLeft(), right(), topLeft(), bottomLeft()
-*/
-
-/*!
- \fn qreal FRect::top() const
-
- Returns the top coordinate of the rectangle. Identical to y().
-
- \sa setTop(), bottom(), topLeft(), topRight()
-*/
-
-/*!
- \fn qreal FRect::right() const
-
- Returns the right coordinate of the rectangle.
-
- \sa setRight(), left(), topRight(), bottomRight()
-*/
-
-/*!
- \fn qreal FRect::bottom() const
-
- Returns the bottom coordinate of the rectangle.
-
- \sa setBottom(), top(), bottomLeft(), bottomRight()
-*/
-
-/*!
- \fn qreal &FRect::rLeft()
-
- Returns a reference to the left coordinate of the rectangle.
-
- \sa rTop(), rRight(), rBottom()
-*/
-
-/*!
- \fn qreal &FRect::rTop()
-
- Returns a reference to the top coordinate of the rectangle.
-
- \sa rLeft(), rRight(), rBottom()
-*/
-
-/*!
- \fn qreal &FRect::rRight()
-
- Returns a reference to the right coordinate of the rectangle.
-
- \sa rLeft(), rTop(), rBottom()
-*/
-
-/*!
- \fn qreal &FRect::rBottom()
-
- Returns a reference to the bottom coordinate of the rectangle.
-
- \sa rLeft(), rTop(), rRight()
-*/
-
-/*!
- \fn qreal FRect::x() const
-
- Returns the left coordinate of the rectangle. Identical to left().
-
- \sa left(), y(), setX()
-*/
-
-/*!
- \fn qreal FRect::y() const
-
- Returns the top coordinate of the rectangle. Identical to top().
-
- \sa top(), x(), setY()
-*/
-
-/*!
- \fn void FRect::setLeft( qreal pos )
-
- Sets the left edge of the rectangle to \a pos. May change the
- width, but will never change the right edge of the rectangle.
-
- Identical to setX().
-
- \sa left(), setTop(), setWidth()
-*/
-
-/*!
- \fn void FRect::setTop( qreal pos )
-
- Sets the top edge of the rectangle to \a pos. May change the
- height, but will never change the bottom edge of the rectangle.
-
- Identical to setY().
-
- \sa top(), setBottom(), setHeight()
-*/
-
-/*!
- \fn void FRect::setRight( qreal pos )
-
- Sets the right edge of the rectangle to \a pos. May change the
- width, but will never change the left edge of the rectangle.
-
- \sa right(), setLeft(), setWidth()
-*/
-
-/*!
- \fn void FRect::setBottom( qreal pos )
-
- Sets the bottom edge of the rectangle to \a pos. May change the
- height, but will never change the top edge of the rectangle.
-
- \sa bottom(), setTop(), setHeight()
-*/
-
-/*!
- \fn void FRect::setX( qreal x )
-
- Sets the x position of the rectangle (its left end) to \a x. May
- change the width, but will never change the right edge of the
- rectangle.
-
- Identical to setLeft().
-
- \sa x(), setY()
-*/
-
-/*!
- \fn void FRect::setY( qreal y )
-
- Sets the y position of the rectangle (its top) to \a y. May change
- the height, but will never change the bottom edge of the
- rectangle.
-
- Identical to setTop().
-
- \sa y(), setX()
-*/
-
-/*!
- Set the top-left corner of the rectangle to \a p. May change
- the size, but will the never change the bottom-right corner of
- the rectangle.
-
- \sa topLeft(), moveTopLeft(), setBottomRight(), setTopRight(), setBottomLeft()
+ FRect r;
+ if ( x2 < x1 ) { // swap bad x values
+ r.x1 = x2;
+ r.x2 = x1;
+ } else {
+ r.x1 = x1;
+ r.x2 = x2;
+ }
+ if ( y2 < y1 ) { // swap bad y values
+ r.y1 = y2;
+ r.y2 = y1;
+ } else {
+ r.y1 = y1;
+ r.y2 = y2;
+ }
+ return r;
+}
+
+
+/*!
+ \fn qreal FRect::left() const
+
+ Returns the left coordinate of the rectangle. Identical to x().
+
+ \sa setLeft(), right(), topLeft(), bottomLeft()
+*/
+
+/*!
+ \fn qreal FRect::top() const
+
+ Returns the top coordinate of the rectangle. Identical to y().
+
+ \sa setTop(), bottom(), topLeft(), topRight()
+*/
+
+/*!
+ \fn qreal FRect::right() const
+
+ Returns the right coordinate of the rectangle.
+
+ \sa setRight(), left(), topRight(), bottomRight()
+*/
+
+/*!
+ \fn qreal FRect::bottom() const
+
+ Returns the bottom coordinate of the rectangle.
+
+ \sa setBottom(), top(), bottomLeft(), bottomRight()
+*/
+
+/*!
+ \fn qreal &FRect::rLeft()
+
+ Returns a reference to the left coordinate of the rectangle.
+
+ \sa rTop(), rRight(), rBottom()
+*/
+
+/*!
+ \fn qreal &FRect::rTop()
+
+ Returns a reference to the top coordinate of the rectangle.
+
+ \sa rLeft(), rRight(), rBottom()
+*/
+
+/*!
+ \fn qreal &FRect::rRight()
+
+ Returns a reference to the right coordinate of the rectangle.
+
+ \sa rLeft(), rTop(), rBottom()
+*/
+
+/*!
+ \fn qreal &FRect::rBottom()
+
+ Returns a reference to the bottom coordinate of the rectangle.
+
+ \sa rLeft(), rTop(), rRight()
+*/
+
+/*!
+ \fn qreal FRect::x() const
+
+ Returns the left coordinate of the rectangle. Identical to left().
+
+ \sa left(), y(), setX()
+*/
+
+/*!
+ \fn qreal FRect::y() const
+
+ Returns the top coordinate of the rectangle. Identical to top().
+
+ \sa top(), x(), setY()
+*/
+
+/*!
+ \fn void FRect::setLeft( qreal pos )
+
+ Sets the left edge of the rectangle to \a pos. May change the
+ width, but will never change the right edge of the rectangle.
+
+ Identical to setX().
+
+ \sa left(), setTop(), setWidth()
+*/
+
+/*!
+ \fn void FRect::setTop( qreal pos )
+
+ Sets the top edge of the rectangle to \a pos. May change the
+ height, but will never change the bottom edge of the rectangle.
+
+ Identical to setY().
+
+ \sa top(), setBottom(), setHeight()
+*/
+
+/*!
+ \fn void FRect::setRight( qreal pos )
+
+ Sets the right edge of the rectangle to \a pos. May change the
+ width, but will never change the left edge of the rectangle.
+
+ \sa right(), setLeft(), setWidth()
+*/
+
+/*!
+ \fn void FRect::setBottom( qreal pos )
+
+ Sets the bottom edge of the rectangle to \a pos. May change the
+ height, but will never change the top edge of the rectangle.
+
+ \sa bottom(), setTop(), setHeight()
+*/
+
+/*!
+ \fn void FRect::setX( qreal x )
+
+ Sets the x position of the rectangle (its left end) to \a x. May
+ change the width, but will never change the right edge of the
+ rectangle.
+
+ Identical to setLeft().
+
+ \sa x(), setY()
+*/
+
+/*!
+ \fn void FRect::setY( qreal y )
+
+ Sets the y position of the rectangle (its top) to \a y. May change
+ the height, but will never change the bottom edge of the
+ rectangle.
+
+ Identical to setTop().
+
+ \sa y(), setX()
+*/
+
+/*!
+ Set the top-left corner of the rectangle to \a p. May change
+ the size, but will the never change the bottom-right corner of
+ the rectangle.
+
+ \sa topLeft(), moveTopLeft(), setBottomRight(), setTopRight(), setBottomLeft()
*/
void FRect::setTopLeft( FPoint &p )
{
- setLeft( p.x() );
- setTop( p.y() );
-}
-
-/*!
- Set the bottom-right corner of the rectangle to \a p. May change
- the size, but will the never change the top-left corner of
- the rectangle.
-
- \sa bottomRight(), moveBottomRight(), setTopLeft(), setTopRight(), setBottomLeft()
+ setLeft( p.x() );
+ setTop( p.y() );
+}
+
+/*!
+ Set the bottom-right corner of the rectangle to \a p. May change
+ the size, but will the never change the top-left corner of
+ the rectangle.
+
+ \sa bottomRight(), moveBottomRight(), setTopLeft(), setTopRight(), setBottomLeft()
*/
void FRect::setBottomRight( FPoint &p )
{
- setRight( p.x() );
- setBottom( p.y() );
-}
-
-/*!
- Set the top-right corner of the rectangle to \a p. May change
- the size, but will the never change the bottom-left corner of
- the rectangle.
-
- \sa topRight(), moveTopRight(), setTopLeft(), setBottomRight(), setBottomLeft()
+ setRight( p.x() );
+ setBottom( p.y() );
+}
+
+/*!
+ Set the top-right corner of the rectangle to \a p. May change
+ the size, but will the never change the bottom-left corner of
+ the rectangle.
+
+ \sa topRight(), moveTopRight(), setTopLeft(), setBottomRight(), setBottomLeft()
*/
void FRect::setTopRight( FPoint &p )
{
- setRight( p.x() );
- setTop( p.y() );
-}
-
-/*!
- Set the bottom-left corner of the rectangle to \a p. May change
- the size, but will the never change the top-right corner of
- the rectangle.
-
- \sa bottomLeft(), moveBottomLeft(), setTopLeft(), setBottomRight(), setTopRight()
+ setRight( p.x() );
+ setTop( p.y() );
+}
+
+/*!
+ Set the bottom-left corner of the rectangle to \a p. May change
+ the size, but will the never change the top-right corner of
+ the rectangle.
+
+ \sa bottomLeft(), moveBottomLeft(), setTopLeft(), setBottomRight(), setTopRight()
*/
void FRect::setBottomLeft( FPoint &p )
{
- setLeft( p.x() );
- setBottom( p.y() );
-}
-
-/*!
- \fn FPoint FRect::topLeft() const
-
- Returns the top-left position of the rectangle.
-
- \sa setTopLeft(), moveTopLeft(), bottomRight(), left(), top()
-*/
-
-/*!
- \fn FPoint FRect::bottomRight() const
-
- Returns the bottom-right position of the rectangle.
-
- \sa setBottomRight(), moveBottomRight(), topLeft(), right(), bottom()
-*/
-
-/*!
- \fn FPoint FRect::topRight() const
-
- Returns the top-right position of the rectangle.
-
- \sa setTopRight(), moveTopRight(), bottomLeft(), top(), right()
-*/
-
-/*!
- \fn FPoint FRect::bottomLeft() const
-
- Returns the bottom-left position of the rectangle.
-
- \sa setBottomLeft(), moveBottomLeft(), topRight(), bottom(), left()
-*/
-
-/*!
- \fn FPoint FRect::center() const
-
- Returns the center point of the rectangle.
-
- \sa moveCenter(), topLeft(), bottomRight(), topRight(), bottomLeft()
-*/
-
-
-/*!
- Extracts the rectangle parameters as the position \a *x, \a *y and
- width \a *w and height \a *h.
-
- \sa setRect(), coords()
+ setLeft( p.x() );
+ setBottom( p.y() );
+}
+
+/*!
+ \fn FPoint FRect::topLeft() const
+
+ Returns the top-left position of the rectangle.
+
+ \sa setTopLeft(), moveTopLeft(), bottomRight(), left(), top()
+*/
+
+/*!
+ \fn FPoint FRect::bottomRight() const
+
+ Returns the bottom-right position of the rectangle.
+
+ \sa setBottomRight(), moveBottomRight(), topLeft(), right(), bottom()
+*/
+
+/*!
+ \fn FPoint FRect::topRight() const
+
+ Returns the top-right position of the rectangle.
+
+ \sa setTopRight(), moveTopRight(), bottomLeft(), top(), right()
+*/
+
+/*!
+ \fn FPoint FRect::bottomLeft() const
+
+ Returns the bottom-left position of the rectangle.
+
+ \sa setBottomLeft(), moveBottomLeft(), topRight(), bottom(), left()
+*/
+
+/*!
+ \fn FPoint FRect::center() const
+
+ Returns the center point of the rectangle.
+
+ \sa moveCenter(), topLeft(), bottomRight(), topRight(), bottomLeft()
+*/
+
+
+/*!
+ Extracts the rectangle parameters as the position \a *x, \a *y and
+ width \a *w and height \a *h.
+
+ \sa setRect(), coords()
*/
void FRect::rect( qreal *x, qreal *y, qreal *w, qreal *h ) const
{
- *x = x1;
- *y = y1;
- *w = x2-x1;
- *h = y2-y1;
-}
-
-/*!
- Extracts the rectangle parameters as the top-left point \a *xp1,
- \a *yp1 and the bottom-right point \a *xp2, \a *yp2.
-
- \sa setCoords(), rect()
+ *x = x1;
+ *y = y1;
+ *w = x2-x1;
+ *h = y2-y1;
+}
+
+/*!
+ Extracts the rectangle parameters as the top-left point \a *xp1,
+ \a *yp1 and the bottom-right point \a *xp2, \a *yp2.
+
+ \sa setCoords(), rect()
*/
void FRect::coords( qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2 ) const
{
- *xp1 = x1;
- *yp1 = y1;
- *xp2 = x2;
- *yp2 = y2;
-}
-
-
-/*!
- Sets the left position of the rectangle to \a pos, leaving the
- size unchanged.
-
- \sa left(), setLeft(), moveTop(), moveRight(), moveBottom()
+ *xp1 = x1;
+ *yp1 = y1;
+ *xp2 = x2;
+ *yp2 = y2;
+}
+
+
+/*!
+ Sets the left position of the rectangle to \a pos, leaving the
+ size unchanged.
+
+ \sa left(), setLeft(), moveTop(), moveRight(), moveBottom()
*/
void FRect::moveLeft( qreal pos )
{
- x2 += (qreal)(pos - x1);
- x1 = (qreal)pos;
-}
-
-/*!
- Sets the top position of the rectangle to \a pos, leaving the
- size unchanged.
-
- \sa top(), setTop(), moveLeft(), moveRight(), moveBottom()
+ x2 += (qreal)(pos - x1);
+ x1 = (qreal)pos;
+}
+
+/*!
+ Sets the top position of the rectangle to \a pos, leaving the
+ size unchanged.
+
+ \sa top(), setTop(), moveLeft(), moveRight(), moveBottom()
*/
void FRect::moveTop( qreal pos )
{
- y2 += (qreal)(pos - y1);
- y1 = (qreal)pos;
-}
-
-/*!
- Sets the right position of the rectangle to \a pos, leaving the
- size unchanged.
-
- \sa right(), setRight(), moveLeft(), moveTop(), moveBottom()
+ y2 += (qreal)(pos - y1);
+ y1 = (qreal)pos;
+}
+
+/*!
+ Sets the right position of the rectangle to \a pos, leaving the
+ size unchanged.
+
+ \sa right(), setRight(), moveLeft(), moveTop(), moveBottom()
*/
void FRect::moveRight( qreal pos )
{
- x1 += (qreal)(pos - x2);
- x2 = (qreal)pos;
-}
-
-/*!
- Sets the bottom position of the rectangle to \a pos, leaving the
- size unchanged.
-
- \sa bottom(), setBottom(), moveLeft(), moveTop(), moveRight()
+ x1 += (qreal)(pos - x2);
+ x2 = (qreal)pos;
+}
+
+/*!
+ Sets the bottom position of the rectangle to \a pos, leaving the
+ size unchanged.
+
+ \sa bottom(), setBottom(), moveLeft(), moveTop(), moveRight()
*/
void FRect::moveBottom( qreal pos )
{
- y1 += (qreal)(pos - y2);
- y2 = (qreal)pos;
-}
-
-/*!
- Sets the top-left position of the rectangle to \a p, leaving the
- size unchanged.
-
- \sa topLeft(), setTopLeft(), moveBottomRight(), moveTopRight(), moveBottomLeft()
+ y1 += (qreal)(pos - y2);
+ y2 = (qreal)pos;
+}
+
+/*!
+ Sets the top-left position of the rectangle to \a p, leaving the
+ size unchanged.
+
+ \sa topLeft(), setTopLeft(), moveBottomRight(), moveTopRight(), moveBottomLeft()
*/
void FRect::moveTopLeft( FPoint &p )
{
- moveLeft( p.x() );
- moveTop( p.y() );
-}
-
-/*!
- Sets the bottom-right position of the rectangle to \a p, leaving
- the size unchanged.
-
- \sa bottomRight(), setBottomRight(), moveTopLeft(), moveTopRight(), moveBottomLeft()
+ moveLeft( p.x() );
+ moveTop( p.y() );
+}
+
+/*!
+ Sets the bottom-right position of the rectangle to \a p, leaving
+ the size unchanged.
+
+ \sa bottomRight(), setBottomRight(), moveTopLeft(), moveTopRight(), moveBottomLeft()
*/
void FRect::moveBottomRight( FPoint &p )
{
- moveRight( p.x() );
- moveBottom( p.y() );
-}
-
-/*!
- Sets the top-right position of the rectangle to \a p, leaving the
- size unchanged.
-
- \sa topRight(), setTopRight(), moveTopLeft(), moveBottomRight(), moveBottomLeft()
+ moveRight( p.x() );
+ moveBottom( p.y() );
+}
+
+/*!
+ Sets the top-right position of the rectangle to \a p, leaving the
+ size unchanged.
+
+ \sa topRight(), setTopRight(), moveTopLeft(), moveBottomRight(), moveBottomLeft()
*/
void FRect::moveTopRight( FPoint &p )
{
- moveRight( p.x() );
- moveTop( p.y() );
-}
-
-/*!
- Sets the bottom-left position of the rectangle to \a p, leaving
- the size unchanged.
-
- \sa bottomLeft(), setBottomLeft(), moveTopLeft(), moveBottomRight(), moveTopRight()
+ moveRight( p.x() );
+ moveTop( p.y() );
+}
+
+/*!
+ Sets the bottom-left position of the rectangle to \a p, leaving
+ the size unchanged.
+
+ \sa bottomLeft(), setBottomLeft(), moveTopLeft(), moveBottomRight(), moveTopRight()
*/
void FRect::moveBottomLeft( FPoint &p )
{
- moveLeft( p.x() );
- moveBottom( p.y() );
-}
-
-
-/*!
- Sets the center point of the rectangle to \a p, leaving the size
- unchanged.
-
- \sa center(), moveTopLeft(), moveBottomRight(), moveTopRight(), moveBottomLeft()
+ moveLeft( p.x() );
+ moveBottom( p.y() );
+}
+
+
+/*!
+ Sets the center point of the rectangle to \a p, leaving the size
+ unchanged.
+
+ \sa center(), moveTopLeft(), moveBottomRight(), moveTopRight(), moveBottomLeft()
*/
void FRect::moveCenter( FPoint &p )
{
- qreal w = x2 - x1;
- qreal h = y2 - y1;
- x1 = (qreal)(p.x() - w/2);
- y1 = (qreal)(p.y() - h/2);
- x2 = x1 + w;
- y2 = y1 + h;
-}
-
-
-/*!
- Moves the rectangle \a dx along the x axis and \a dy along the y
- axis, relative to the current position. Positive values move the
- rectangle to the right and down.
-
- \sa moveTopLeft()
+ qreal w = x2 - x1;
+ qreal h = y2 - y1;
+ x1 = (qreal)(p.x() - w/2);
+ y1 = (qreal)(p.y() - h/2);
+ x2 = x1 + w;
+ y2 = y1 + h;
+}
+
+
+/*!
+ Moves the rectangle \a dx along the x axis and \a dy along the y
+ axis, relative to the current position. Positive values move the
+ rectangle to the right and down.
+
+ \sa moveTopLeft()
*/
void FRect::moveBy( qreal dx, qreal dy )
{
- x1 += (qreal)dx;
- y1 -= (qreal)dy;
- x2 += (qreal)dx;
- y2 -= (qreal)dy;
-}
-
-/*!
- Sets the coordinates of the rectangle's top-left corner to \a (x,
- y), and its size to \a (w, h).
-
- \sa rect(), setCoords()
+ x1 += (qreal)dx;
+ y1 -= (qreal)dy;
+ x2 += (qreal)dx;
+ y2 -= (qreal)dy;
+}
+
+/*!
+ Sets the coordinates of the rectangle's top-left corner to \a (x,
+ y), and its size to \a (w, h).
+
+ \sa rect(), setCoords()
*/
void FRect::setRect( qreal x, qreal y, qreal w, qreal h )
{
- x1 = (qreal)x;
- y1 = (qreal)y;
- x2 = (qreal)(x+w);
- y2 = (qreal)(y+h);
-}
-
-/*!
- Sets the coordinates of the rectangle's top-left corner to \a
- (xp1, yp1), and the coordinates of its bottom-right corner to \a
- (xp2, yp2).
-
- \sa coords(), setRect()
+ x1 = (qreal)x;
+ y1 = (qreal)y;
+ x2 = (qreal)(x+w);
+ y2 = (qreal)(y+h);
+}
+
+/*!
+ Sets the coordinates of the rectangle's top-left corner to \a
+ (xp1, yp1), and the coordinates of its bottom-right corner to \a
+ (xp2, yp2).
+
+ \sa coords(), setRect()
*/
void FRect::setCoords( qreal xp1, qreal yp1, qreal xp2, qreal yp2 )
{
- x1 = (qreal)xp1;
- y1 = (qreal)yp1;
- x2 = (qreal)xp2;
- y2 = (qreal)yp2;
-}
-
-/*!
- Adds \a xp1, \a yp1, \a xp2 and \a yp2 respectively to the
- existing coordinates of the rectangle.
+ x1 = (qreal)xp1;
+ y1 = (qreal)yp1;
+ x2 = (qreal)xp2;
+ y2 = (qreal)yp2;
+}
+
+/*!
+ Adds \a xp1, \a yp1, \a xp2 and \a yp2 respectively to the
+ existing coordinates of the rectangle.
*/
void FRect::addCoords( qreal xp1, qreal yp1, qreal xp2, qreal yp2 )
{
- x1 += (qreal)xp1;
- y1 += (qreal)yp1;
- x2 += (qreal)xp2;
- y2 += (qreal)yp2;
-}
-
-/*!
- \fn FSize FRect::size() const
-
- Returns the size of the rectangle.
-
- \sa width(), height()
-*/
-
-/*!
- \fn qreal FRect::width() const
-
- Returns the width of the rectangle. The width includes both the
- left and right edges, i.e. width = right - left + 1.
-
- \sa height(), size(), setHeight()
-*/
-
-/*!
- \fn qreal FRect::height() const
-
- Returns the height of the rectangle. The height includes both the
- top and bottom edges, i.e. height = bottom - top + 1.
-
- \sa width(), size(), setHeight()
-*/
-
-/*!
- Sets the width of the rectangle to \a w. The right edge is
- changed, but not the left edge.
-
- \sa width(), setLeft(), setRight(), setSize()
+ x1 += (qreal)xp1;
+ y1 += (qreal)yp1;
+ x2 += (qreal)xp2;
+ y2 += (qreal)yp2;
+}
+
+/*!
+ \fn FSize FRect::size() const
+
+ Returns the size of the rectangle.
+
+ \sa width(), height()
+*/
+
+/*!
+ \fn qreal FRect::width() const
+
+ Returns the width of the rectangle. The width includes both the
+ left and right edges, i.e. width = right - left + 1.
+
+ \sa height(), size(), setHeight()
+*/
+
+/*!
+ \fn qreal FRect::height() const
+
+ Returns the height of the rectangle. The height includes both the
+ top and bottom edges, i.e. height = bottom - top + 1.
+
+ \sa width(), size(), setHeight()
+*/
+
+/*!
+ Sets the width of the rectangle to \a w. The right edge is
+ changed, but not the left edge.
+
+ \sa width(), setLeft(), setRight(), setSize()
*/
void FRect::setWidth( qreal w )
{
- x2 = (qreal)(x1 + w);
-}
-
-/*!
- Sets the height of the rectangle to \a h. The top edge is not
- moved, but the bottom edge may be moved.
-
- \sa height(), setTop(), setBottom(), setSize()
+ x2 = (qreal)(x1 + w);
+}
+
+/*!
+ Sets the height of the rectangle to \a h. The top edge is not
+ moved, but the bottom edge may be moved.
+
+ \sa height(), setTop(), setBottom(), setSize()
*/
void FRect::setHeight( qreal h )
{
- y2 = (qreal)(y1 + h);
-}
-
-/*!
- Sets the size of the rectangle to \a s. The top-left corner is not
- moved.
-
- \sa size(), setWidth(), setHeight()
+ y2 = (qreal)(y1 + h);
+}
+
+/*!
+ Sets the size of the rectangle to \a s. The top-left corner is not
+ moved.
+
+ \sa size(), setWidth(), setHeight()
*/
void FRect::setSize( const FSize &s )
{
- x2 = (qreal)(s.width() +x1);
- y2 = (qreal)(s.height()+y1);
-}
-
-/*!
- Returns TRUE if the point \a p is inside or on the edge of the
- rectangle; otherwise returns FALSE.
-
- If \a proper is TRUE, this function returns TRUE only if \a p is
- inside (not on the edge).
+ x2 = (qreal)(s.width() +x1);
+ y2 = (qreal)(s.height()+y1);
+}
+
+/*!
+ Returns TRUE if the point \a p is inside or on the edge of the
+ rectangle; otherwise returns FALSE.
+
+ If \a proper is TRUE, this function returns TRUE only if \a p is
+ inside (not on the edge).
*/
bool FRect::contains( FPoint &p, bool proper ) const
{
- if ( proper )
- return p.x() > x1 && p.x() < x2 &&
- p.y() > y1 && p.y() < y2;
- else
+ if (proper)
+ return p.x() > x1 && p.x() < x2 &&
+ p.y() > y1 && p.y() < y2;
return p.x() >= x1 && p.x() <= x2 &&
- p.y() >= y1 && p.y() <= y2;
-}
-
-/*!
- \overload bool FRect::contains( qreal x, qreal y, bool proper ) const
-
- Returns TRUE if the point \a x, \a y is inside this rectangle;
- otherwise returns FALSE.
-
- If \a proper is TRUE, this function returns TRUE only if the point
- is entirely inside (not on the edge).
-*/
-
-/*!
- \overload bool FRect::contains( qreal x, qreal y ) const
-
- Returns TRUE if the point \a x, \a y is inside this rectangle;
- otherwise returns FALSE.
-*/
-
-/*!
- \overload
-
- Returns TRUE if the rectangle \a r is inside this rectangle;
- otherwise returns FALSE.
-
- If \a proper is TRUE, this function returns TRUE only if \a r is
- entirely inside (not on the edge).
-
- \sa unite(), intersect(), intersects()
+ p.y() >= y1 && p.y() <= y2;
+}
+
+/*!
+ \overload bool FRect::contains( qreal x, qreal y, bool proper ) const
+
+ Returns TRUE if the point \a x, \a y is inside this rectangle;
+ otherwise returns FALSE.
+
+ If \a proper is TRUE, this function returns TRUE only if the point
+ is entirely inside (not on the edge).
+*/
+
+/*!
+ \overload bool FRect::contains( qreal x, qreal y ) const
+
+ Returns TRUE if the point \a x, \a y is inside this rectangle;
+ otherwise returns FALSE.
+*/
+
+/*!
+ \overload
+
+ Returns TRUE if the rectangle \a r is inside this rectangle;
+ otherwise returns FALSE.
+
+ If \a proper is TRUE, this function returns TRUE only if \a r is
+ entirely inside (not on the edge).
+
+ \sa unite(), intersect(), intersects()
*/
bool FRect::contains( const FRect &r, bool proper ) const
{
- if ( proper )
- return r.x1 > x1 && r.x2 < x2 && r.y1 > y1 && r.y2 < y2;
- else
+ if (proper)
+ return r.x1 > x1 && r.x2 < x2 && r.y1 > y1 && r.y2 < y2;
return r.x1 >= x1 && r.x2 <= x2 && r.y1 >= y1 && r.y2 <= y2;
}
/*!
- Unites this rectangle with rectangle \a r.
+ Unites this rectangle with rectangle \a r.
*/
FRect& FRect::operator|=(const FRect &r)
{
- *this = *this | r;
- return *this;
-}
-
-/*!
- Intersects this rectangle with rectangle \a r.
+ *this = *this | r;
+ return *this;
+}
+
+/*!
+ Intersects this rectangle with rectangle \a r.
*/
FRect& FRect::operator&=(const FRect &r)
{
- *this = *this & r;
- return *this;
-}
-
-
-/*!
- Returns the bounding rectangle of this rectangle and rectangle \a
- r.
-
- The bounding rectangle of a nonempty rectangle and an empty or
- invalid rectangle is defined to be the nonempty rectangle.
-
- \sa operator|=(), operator&(), intersects(), contains()
+ *this = *this & r;
+ return *this;
+}
+
+
+/*!
+ Returns the bounding rectangle of this rectangle and rectangle \a
+ r.
+
+ The bounding rectangle of a nonempty rectangle and an empty or
+ invalid rectangle is defined to be the nonempty rectangle.
+
+ \sa operator|=(), operator&(), intersects(), contains()
*/
FRect FRect::operator|(const FRect &r) const
{
- if ( isValid() ) {
- if ( r.isValid() ) {
- FRect tmp;
- tmp.setLeft( qMin( x1, r.x1 ) );
- tmp.setRight( qMax( x2, r.x2 ) );
- tmp.setTop( qMin( y1, r.y1 ) );
- tmp.setBottom( qMax( y2, r.y2 ) );
- return tmp;
- } else {
- return *this;
+ if (!isValid())
+ return r;
+ if (r.isValid())
+ {
+ FRect tmp;
+ tmp.setLeft( qMin( x1, r.x1 ) );
+ tmp.setRight( qMax( x2, r.x2 ) );
+ tmp.setTop( qMin( y1, r.y1 ) );
+ tmp.setBottom( qMax( y2, r.y2 ) );
+ return tmp;
}
- } else {
- return r;
- }
-}
-
-/*!
- Returns the bounding rectangle of this rectangle and rectangle \a
- r. \c{r.unite(s)} is equivalent to \c{r|s}.
+ return *this;
+}
+
+/*!
+ Returns the bounding rectangle of this rectangle and rectangle \a
+ r. \c{r.unite(s)} is equivalent to \c{r|s}.
*/
FRect FRect::unite( const FRect &r ) const
{
- return *this | r;
-}
-
-
-/*!
- Returns the intersection of this rectangle and rectangle \a r.
-
- Returns an empty rectangle if there is no intersection.
-
- \sa operator&=(), operator|(), isEmpty(), intersects(), contains()
+ return *this | r;
+}
+
+
+/*!
+ Returns the intersection of this rectangle and rectangle \a r.
+
+ Returns an empty rectangle if there is no intersection.
+
+ \sa operator&=(), operator|(), isEmpty(), intersects(), contains()
*/
FRect FRect::operator&( const FRect &r ) const
{
- FRect tmp;
- tmp.x1 = qMax( x1, r.x1 );
- tmp.x2 = qMin( x2, r.x2 );
- tmp.y1 = qMax( y1, r.y1 );
- tmp.y2 = qMin( y2, r.y2 );
- return tmp;
-}
-
-/*!
- Returns the intersection of this rectangle and rectangle \a r.
- \c{r.intersect(s)} is equivalent to \c{r&s}.
+ FRect tmp;
+ tmp.x1 = qMax( x1, r.x1 );
+ tmp.x2 = qMin( x2, r.x2 );
+ tmp.y1 = qMax( y1, r.y1 );
+ tmp.y2 = qMin( y2, r.y2 );
+ return tmp;
+}
+
+/*!
+ Returns the intersection of this rectangle and rectangle \a r.
+ \c{r.intersect(s)} is equivalent to \c{r&s}.
*/
FRect FRect::intersect( const FRect &r ) const
{
- return *this & r;
-}
-
-/*!
- Returns TRUE if this rectangle intersects with rectangle \a r
- (there is at least one pixel that is within both rectangles);
- otherwise returns FALSE.
-
- \sa intersect(), contains()
+ return *this & r;
+}
+
+/*!
+ Returns TRUE if this rectangle intersects with rectangle \a r
+ (there is at least one pixel that is within both rectangles);
+ otherwise returns FALSE.
+
+ \sa intersect(), contains()
*/
bool FRect::intersects( const FRect &r ) const
{
- return ( qMax( x1, r.x1 ) <= qMin( x2, r.x2 ) &&
- qMax( y1, r.y1 ) <= qMin( y2, r.y2 ) );
-}
-
-
-/*!
- \relates FRect
-
- Returns TRUE if \a r1 and \a r2 are equal; otherwise returns FALSE.
+ return ( qMax( x1, r.x1 ) <= qMin( x2, r.x2 ) &&
+ qMax( y1, r.y1 ) <= qMin( y2, r.y2 ) );
+}
+
+
+/*!
+ \relates FRect
+
+ Returns TRUE if \a r1 and \a r2 are equal; otherwise returns FALSE.
*/
bool operator==( const FRect &r1, const FRect &r2 )
{
- return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
-}
-
-/*!
- \relates FRect
-
- Returns TRUE if \a r1 and \a r2 are different; otherwise returns FALSE.
+ return r1.x1==r2.x1 && r1.x2==r2.x2 && r1.y1==r2.y1 && r1.y2==r2.y2;
+}
+
+/*!
+ \relates FRect
+
+ Returns TRUE if \a r1 and \a r2 are different; otherwise returns FALSE.
*/
bool operator!=( const FRect &r1, const FRect &r2 )
{
- return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
+ return r1.x1!=r2.x1 || r1.x2!=r2.x2 || r1.y1!=r2.y1 || r1.y2!=r2.y2;
}
Modified: trunk/Scribus/scribus/text/glyphcluster.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/glyphcluster.cpp
==============================================================================
--- trunk/Scribus/scribus/text/glyphcluster.cpp (original)
+++ trunk/Scribus/scribus/text/glyphcluster.cpp Sun Aug 5 10:59:42 2018
@@ -1,6 +1,6 @@
#include "glyphcluster.h"
-GlyphCluster::GlyphCluster(const CharStyle* style, LayoutFlags flags, int first, int last, const InlineFrame& o, int i, QString str)
+GlyphCluster::GlyphCluster(const CharStyle* style, LayoutFlags flags, int first, int last, const InlineFrame& o, int i, const QString& str)
: extraWidth(0.0)
, xoffset(0.0)
, yoffset(0.0)
@@ -146,27 +146,17 @@
bool GlyphCluster::isEmpty() const
{
- if (m_glyphs.size() == 1 && m_glyphs.first().glyph == 0)
- return true;
- else
- return false;
+ return m_glyphs.size() == 1 && m_glyphs.first().glyph == 0;
}
bool GlyphCluster::isControlGlyphs() const
{
- if (m_glyphs.size() == 1 && m_glyphs.first().glyph >= ScFace::CONTROL_GLYPHS)
- return true;
- else
- return false;
+ return m_glyphs.size() == 1 && m_glyphs.first().glyph >= ScFace::CONTROL_GLYPHS;
}
bool GlyphCluster::isSpace() const
{
- if (m_glyphs.size() == 1 &&
- (hasFlag(ScLayout_ExpandingSpace) || hasFlag(ScLayout_FixedSpace) || hasFlag(ScLayout_ImplicitSpace)))
- return true;
- else
- return false;
+ return m_glyphs.size() == 1 && (hasFlag(ScLayout_ExpandingSpace) || hasFlag(ScLayout_FixedSpace) || hasFlag(ScLayout_ImplicitSpace));
}
QVector<FPointArray> GlyphCluster::glyphClusterOutline() const
Modified: trunk/Scribus/scribus/text/glyphcluster.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/glyphcluster.h
==============================================================================
--- trunk/Scribus/scribus/text/glyphcluster.h (original)
+++ trunk/Scribus/scribus/text/glyphcluster.h Sun Aug 5 10:59:42 2018
@@ -9,7 +9,7 @@
class SCRIBUS_API GlyphCluster
{
public:
- GlyphCluster(const CharStyle* style, LayoutFlags flags, int first, int last, const InlineFrame& o, int visualIdx, QString str);
+ GlyphCluster(const CharStyle* style, LayoutFlags flags, int first, int last, const InlineFrame& o, int visualIdx, const QString& str);
void append(GlyphLayout&);
Modified: trunk/Scribus/scribus/text/index.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/index.cpp
==============================================================================
--- trunk/Scribus/scribus/text/index.cpp (original)
+++ trunk/Scribus/scribus/text/index.cpp Sun Aug 5 10:59:42 2018
@@ -28,11 +28,8 @@
runEnds.push_back(pos);
return runEnds.size() - 1;
}
- else
- {
- runEnds.insert(runEnds.begin() + i, pos);
- return i;
- }
+ runEnds.insert(runEnds.begin() + i, pos);
+ return i;
}
Modified: trunk/Scribus/scribus/text/shapedtextfeed.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/shapedtextfeed.cpp
==============================================================================
--- trunk/Scribus/scribus/text/shapedtextfeed.cpp (original)
+++ trunk/Scribus/scribus/text/shapedtextfeed.cpp Sun Aug 5 10:59:42 2018
@@ -60,21 +60,18 @@
}
return m_cache->get(fromChar, len);
}
- else
- {
- return m_shaper.shape(fromChar, toChar);
- }
+ return m_shaper.shape(fromChar, toChar);
}
QList<GlyphCluster> ShapedTextFeed::putInVisualOrder(const QList<GlyphCluster>& glyphs, int start, int end)
{
- int glyphsCount = end - start;
- QList<GlyphCluster> runs;
- for (int i = 0; i < glyphsCount; ++i)
- runs.append(glyphs.at(start + i));
- std::sort(runs.begin(), runs.end(), visualGlyphRunComp);
- return runs;
+ int glyphsCount = end - start;
+ QList<GlyphCluster> runs;
+ for (int i = 0; i < glyphsCount; ++i)
+ runs.append(glyphs.at(start + i));
+ std::sort(runs.begin(), runs.end(), visualGlyphRunComp);
+ return runs;
}
Modified: trunk/Scribus/scribus/text/specialchars.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/specialchars.cpp
==============================================================================
--- trunk/Scribus/scribus/text/specialchars.cpp (original)
+++ trunk/Scribus/scribus/text/specialchars.cpp Sun Aug 5 10:59:42 2018
@@ -184,7 +184,7 @@
bool SpecialChars::isCJK(uint ch)
{
- if ( (0x2E80 < ch && ch < 0x2EFF) || // CJK Radicals Supplement
+ return ( (0x2E80 < ch && ch < 0x2EFF) || // CJK Radicals Supplement
(0x3000 < ch && ch < 0x303F) || // CJK Symbols and Punctuation
(0x3040 < ch && ch <= 0x30FF) || // Hiragana, Katakana
(0x31C0 < ch && ch < 0x31EF) || // CJK Strokes
@@ -204,10 +204,7 @@
(ch == 0x3000) ||
(ch == 0x3002) ||
(ch == 0x201C) ||
- (ch == 0x201D))
- return true;
- else
- return false;
+ (ch == 0x201D));
}
@@ -239,7 +236,7 @@
bool SpecialChars::isIgnorableCodePoint(uint ch)
{
// based on list of Default_Ignorable_Code_Point in Unicode 9
- if ( (ch == 0x00AD) || //SOFT HYPHEN
+ return ( (ch == 0x00AD) || //SOFT HYPHEN
(ch == 0x034F) || //COMBINING GRAPHEME JOINER
(ch == 0x061C) || //ARABIC LETTER MARK
(ch == 0x115F) || (ch == 0x1160) || //HANGUL CHOSEONG FILLER..HANGUL JUNGSEONG FILLER
@@ -257,19 +254,16 @@
(ch >= 0x1BCA0 && ch <= 0x1BCA3) || //SHORTHAND FORMAT LETTER OVERLAP..SHORTHAND FORMAT UP STEP
(ch >= 0x1D173 && ch <= 0x1D17A) || //MUSICAL SYMBOL BEGIN BEAM..MUSICAL SYMBOL END PHRASE
(ch == 0xE0001) //LANGUAGE TAG
- )
- return true;
- else
- return false;
+ );
}
bool SpecialChars::isArabicModifierLetter(uint ch)
{
if (ch == 0x0640) //ARABIC TATWEEL
return true;
- else if (ch == 0x06E5) //ARABIC SMALL WAW
+ if (ch == 0x06E5) //ARABIC SMALL WAW
return true;
- else if (ch == 0x06E6) //ARABIC SMALL YEH
+ if (ch == 0x06E6) //ARABIC SMALL YEH
return true;
return false;
}
Modified: trunk/Scribus/scribus/text/textlayout.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/textlayout.cpp
==============================================================================
--- trunk/Scribus/scribus/text/textlayout.cpp (original)
+++ trunk/Scribus/scribus/text/textlayout.cpp Sun Aug 5 10:59:42 2018
@@ -337,7 +337,7 @@
const QList<Box*>& boxes = m_box->boxes();
// Beware of columns hidden by other objects
- const GroupBox* column = 0;
+ const GroupBox* column = nullptr;
int columnIndex = boxes.count() - 1;
do
{
Modified: trunk/Scribus/scribus/text/textshaper.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22607&path=/trunk/Scribus/scribus/text/textshaper.cpp
==============================================================================
--- trunk/Scribus/scribus/text/textshaper.cpp (original)
+++ trunk/Scribus/scribus/text/textshaper.cpp Sun Aug 5 10:59:42 2018
@@ -203,7 +203,7 @@
str.replace(SpecialChars::SHYPHEN, SpecialChars::ZWNJ);
//set style for paragraph effects
- if (m_story.isBlockStart(i) && (m_context != 0) && (m_context->getDoc() != 0))
+ if (m_story.isBlockStart(i) && (m_context != nullptr) && (m_context->getDoc() != nullptr))
{
const ScribusDoc* doc = m_context->getDoc();
const ParagraphStyle& style = m_story.paragraphStyle(i);
@@ -376,7 +376,7 @@
// at the point, shaping with graphite fonts is either buggy (harfbuzz 1.4.2)
// or trigger weird results (harfbuzz 1.4.3), so disable graphite for now.
// Prevent also use of platform specific shapers for cross-platform reasons
- const char* shapers[] = { "ot", "fallback", 0 };
+ const char* shapers[] = { "ot", "fallback", nullptr };
hb_shape_full(hbFont, hbBuffer, hbFeatures.data(), hbFeatures.length(), shapers);
unsigned int count = hb_buffer_get_length(hbBuffer);
More information about the scribus-commit
mailing list