r16819 by jghali - cleanup of unused variables and dead code in various canvas modes

scribus-commit scribus-commit at lists.scribus.net
Tue Sep 6 22:04:49 UTC 2011


Author: jghali
Date: Tue Sep  6 22:04:49 2011
New Revision: 16819

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=16819
Log:
cleanup of unused variables and dead code in various canvas modes

Modified:
    branches/Version135/Scribus/scribus/canvasmode_drawbezier.cpp
    branches/Version135/Scribus/scribus/canvasmode_drawbezier.h
    branches/Version135/Scribus/scribus/canvasmode_drawfreehand.cpp
    branches/Version135/Scribus/scribus/canvasmode_drawfreehand.h
    branches/Version135/Scribus/scribus/canvasmode_normal.cpp
    branches/Version135/Scribus/scribus/canvasmode_normal.h

Modified: branches/Version135/Scribus/scribus/canvasmode_drawbezier.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16819&path=/branches/Version135/Scribus/scribus/canvasmode_drawbezier.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_drawbezier.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_drawbezier.cpp Tue Sep  6 22:04:49 2011
@@ -61,13 +61,9 @@
 
 BezierMode::BezierMode(ScribusView* view) : CanvasMode(view) 
 {
-	GxM = GyM = -1;
 	Mxp = Myp = -1;
 	Dxp = Dyp = -1;
 	MoveGX = MoveGY = false;
-	oldCp = Cp = -1;
-	frameResizeHandle = -1;
-	RotMode = 0;
 	inItemCreation = false;
 	shiftSelItems = false;
 	FirstPoly = true;
@@ -142,13 +138,9 @@
 void BezierMode::activate(bool flag)
 {
 //	qDebug() << "DrawBezierMode::activate" << flag;
-	GxM = GyM = -1;
 	Mxp = Myp = -1;
 	Dxp = Dyp = -1;
 	MoveGX = MoveGY = false;
-	oldCp = Cp = -1;
-	frameResizeHandle = -1;
-	RotMode = 0;
 	inItemCreation = false;
 	shiftSelItems = false;
 	FirstPoly = true;
@@ -250,7 +242,7 @@
 		}
 		else
 		{
-			if ((m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton) && (GyM == -1) && (GxM == -1))
+			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());

Modified: branches/Version135/Scribus/scribus/canvasmode_drawbezier.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16819&path=/branches/Version135/Scribus/scribus/canvasmode_drawbezier.h
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_drawbezier.h (original)
+++ branches/Version135/Scribus/scribus/canvasmode_drawbezier.h Tue Sep  6 22:04:49 2011
@@ -52,14 +52,9 @@
 	void selectPage(QMouseEvent *m);
 
 	UndoTransaction* m_createTransaction;
-	int Cp, oldCp;
 	bool inItemCreation, shiftSelItems, FirstPoly;
 	bool m_MouseButtonPressed;
-	int frameResizeHandle;
-	int RotMode;
-	int dragConstrainInitPtX, dragConstrainInitPtY;
 	double Mxp, Myp, Dxp, Dyp;
-	int GxM, GyM;
 	double SeRx, SeRy;
 	bool MoveGX, MoveGY;
 	FPointArray RecordP;

Modified: branches/Version135/Scribus/scribus/canvasmode_drawfreehand.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16819&path=/branches/Version135/Scribus/scribus/canvasmode_drawfreehand.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_drawfreehand.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_drawfreehand.cpp Tue Sep  6 22:04:49 2011
@@ -62,16 +62,12 @@
 
 FreehandMode::FreehandMode(ScribusView* view) : CanvasMode(view) 
 {
-	GxM = GyM = -1;
 	Mxp = Myp = -1;
 	Dxp = Dyp = -1;
 	MoveGX = MoveGY = false;
-	oldCp = Cp = -1;
 	frameResizeHandle = -1;
-	RotMode = 0;
 	inItemCreation = false;
 	shiftSelItems = false;
-	FirstPoly = true;
 }
 
 
@@ -111,16 +107,12 @@
 void FreehandMode::activate(bool flag)
 {
 //	qDebug() << "FreehandMode::activate" << flag;
-	GxM = GyM = -1;
 	Mxp = Myp = -1;
 	Dxp = Dyp = -1;
 	MoveGX = MoveGY = false;
-	oldCp = Cp = -1;
 	frameResizeHandle = -1;
-	RotMode = 0;
 	inItemCreation = false;
 	shiftSelItems = false;
-	FirstPoly = true;
 	setModeCursor();
 }
 
@@ -227,7 +219,7 @@
 	}
 	else
 	{
-		if ((m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton) && (GyM == -1) && (GxM == -1))
+		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());

Modified: branches/Version135/Scribus/scribus/canvasmode_drawfreehand.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16819&path=/branches/Version135/Scribus/scribus/canvasmode_drawfreehand.h
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_drawfreehand.h (original)
+++ branches/Version135/Scribus/scribus/canvasmode_drawfreehand.h Tue Sep  6 22:04:49 2011
@@ -49,14 +49,10 @@
 	inline bool GetItem(PageItem** pi); 
 	void selectPage(QMouseEvent *m);
 
-	int Cp, oldCp;
-	bool inItemCreation, shiftSelItems, FirstPoly;
+	bool inItemCreation, shiftSelItems;
 	bool m_MouseButtonPressed;
 	int frameResizeHandle;
-	int RotMode;
-	int dragConstrainInitPtX, dragConstrainInitPtY;
 	double Mxp, Myp, Dxp, Dyp;
-	int GxM, GyM;
 	double SeRx, SeRy;
 	bool MoveGX, MoveGY;
 	FPointArray RecordP;

Modified: branches/Version135/Scribus/scribus/canvasmode_normal.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16819&path=/branches/Version135/Scribus/scribus/canvasmode_normal.cpp
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_normal.cpp (original)
+++ branches/Version135/Scribus/scribus/canvasmode_normal.cpp Tue Sep  6 22:04:49 2011
@@ -67,8 +67,6 @@
 
 CanvasMode_Normal::CanvasMode_Normal(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW) 
 {
-	GxM = GyM = -1;
-	MoveGX = MoveGY = false;
 	frameResizeHandle = -1;
 	shiftSelItems = false;
 	resizeGesture = NULL;
@@ -130,8 +128,6 @@
 	m_mouseCurrentPoint.setXY(0, 0);
 	m_mouseSavedPoint.setXY(0, 0);
 	m_objectDeltaPos.setXY(0,0 );
-	GxM = GyM = -1;
-	MoveGX = MoveGY = false;
 	frameResizeHandle = -1;
 	shiftSelItems = false;
 	setModeCursor();
@@ -596,7 +592,7 @@
 	}
 	else
 	{
-		if ((m_canvas->m_viewMode.m_MouseButtonPressed) && (m->buttons() & Qt::LeftButton) && (GyM == -1) && (GxM == -1))
+		if ((m_canvas->m_viewMode.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());
@@ -625,7 +621,7 @@
 	m_view->HaveSelRect = false;
 	m_doc->DragP = false;
 	m_doc->leaveDrag = false;
-	MoveGX = MoveGY = false;
+
 	m->accept();
 	m_view->registerMousePress(m->globalPos());
 	QRect mpo(m->x()-m_doc->guidesSettings.grabRad, m->y()-m_doc->guidesSettings.grabRad, m_doc->guidesSettings.grabRad*2, m_doc->guidesSettings.grabRad*2);
@@ -1299,57 +1295,6 @@
 // 			m_view->startGesture(guideMoveGesture);
 			guideMoveGesture->mouseSelectGuide(m);
 		}
-/*		GxM = -1;
-		GyM = -1;
-		QMap<double, uint> tmpGuidesSel;
-		Guides tmpGuides = m_doc->currentPage()->guides.horizontals(GuideManagerCore::Standard);
-		Guides::iterator it;
-		uint yg = 0;
-		uint xg = 0;
-		double lowX = ((m->x() - m_doc->guidesSettings.grabRad) / m_canvas->scale()) + 0*m_doc->minCanvasCoordinate.x();
-		double highX = ((m->x() + m_doc->guidesSettings.grabRad) / m_canvas->scale()) + 0*m_doc->minCanvasCoordinate.x();
-		double lowY = ((m->y() - m_doc->guidesSettings.grabRad) / m_canvas->scale()) + 0*m_doc->minCanvasCoordinate.y();
-		double highY = ((m->y() + m_doc->guidesSettings.grabRad) / m_canvas->scale()) + 0*m_doc->minCanvasCoordinate.y();
-		for (it = tmpGuides.begin(); it != tmpGuides.end(); ++it, ++yg)
-		{
-			if (((*it) + m_doc->currentPage()->yOffset() < highY) && ((*it)+m_doc->currentPage()->yOffset() > lowY))
-				tmpGuidesSel.insert(fabs(((*it)+m_doc->currentPage()->yOffset()) - MypS), yg);
-		}
-		if (tmpGuidesSel.count() != 0)
-		{
-			GyM = tmpGuidesSel.begin().value();
-			QPoint py = m_view->viewport()->mapFromGlobal(m->globalPos());
-			m_view->DrHY = py.y();
-		}
-		tmpGuidesSel.clear();
-		tmpGuides = m_doc->currentPage()->guides.verticals(GuideManagerCore::Standard);
-		for (it = tmpGuides.begin(); it != tmpGuides.end(); ++it, ++xg)
-		{
-			if (((*it) + m_doc->currentPage()->xOffset() < highX) && ((*it)+m_doc->currentPage()->xOffset() > lowX))
-				tmpGuidesSel.insert(fabs(((*it)+m_doc->currentPage()->xOffset()) - MypS), xg);
-		}
-		if (tmpGuidesSel.count() != 0)
-		{
-			GxM = tmpGuidesSel.begin().value();
-			QPoint py = m_view->viewport()->mapFromGlobal(m->globalPos());
-			m_view->DrVX = py.x();
-		}
-		if (GxM!=-1 || GyM!=-1)
-		{
-			if (GxM==-1)
-			{
-				// Horizontal Guide
-				MoveGY = true;
-//FIXME:av				emit signalGuideInformation(0, qRound(m_doc->currentPage()->guides.horizontal(GyM, GuideManagerCore::Standard) * 10000.0) / 10000.0);
-			}
-			else
-			{
-				// Vertical Guide
-				MoveGX = true;
-//FIXME:av				emit signalGuideInformation(1, qRound(m_doc->currentPage()->guides.vertical(GxM, GuideManagerCore::Standard) * 10000.0) / 10000.0);
-			}
-		}
-		*/
 	}
 	//m_doc->m_Selection->setIsGUISelection(true);
 	m_doc->m_Selection->connectItemToGUI();

Modified: branches/Version135/Scribus/scribus/canvasmode_normal.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=16819&path=/branches/Version135/Scribus/scribus/canvasmode_normal.h
==============================================================================
--- branches/Version135/Scribus/scribus/canvasmode_normal.h (original)
+++ branches/Version135/Scribus/scribus/canvasmode_normal.h Tue Sep  6 22:04:49 2011
@@ -63,10 +63,9 @@
 	FPoint m_objectDeltaPos;
 
 	bool shiftSelItems;
-	bool MoveGX, MoveGY;
 	int  frameResizeHandle;
 	int  dragConstrainInitPtX, dragConstrainInitPtY;
-	int  GxM, GyM;
+
 	ScribusMainWindow* m_ScMW;
 	ResizeGesture* resizeGesture;
 	LineMove* lineMoveGesture;




More information about the scribus-commit mailing list