r22648 by craig - clazy and clang fixes, part 19

scribus-commit scribus-commit at lists.scribus.net
Thu Aug 23 19:12:47 UTC 2018


Author: craig
Date: Thu Aug 23 19:12:47 2018
New Revision: 22648

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22648
Log:
clazy and clang fixes, part 19

Modified:
    trunk/Scribus/scribus/canvas.cpp
    trunk/Scribus/scribus/canvas.h
    trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
    trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/ui/transparencypalette.cpp

Modified: trunk/Scribus/scribus/canvas.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22648&path=/trunk/Scribus/scribus/canvas.cpp
==============================================================================
--- trunk/Scribus/scribus/canvas.cpp	(original)
+++ trunk/Scribus/scribus/canvas.cpp	Thu Aug 23 19:12:47 2018
@@ -196,7 +196,7 @@
 }
 
 
-QRect Canvas::canvasToLocal(QRectF p) const
+QRect Canvas::canvasToLocal(const QRectF& p) const
 {
 	return 	QRect(qRound((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale),
 				  qRound((p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale),
@@ -204,7 +204,7 @@
 				  qRound(p.height() * m_viewMode.scale));
 }
 
-QRectF Canvas::canvasToLocalF(QRectF p) const
+QRectF Canvas::canvasToLocalF(const QRectF& p) const
 {
 	return 	QRectF((p.x() - m_doc->minCanvasCoordinate.x()) * m_viewMode.scale,
 				  (p.y() - m_doc->minCanvasCoordinate.y()) * m_viewMode.scale,
@@ -225,7 +225,7 @@
 }
 
 
-QRect Canvas::canvasToGlobal(QRectF p) const
+QRect Canvas::canvasToGlobal(const QRectF& p) const
 {
 	return QRect(mapToParent(QPoint(0,0) + canvasToLocal(p.topLeft())) + parentWidget()->mapToGlobal(QPoint(0, 0)),
 				 QSize(qRound(p.width() * m_viewMode.scale), qRound(p.height() * m_viewMode.scale)));
@@ -338,7 +338,7 @@
 }
 
 
-Canvas::FrameHandle Canvas::frameHitTest(QPointF canvasPoint, QRectF frame) const
+Canvas::FrameHandle Canvas::frameHitTest(QPointF canvasPoint, const QRectF& frame) const
 {
 	FrameHandle result = INSIDE;
 	const double radius = m_doc->guidesPrefs().grabRadius / m_viewMode.scale;
@@ -534,14 +534,14 @@
 	return mp.x()>left && mp.x()<right && mp.y()>top && mp.y()<bottom;
 }
 
-bool Canvas::cursorOverFrameControl(QPoint globalPos, QRectF targetRect, PageItem* frame)
+bool Canvas::cursorOverFrameControl(QPoint globalPos, const QRectF& targetRect, PageItem* frame)
 {
 	FPoint mp = globalToCanvas(globalPos);
 	QRectF tg = targetRect.translated(frame->xPos(), frame->yPos());
 	return tg.contains(QPointF(mp.x(), mp.y()));
 }
 
-PageItem* Canvas::itemInGroup(PageItem* group, QRectF mouseArea) const
+PageItem* Canvas::itemInGroup(PageItem* group, const QRectF& mouseArea) const
 {
 	int currNr = group->groupItemList.count() - 1;
 	while (currNr >= 0)
@@ -1773,7 +1773,7 @@
 	p->restore();
 }
 
-void Canvas::DrawPageBorder(ScPainter *p, QRectF clip, bool master)
+void Canvas::DrawPageBorder(ScPainter *p, const QRectF& clip, bool master)
 {
 	if (master)
 	{
@@ -1835,7 +1835,7 @@
 	p->restore();
 }
 
-void Canvas::DrawPageMargins(ScPainter *p, QRectF clip, bool master)
+void Canvas::DrawPageMargins(ScPainter *p, const QRectF& clip, bool master)
 {
 	if (master)
 	{
@@ -1886,7 +1886,7 @@
 	p->restore();
 }
 
-void Canvas::DrawPageBaselineGrid(ScPainter *p, QRectF clip, bool master)
+void Canvas::DrawPageBaselineGrid(ScPainter *p, const QRectF& clip, bool master)
 {
 	if (!m_doc->guidesPrefs().baselineGridShown)
 		return;
@@ -1920,7 +1920,7 @@
 /**
   draws grid
  */
-void Canvas::DrawPageGridSub(ScPainter *p, ScPage *page, QRectF clip)
+void Canvas::DrawPageGridSub(ScPainter *p, ScPage *page, const QRectF& clip)
 {
 	if (!m_doc->guidesPrefs().gridShown)
 		return;
@@ -2014,7 +2014,7 @@
 	p->restore();
 }
 
-void Canvas::DrawPageGrid(ScPainter *p, QRectF clip, bool master)
+void Canvas::DrawPageGrid(ScPainter *p, const QRectF& clip, bool master)
 {
 	if (!m_doc->guidesPrefs().gridShown)
 		return;
@@ -2065,7 +2065,7 @@
 	p->restore();
 }
 
-void Canvas::DrawPageGuides(ScPainter *p, QRectF clip, bool master)
+void Canvas::DrawPageGuides(ScPainter *p, const QRectF& clip, bool master)
 {
 	if (!m_doc->guidesPrefs().guidesShown)
 		return;
@@ -2118,7 +2118,7 @@
 	p->restore();
 }
 
-void Canvas::DrawPageIndicator(ScPainter *p, QRectF clip, bool master)
+void Canvas::DrawPageIndicator(ScPainter *p, const QRectF& clip, bool master)
 {
 	if (master)
 	{

Modified: trunk/Scribus/scribus/canvas.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22648&path=/trunk/Scribus/scribus/canvas.h
==============================================================================
--- trunk/Scribus/scribus/canvas.h	(original)
+++ trunk/Scribus/scribus/canvas.h	Thu Aug 23 19:12:47 2018
@@ -154,9 +154,9 @@
 	QPoint canvasToGlobal(const FPoint& p) const;
 	QPoint canvasToLocal(QPointF p) const;
 	QPoint canvasToGlobal(QPointF p) const;
-	QRect canvasToLocal(QRectF p) const;
-	QRectF canvasToLocalF(QRectF p) const;
-	QRect canvasToGlobal(QRectF p) const;
+	QRect canvasToLocal(const QRectF& p) const;
+	QRectF canvasToLocalF(const QRectF& p) const;
+	QRect canvasToGlobal(const QRectF& p) const;
 	FPoint localToCanvas(QPoint p) const;
 //	FPoint localToCanvas(QPointF p) const;
 	FPoint globalToCanvas(QPoint p) const;
@@ -168,10 +168,10 @@
 	bool hitsCanvasPoint(const FPoint& globalPoint, const QPointF& canvasPoint) const;
 	QRect exposedRect() const;
 	bool cursorOverTextFrameControl(QPoint globalPos, PageItem* frame);
-	bool cursorOverFrameControl(QPoint globalPos, QRectF targetRect, PageItem* frame);
+	bool cursorOverFrameControl(QPoint globalPos, const QRectF& targetRect, PageItem* frame);
 	/** Returns the framehandle or INSIDE if the position falls into the frame. */
 	FrameHandle frameHitTest(QPointF canvasPoint, PageItem* frame) const;
-	FrameHandle frameHitTest(QPointF point, QRectF frame) const;
+	FrameHandle frameHitTest(QPointF point, const QRectF& frame) const;
 	/**
 		Returns the item under the cursor or nullptr if none found.
 	 Does *not* change the selection.
@@ -181,7 +181,7 @@
 	 (this flag is ignored in masterpage mode, since all items are masterpage items then).
 	 */
 	PageItem* itemUnderCursor(QPoint globalPos, PageItem* itemAbove=nullptr, bool allowInGroup=false, bool allowMasterItems=false) const;
-	PageItem* itemInGroup(PageItem* group, QRectF mouseArea) const;
+	PageItem* itemInGroup(PageItem* group, const QRectF& mouseArea) const;
 	PageItem* itemUnderItem(PageItem* item, int& index) const;
 	
 	const QPolygon& redrawPolygon() const { return m_viewMode.redrawPolygon; }
@@ -220,17 +220,17 @@
 	
 private:
 	void DrawPageBorderSub(ScPainter *p, ScPage *page);
-	void DrawPageBorder(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageBorder(ScPainter *p, const QRectF& clip, bool master = false);
 	void DrawPageMarginsGridSub(ScPainter *p, ScPage *page);
-	void DrawPageMargins(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageMargins(ScPainter *p, const QRectF& clip, bool master = false);
 	void DrawPageBaselineGridSub(ScPainter *p, ScPage *page);
-	void DrawPageBaselineGrid(ScPainter *p, QRectF clip, bool master = false);
-	void DrawPageGridSub(ScPainter *p, ScPage *page, QRectF clip);
-	void DrawPageGrid(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageBaselineGrid(ScPainter *p, const QRectF& clip, bool master = false);
+	void DrawPageGridSub(ScPainter *p, ScPage *page, const QRectF& clip);
+	void DrawPageGrid(ScPainter *p, const QRectF& clip, bool master = false);
 	void DrawPageGuidesSub(ScPainter *p, ScPage *page);
-	void DrawPageGuides(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageGuides(ScPainter *p, const QRectF& clip, bool master = false);
 	void DrawPageIndicatorSub(ScPainter *p, ScPage *page);
-	void DrawPageIndicator(ScPainter *p, QRectF clip, bool master = false);
+	void DrawPageIndicator(ScPainter *p, const QRectF& clip, bool master = false);
 	void drawLinkFrameLine(ScPainter* painter, FPoint &start, FPoint &end);
 	void PaintSizeRect(QRect neu);
 	void PaintSizeRect(QPolygon neu);

Modified: trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22648&path=/trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp	(original)
+++ trunk/Scribus/scribus/plugins/colorwheel/cwdialog.cpp	Thu Aug 23 19:12:47 2018
@@ -413,7 +413,7 @@
 	setupColorComponents();
 }
 
-void CWDialog::setupRGBComponent(ScColor col)
+void CWDialog::setupRGBComponent(const ScColor& col)
 {
 	RGBColor rgb;
 	ScColorEngine::getRGBValues(col, m_Doc, rgb);
@@ -424,7 +424,7 @@
 	connectSlots(true);
 }
 
-void CWDialog::setupCMYKComponent(ScColor col)
+void CWDialog::setupCMYKComponent(const ScColor& col)
 {
 	CMYKColorF cmyk;
 	ScColorEngine::getCMYKValues(col, m_Doc, cmyk);
@@ -436,7 +436,7 @@
 	connectSlots(true);
 }
 
-void CWDialog::setupHSVComponent(ScColor col)
+void CWDialog::setupHSVComponent(const ScColor& col)
 {
 	int h, s, v;
 	QColor qc(ScColorEngine::getRGBColor(col, m_Doc));
@@ -559,7 +559,7 @@
 		currentColorTable->setColumnWidth(i, columnWidth);
 }
 
-QString CWDialog::getHexHsv(ScColor c)
+QString CWDialog::getHexHsv(const ScColor& c)
 {
 	int h, s, v;
 	QColor hsvCol(ScColorEngine::getRGBColor(c, m_Doc));

Modified: trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22648&path=/trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h
==============================================================================
--- trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h	(original)
+++ trunk/Scribus/scribus/plugins/colorwheel/cwdialog.h	Thu Aug 23 19:12:47 2018
@@ -64,16 +64,16 @@
 
 		/*! \brief A GUI setter for all components when is one of CMYK changed.
 		*/
-		void setupRGBComponent(ScColor col);
+		void setupRGBComponent(const ScColor& col);
 
 		/*! \brief A GUI setter for all components when is one of RGB changed.
 		*/
-		void setupCMYKComponent(ScColor col);
+		void setupCMYKComponent(const ScColor& col);
 
 		/*! \brief A GUI setter for all components when is one of HSV changed.
 		It uses a dummy QColor->ScColor conversion
 		*/
-		void setupHSVComponent(ScColor col);
+		void setupHSVComponent(const ScColor& col);
 
 		//! \brief Set named colors for labels
 		void updateNamedLabels();
@@ -94,7 +94,7 @@
 		void processColors(int index, bool updateSpins=true);
 
 		//! \brief Get a #hhssvv string for given ScColor
-		QString getHexHsv(ScColor c);
+		QString getHexHsv(const ScColor& c);
 
 	private slots:
 		void colorspaceTab_currentChanged(int);

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22648&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Thu Aug 23 19:12:47 2018
@@ -2755,7 +2755,7 @@
 	connect(view, SIGNAL(StatusPic()), this, SLOT(StatusPic()), Qt::UniqueConnection);
 	connect(view, SIGNAL(AppendText()), this, SLOT(slotFileAppend()), Qt::UniqueConnection);
 	connect(view, SIGNAL(AnnotProps()), this, SLOT(ModifyAnnot()), Qt::UniqueConnection);
-	connect(view, SIGNAL(LoadElem(QString, double ,double, bool, bool, ScribusDoc *, ScribusView*)), this, SLOT(slotElemRead(QString, double, double, bool, bool, ScribusDoc *, ScribusView*)), Qt::UniqueConnection);
+	connect(view, SIGNAL(LoadElem(QString,double,double,bool,bool,ScribusDoc*,ScribusView*)), this, SLOT(slotElemRead(QString,double,double,bool,bool,ScribusDoc*,ScribusView*)), Qt::UniqueConnection);
 	connect(view, SIGNAL(AddBM(PageItem*)), this, SLOT(AddBookMark(PageItem*)), Qt::UniqueConnection);
 	connect(view, SIGNAL(DelBM(PageItem*)), this, SLOT(DelBookMark(PageItem*)), Qt::UniqueConnection);
 	connect(view, SIGNAL(DoGroup()), this, SLOT(GroupObj()), Qt::UniqueConnection);

Modified: trunk/Scribus/scribus/ui/transparencypalette.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22648&path=/trunk/Scribus/scribus/ui/transparencypalette.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/transparencypalette.cpp	(original)
+++ trunk/Scribus/scribus/ui/transparencypalette.cpp	Thu Aug 23 19:12:47 2018
@@ -53,7 +53,7 @@
 	connect(namedGradient, SIGNAL(activated(const QString &)), this, SLOT(setNamedGradient(const QString &)));
 	connect(gradEdit, SIGNAL(gradientChanged()), this, SIGNAL(gradientChanged()));
 	connect(gradEditButton, SIGNAL(clicked()), this, SLOT(editGradientVector()));
-	connect(TGradDia, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)), this, SIGNAL(NewSpecial(double, double, double, double, double, double, double, double, double, double)));
+	connect(TGradDia, SIGNAL(NewSpecial(double,double,double,double,double,double,double,double,double,double)), this, SIGNAL(NewSpecial(double,double,double,double,double,double,double,double,double,double)));
 	connect(TGradDia, SIGNAL(paletteShown(bool)), this, SLOT(setActiveGradDia(bool)));
 	connect(gradientType, SIGNAL(activated(int)), this, SLOT(slotGradType(int)));
 	connect(tabWidget, SIGNAL(currentChanged(int)), this, SLOT(slotGrad(int)));
@@ -149,7 +149,7 @@
 	this->disconnect(SIGNAL(NewBlend(int)));
 	this->disconnect(SIGNAL(NewBlendS(int)));
 	this->disconnect(SIGNAL(NewPattern(QString)));
-	this->disconnect(SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)));
+	this->disconnect(SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)));
 	
 	if (currentDoc)
 	{
@@ -171,7 +171,7 @@
 		connect(this, SIGNAL(NewBlendS(int)), doc, SLOT(itemSelection_SetItemLineBlend(int)));
 		connect(this, SIGNAL(NewGradient(int)), doc, SLOT(itemSelection_SetItemGradMask(int)));
 		connect(this, SIGNAL(NewPattern(QString)), doc, SLOT(itemSelection_SetItemPatternMask(QString)));
-		connect(this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), doc, SLOT(itemSelection_SetItemPatternMaskProps(double, double, double, double, double, double, double, bool, bool)));
+		connect(this, SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)), doc, SLOT(itemSelection_SetItemPatternMaskProps(double,double,double,double,double,double,double,bool,bool)));
 		connect(doc->scMW(), SIGNAL(UpdateRequest(int)), this, SLOT(handleUpdateRequest(int)));
 	}
 }
@@ -523,7 +523,7 @@
 	dia->spinYSkew->setValue(asinb / (M_PI / 180.0));
 	dia->FlipH->setChecked(m_Pattern_mirrorX);
 	dia->FlipV->setChecked(m_Pattern_mirrorY);
-	connect(dia, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)), this, SIGNAL(NewPatternProps(double, double, double, double, double, double, double, bool, bool)));
+	connect(dia, SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)), this, SIGNAL(NewPatternProps(double,double,double,double,double,double,double,bool,bool)));
 	dia->exec();
 	m_Pattern_scaleX = dia->spinXscaling->value();
 	m_Pattern_scaleY = dia->spinYscaling->value();




More information about the scribus-commit mailing list