r23177 by jghali - #15802: fix a few warnings about unused variables

scribus-commit scribus-commit at lists.scribus.net
Wed Sep 4 14:34:34 UTC 2019


Author: jghali
Date: Wed Sep  4 14:34:34 2019
New Revision: 23177

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=23177
Log:
#15802: fix a few warnings about unused variables

Modified:
    trunk/Scribus/scribus/canvasgesture_rulermove.cpp
    trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
    trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/canvasgesture_rulermove.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23177&path=/trunk/Scribus/scribus/canvasgesture_rulermove.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasgesture_rulermove.cpp	(original)
+++ trunk/Scribus/scribus/canvasgesture_rulermove.cpp	Wed Sep  4 14:34:34 2019
@@ -207,7 +207,7 @@
 				{
 					double xout = 0;
 					double yout = 0;
-					m_doc->getClosestElementBorder(x, y, &xout, &yout, currentPage, ScribusDoc::IncludeSelection);
+					m_doc->getClosestElementBorder(x, y, &xout, &yout, ScribusDoc::IncludeSelection);
 					if (yout != y)
 					{
 						y = yout;
@@ -275,7 +275,7 @@
 				{
 					double xout = 0;
 					double yout = 0;
-					m_doc->getClosestElementBorder(x, y, &xout, &yout, currentPage, ScribusDoc::IncludeSelection);
+					m_doc->getClosestElementBorder(x, y, &xout, &yout, ScribusDoc::IncludeSelection);
 					if (xout != x)
 					{
 						x = xout;

Modified: trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23177&path=/trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawcalligraphic.cpp	Wed Sep  4 14:34:34 2019
@@ -99,7 +99,6 @@
 {
 	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
 	
-	double newX, newY;
 	PageItem *currItem;
 	FPoint npf, npf2;
 //	QRect tx;
@@ -139,9 +138,6 @@
 	
 	if (GetItem(&currItem))
 	{
-		newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
-		newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
-		
 		if (m_doc->DragP)
 			return;
 				
@@ -165,8 +161,6 @@
 	{
 		if ((m_mouseButtonPressed) && (m->buttons() & Qt::LeftButton))
 		{
-			newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
-			newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
 			QPoint startP = m_canvas->canvasToGlobal(QPointF(m_xp, m_yp));
 			m_view->redrawMarker->setGeometry(QRect(m_view->mapFromGlobal(startP), m_view->mapFromGlobal(m->globalPos())).normalized());
 			m_view->setRedrawMarkerShown(true);
@@ -182,7 +176,6 @@
 	double Rxp = 0;
 	double Ryp = 0;
 	FPoint npf, npf2;
-//	QRect tx;
 	QTransform pm;
 
 	m_mouseButtonPressed = true;

Modified: trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23177&path=/trunk/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_drawfreehand.cpp	(original)
+++ trunk/Scribus/scribus/canvasmode_drawfreehand.cpp	Wed Sep  4 14:34:34 2019
@@ -94,7 +94,6 @@
 void FreehandMode::mouseMoveEvent(QMouseEvent *m)
 {
 	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	double newX, newY;
 	PageItem *currItem;
 	FPoint npf, npf2;
 //	QRect tx;
@@ -125,9 +124,6 @@
 	}
 	if (GetItem(&currItem))
 	{
-		newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
-		newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
-		
 		if (m_doc->DragP)
 			return;
 				
@@ -151,8 +147,6 @@
 	{
 		if ((m_mouseButtonPressed) && (m->buttons() & Qt::LeftButton))
 		{
-			newX = qRound(mousePointDoc.x()); //m_view->translateToDoc(m->x(), m->y()).x());
-			newY = qRound(mousePointDoc.y()); //m_view->translateToDoc(m->x(), m->y()).y());
 			QPoint startP = m_canvas->canvasToGlobal(QPointF(m_xp, m_yp));
 			m_view->redrawMarker->setGeometry(QRect(m_view->mapFromGlobal(startP), m_view->mapFromGlobal(m->globalPos())).normalized());
 			m_view->setRedrawMarkerShown(true);

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23177&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Wed Sep  4 14:34:34 2019
@@ -13944,11 +13944,10 @@
 	}
 }
 
-void ScribusDoc::getClosestElementBorder(double xin, double yin, double *xout, double *yout, ScPage* refPage, SelectionSkipBehavior behavior)
+void ScribusDoc::getClosestElementBorder(double xin, double yin, double *xout, double *yout, SelectionSkipBehavior behavior)
 {
 	int gxM = -1;
 	int gyM = -1;
-	ScPage* page = (refPage == nullptr) ? currentPage() : refPage;
 	QMap<double, uint> tmpGuidesSel;
 	double viewScale = m_View->scale();
 	const double snappingDistance = prefsData().guidesPrefs.guideRad / viewScale;
@@ -14075,10 +14074,10 @@
 void ScribusDoc::SnapToGuides(PageItem *currItem)
 {
 	int pg = OnPage(currItem);
-	double xout, yout;
 	if (pg == -1)
 		return;
-	ScPage* page = Pages->at(pg);
+
+	double xout, yout;
 
 	getClosestGuides(0, currItem->yPos(), &xout, &yout);
 	if (currItem->yPos() != yout)
@@ -14136,7 +14135,7 @@
 		if (!elementSnap)
 			getClosestGuides(*x, *y, &xout, &yout, page);
 		else
-			getClosestElementBorder(*x, *y, &xout, &yout, page, ExcludeSelection);
+			getClosestElementBorder(*x, *y, &xout, &yout, ExcludeSelection);
 
 		if ((*x != xout) || (*y != yout))
 			ret = true;

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=23177&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Wed Sep  4 14:34:34 2019
@@ -1187,7 +1187,7 @@
 	//! \brief Get the closest guide to the given point
 	void getClosestGuides(double xin, double yin, double *xout, double *yout, ScPage* refPage = nullptr);
 	//! \brief Get the closest border of another element to the given point
-	void getClosestElementBorder(double xin, double yin, double *xout, double *yout, ScPage* refPage = nullptr, SelectionSkipBehavior behavior = IncludeSelection);
+	void getClosestElementBorder(double xin, double yin, double *xout, double *yout, SelectionSkipBehavior behavior = IncludeSelection);
 	//! \brief Get the closest page margin or bleed
 	void getClosestPageBoundaries(const double xin, const double yin, double &xout, double &yout, ScPage* refPage);
 	//! \brief Snap an item to the guides




More information about the scribus-commit mailing list