r17034 by jghali - fix more warnings (v2) reported by gcc

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 26 23:44:17 UTC 2011


Author: jghali
Date: Sat Nov 26 23:44:17 2011
New Revision: 17034

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17034
Log:
fix more warnings (v2) reported by gcc

Modified:
    trunk/Scribus/scribus/canvasmode_objimport.cpp
    trunk/Scribus/scribus/canvasmode_rotate.cpp
    trunk/Scribus/scribus/pageitem_pathtext.cpp
    trunk/Scribus/scribus/plugins/import/ai/importai.cpp
    trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
    trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
    trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
    trunk/Scribus/scribus/prefsmanager.cpp
    trunk/Scribus/scribus/pslib.cpp
    trunk/Scribus/scribus/scimgdataloader_psd.cpp
    trunk/Scribus/scribus/scpageoutput.cpp

Modified: trunk/Scribus/scribus/canvasmode_objimport.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/canvasmode_objimport.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_objimport.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_objimport.cpp Sat Nov 26 23:44:17 2011
@@ -128,8 +128,6 @@
 
 void CanvasMode_ObjImport::mouseMoveEvent(QMouseEvent *m)
 {
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
-	
 	m->accept();
 
 	if (commonMouseMove(m))
@@ -189,7 +187,6 @@
 
 void CanvasMode_ObjImport::mouseReleaseEvent(QMouseEvent *m)
 {
-	const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
 	m_canvas->m_viewMode.m_MouseButtonPressed = false;
 	m_canvas->resetRenderMode();
 	m->accept();

Modified: trunk/Scribus/scribus/canvasmode_rotate.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/canvasmode_rotate.cpp
==============================================================================
--- trunk/Scribus/scribus/canvasmode_rotate.cpp (original)
+++ trunk/Scribus/scribus/canvasmode_rotate.cpp Sat Nov 26 23:44:17 2011
@@ -197,7 +197,6 @@
 	m_canvasPressCoord = mousePointDoc;
 	
 	double Rxp = 0,  Ryp = 0;
-	double Rxpd = 0, Rypd = 0;
 	PageItem *currItem;
 	m_canvas->PaintSizeRect(QRect());
 	QRect tx;
@@ -210,10 +209,8 @@
 	m_view->registerMousePress(m->globalPos());
 	QRect mpo(m->x()-m_doc->guidesPrefs().grabRadius, m->y()-m_doc->guidesPrefs().grabRadius, m_doc->guidesPrefs().grabRadius*2, m_doc->guidesPrefs().grabRadius*2);
 	Rxp  = m_doc->ApplyGridF(m_canvasPressCoord).x();
-	Rxpd = m_canvasPressCoord.x() - Rxp;
 	m_canvasPressCoord.setX( qRound(Rxp) );
 	Ryp  = m_doc->ApplyGridF(m_canvasPressCoord).y();
-	Rypd = m_canvasPressCoord.y()  - Ryp;
 	m_canvasPressCoord.setY( qRound(Ryp) );
 	if (m->button() == Qt::MidButton)
 	{
@@ -384,15 +381,12 @@
 	m_canvasCurrCoord  = mousePointDoc;
 	m_angleConstrained = false;
 	
-	double newX, newY;
 	PageItem *currItem;
 	QRect tx;
 	m->accept();
 
 	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());
 		m_angleConstrained = ((m->modifiers() & Qt::ControlModifier) != Qt::NoModifier);
 		if (m_view->moveTimerElapsed() && m_canvas->m_viewMode.m_MouseButtonPressed)
 		{
@@ -452,8 +446,6 @@
 	{
 		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());
 			QPoint startP = m_canvas->canvasToGlobal(m_canvasPressCoord);
 			m_view->redrawMarker->setGeometry(QRect(startP, m->globalPos()).normalized());
 			if (!m_view->redrawMarker->isVisible())

Modified: trunk/Scribus/scribus/pageitem_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/pageitem_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_pathtext.cpp (original)
+++ trunk/Scribus/scribus/pageitem_pathtext.cpp Sat Nov 26 23:44:17 2011
@@ -77,7 +77,6 @@
 	firstChar = 0;
 	MaxChars = 0;
 	int a;
-	double chs;
 	QString chstr, chstr2, chstr3;
 	ScText *hl;
 	double dx;
@@ -239,7 +238,6 @@
 		if (chstr[0] == SpecialChars::PAGENUMBER || chstr[0] == SpecialChars::PARSEP || chstr[0] == SpecialChars::PAGECOUNT
 			|| chstr[0] == SpecialChars::TAB || chstr[0] == SpecialChars::LINEBREAK)
 			continue;
-		chs = hl->fontSize();
 		if (a < itemRenderText.length()-1)
 			chstr += itemRenderText.text(a+1, 1);
 		hl->glyph.yadvance = 0;

Modified: trunk/Scribus/scribus/plugins/import/ai/importai.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/ai/importai.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/ai/importai.cpp Sat Nov 26 23:44:17 2011
@@ -2124,10 +2124,6 @@
 			{
 				int indY = meshYSize - currentMeshYPos - 1;
 				int indX = currentMeshXPos;
-				FPoint p2 = FPoint(meshNode1PointX, meshNode1PointY);
-				FPoint p1 = FPoint(meshNode2PointX, meshNode2PointY);
-				FPoint p4 = FPoint(meshNode3PointX, meshNode3PointY);
-				FPoint p3 = FPoint(meshNode4PointX, meshNode4PointY);
 				meshGradientArray[indY+1][indX+1].gridPoint   = FPoint(meshNode2PointX, meshNode2PointY);
 				meshGradientArray[indY+1][indX+1].controlTop  = FPoint(meshNode2Control2X, meshNode2Control2Y);
 				meshGradientArray[indY+1][indX+1].controlLeft = FPoint(meshNode2Control1X, meshNode2Control1Y);

Modified: trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp Sat Nov 26 23:44:17 2011
@@ -1648,12 +1648,12 @@
 		QByteArray data = d.toLatin1();
 		const char *ptr = data.constData();
 		const char *end = data.constData() + data.length() + 1;
-		double contrlx, contrly, curx, cury, subpathx, subpathy, tox, toy, x1, y1, x2, y2, xc, yc;
+		double contrlx, contrly, curx, cury, tox, toy, x1, y1, x2, y2, xc, yc;
 		double px1, py1, px2, py2, px3, py3;
 		bool relative;
 		FirstM = true;
 		char command = *(ptr++), lastCommand = ' ';
-		subpathx = subpathy = curx = cury = contrlx = contrly = 0.0;
+		curx = cury = contrlx = contrly = 0.0;
 		while( ptr < end )
 		{
 			if( *ptr == ' ' )
@@ -1668,8 +1668,8 @@
 					ptr = getCoord( ptr, tox );
 					ptr = getCoord( ptr, toy );
 					WasM = true;
-					subpathx = curx = relative ? curx + tox : tox;
-					subpathy = cury = relative ? cury + toy : toy;
+					curx = relative ? curx + tox : tox;
+					cury = relative ? cury + toy : toy;
 					svgMoveTo(curx, cury );
 					break;
 				}
@@ -1715,8 +1715,6 @@
 			case 'z':
 			case 'Z':
 				{
-//					curx = subpathx;
-//					cury = subpathy;
 					svgClosePath(ite);
 					break;
 				}

Modified: trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp (original)
+++ trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp Sat Nov 26 23:44:17 2011
@@ -492,7 +492,7 @@
 	interactive = (flags & LoadSavePlugin::lfInteractive);
 	importerFlags = flags;
 	cancel = false;
-	double x, y, b, h;
+	double b, h;
 	bool ret = false;
 	QFileInfo fi = QFileInfo(fName);
 	if ( !ScCore->usingGUI() )
@@ -520,8 +520,6 @@
 	else
 		progressDialog = NULL;
 /* Set default Page to size defined in Preferences */
-	x = 0.0;
-	y = 0.0;
 	b = 0.0;
 	h = 0.0;
 	if (progressDialog)

Modified: trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp (original)
+++ trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp Sat Nov 26 23:44:17 2011
@@ -975,12 +975,10 @@
 			}
 		}
 	}
-	double x, y, wide;
+	double wide;
 	QString chstr;
 	for (int a = 0; a < Item->asPathText()->itemRenderText.length(); ++a)
 	{
-		x = 0.0;
-		y = 0.0;
 		ScText *hl = Item->asPathText()->itemRenderText.item(a);
 		const CharStyle& charStyle(Item->asPathText()->itemRenderText.charStyle(a));
 		chstr = Item->asPathText()->itemRenderText.text(a,1);

Modified: trunk/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- trunk/Scribus/scribus/prefsmanager.cpp (original)
+++ trunk/Scribus/scribus/prefsmanager.cpp Sat Nov 26 23:44:17 2011
@@ -1868,7 +1868,6 @@
 	csm.findPaletteLocations();
 	csm.findPalettes();
 	csm.findUserPalettes();
-	ScColor lf = ScColor();
 	QDomNode DOC=elem.firstChild();
 	if (!DOC.namedItem("CheckProfile").isNull())
 		appPrefs.verifierPrefs.checkerPrefsList.clear();

Modified: trunk/Scribus/scribus/pslib.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/pslib.cpp
==============================================================================
--- trunk/Scribus/scribus/pslib.cpp (original)
+++ trunk/Scribus/scribus/pslib.cpp Sat Nov 26 23:44:17 2011
@@ -328,7 +328,6 @@
 bool PSLib::PutInterleavedImageMaskToStream(const QByteArray& image, const QByteArray& mask, bool gray)
 {
 	int pending = 0;
-	int bIndex  = 0;
 	unsigned char bytes[1505];
 	const unsigned char* imageData = (const unsigned char*) image.constData();
 	const unsigned char* maskData  = (const unsigned char*) mask.constData();
@@ -346,7 +345,6 @@
 
 	for (int i = 0; i < pixels; ++i)
 	{
-		bIndex = 4 *i;
 		bytes[pending++] = maskData [i];
 		bytes[pending++] = *imageData++; // cyan/black
 		if (channels > 1)
@@ -2337,11 +2335,7 @@
 								PS_save();
 								PS_translate(0, -(tsz / 10.0));
 								double Ulen = hl->glyph.xadvance;
-								double Upos, Uwid, kern;
-								if (style.effects() & ScStyle_StartOfLine)
-									kern = 0;
-								else
-									kern = style.fontSize() * style.tracking() / 10000.0;
+								double Upos, Uwid;
 								if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
 								{
 									if (style.underlineOffset() != -1)
@@ -2408,11 +2402,7 @@
 								PS_save();
 								PS_translate(0, -(tsz / 10.0));
 								double Ulen = hl->glyph.xadvance;
-								double Upos, Uwid, kern;
-								if (hl->effects() & ScStyle_StartOfLine)
-									kern = 0;
-								else
-									kern = style.fontSize() * style.tracking() / 10000.0;
+								double Upos, Uwid;
 								if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
 								{
 									if (style.strikethruOffset() != -1)
@@ -2485,11 +2475,7 @@
 					{
 						PS_save();
 						double Ulen = hl->glyph.xadvance;
-						double Upos, Uwid, kern;
-						if (style.effects() & ScStyle_StartOfLine)
-							kern = 0;
-						else
-							kern = style.fontSize() * style.tracking() / 10000.0;
+						double Upos, Uwid;
 						if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
 						{
 							if (style.underlineOffset() != -1)
@@ -2562,11 +2548,7 @@
 					{
 						PS_save();
 						double Ulen = hl->glyph.xadvance;
-						double Upos, Uwid, kern;
-						if (hl->effects() & ScStyle_StartOfLine)
-							kern = 0;
-						else
-							kern = style.fontSize() * style.tracking() / 10000.0;
+						double Upos, Uwid;
 						if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
 						{
 							if (style.strikethruOffset() != -1)
@@ -3110,11 +3092,7 @@
 									PS_save();
 									PS_translate(0, -(tsz / 10.0));
 									double Ulen = hl->glyph.xadvance;
-									double Upos, Uwid, kern;
-									if (style.effects() & ScStyle_StartOfLine)
-										kern = 0;
-									else
-										kern = style.fontSize() * style.tracking() / 10000.0;
+									double Upos, Uwid;
 									if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
 									{
 										if (style.underlineOffset() != -1)
@@ -3181,11 +3159,7 @@
 									PS_save();
 									PS_translate(0, -(tsz / 10.0));
 									double Ulen = hl->glyph.xadvance;
-									double Upos, Uwid, kern;
-									if (hl->effects() & ScStyle_StartOfLine)
-										kern = 0;
-									else
-										kern = style.fontSize() * style.tracking() / 10000.0;
+									double Upos, Uwid;
 									if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
 									{
 										if (style.strikethruOffset() != -1)
@@ -3258,11 +3232,7 @@
 						{
 							PS_save();
 							double Ulen = hl->glyph.xadvance;
-							double Upos, Uwid, kern;
-							if (style.effects() & ScStyle_StartOfLine)
-								kern = 0;
-							else
-								kern = style.fontSize() * style.tracking() / 10000.0;
+							double Upos, Uwid;
 							if ((style.underlineOffset() != -1) || (style.underlineWidth() != -1))
 							{
 								if (style.underlineOffset() != -1)
@@ -3335,11 +3305,7 @@
 						{
 							PS_save();
 							double Ulen = hl->glyph.xadvance;
-							double Upos, Uwid, kern;
-							if (hl->effects() & ScStyle_StartOfLine)
-								kern = 0;
-							else
-								kern = style.fontSize() * style.tracking() / 10000.0;
+							double Upos, Uwid;
 							if ((style.strikethruOffset() != -1) || (style.strikethruWidth() != -1))
 							{
 								if (style.strikethruOffset() != -1)
@@ -5061,11 +5027,7 @@
 		{
 	//		double Ulen = cstyle.font().glyphWidth(glyph, cstyle.fontSize()) * glyphs.scaleH;
 			double Ulen = glyphs.xadvance;
-			double Upos, lw, kern;
-			if (cstyle.effects() & ScStyle_StartOfLine)
-				kern = 0;
-			else
-				kern = cstyle.fontSize() * cstyle.tracking() / 10000.0;
+			double Upos, lw;
 			if ((cstyle.underlineOffset() != -1) || (cstyle.underlineWidth() != -1))
 			{
 				if (cstyle.underlineOffset() != -1)
@@ -5194,11 +5156,7 @@
 		{
 			//		double Ulen = cstyle.font().glyphWidth(glyph, cstyle.fontSize()) * glyphs.scaleH;
 			double Ulen = glyphs.xadvance;
-			double Upos, lw, kern;
-			if (cstyle.effects() & 16384)
-				kern = 0;
-			else
-				kern = cstyle.fontSize() * cstyle.tracking() / 10000.0;
+			double Upos, lw;
 			if ((cstyle.strikethruOffset() != -1) || (cstyle.strikethruWidth() != -1))
 			{
 				if (cstyle.strikethruOffset() != -1)

Modified: trunk/Scribus/scribus/scimgdataloader_psd.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/scimgdataloader_psd.cpp
==============================================================================
--- trunk/Scribus/scribus/scimgdataloader_psd.cpp (original)
+++ trunk/Scribus/scribus/scimgdataloader_psd.cpp Sat Nov 26 23:44:17 2011
@@ -135,7 +135,6 @@
 {
 	ScColorMgmtEngine engine(ScCore->defaultEngine);
 	bool isCMYK = false;
-	float xres = 72.0, yres = 72.0;
 	if (!QFile::exists(fn))
 		return false;
 	bool valid = m_imageInfoRecord.isRequest;
@@ -181,8 +180,6 @@
 			m_imageInfoRecord.colorspace = ColorSpaceGray;
 		else if (header.color_mode == CM_DUOTONE)
 			m_imageInfoRecord.colorspace = ColorSpaceDuotone;
-		xres = m_imageInfoRecord.xres;
-		yres = m_imageInfoRecord.yres;
 		f.close();
 		if (thumbnail)
 		{

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17034&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Sat Nov 26 23:44:17 2011
@@ -1192,10 +1192,9 @@
 	FPoint ColBound;
 	QRegion cm;
 	int a;
-	double lineCorr;
 	QString chstr, chstr2, chstr3;
 	ScText *hl;
-	double desc, asce, tabDist;
+	double desc, asce;
 	
 	QRect e2;
 	painter->save();
@@ -1212,10 +1211,6 @@
 		painter->setupPolygon(&item->PoLine);
 		fillPath(item, painter, clip);
 	}
-	if (item->lineColor() != CommonStrings::None)
-		lineCorr = item->lineWidth() / 2.0;
-	else
-		lineCorr = 0;
 	if ((item->isAnnotation()) && (item->annotation().Type() == 2) && (!item->Pfile.isEmpty()) && (item->PictureIsAvailable) && (item->imageShown()) && (item->annotation().UseIcons()))
 	{
 		painter->save();
@@ -1243,7 +1238,6 @@
 		for (uint ll=0; ll < item->itemText.lines(); ++ll)
 		{
 			LineSpec ls = item->itemText.line(ll);
-			tabDist = ls.x;
 			double CurX = ls.x;
 			for (a = ls.firstItem; a <= ls.lastItem; ++a)
 			{
@@ -1307,7 +1301,6 @@
 					else*/
 					CurX += hl->glyph.wide();
 				}
-				tabDist = CurX;
 			}
 		}
 	}




More information about the scribus-commit mailing list