r17033 by jghali - fix more warnings reported by gcc

scribus-commit scribus-commit at lists.scribus.net
Sat Nov 26 21:57:20 UTC 2011


Author: jghali
Date: Sat Nov 26 21:57:19 2011
New Revision: 17033

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

Modified:
    trunk/Scribus/scribus/pageitem_pathtext.cpp
    trunk/Scribus/scribus/scpageoutput.cpp
    trunk/Scribus/scribus/ui/prefs_guides.cpp

Modified: trunk/Scribus/scribus/pageitem_pathtext.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17033&path=/trunk/Scribus/scribus/pageitem_pathtext.cpp
==============================================================================
--- trunk/Scribus/scribus/pageitem_pathtext.cpp (original)
+++ trunk/Scribus/scribus/pageitem_pathtext.cpp Sat Nov 26 21:57:19 2011
@@ -84,7 +84,6 @@
 	FPoint point = FPoint(0, 0);
 	FPoint tangent = FPoint(0, 0);
 	uint seg = 0;
-	double segLen = 0;
 	QColor tmp;
 	CurX = Extra;
 	QString cachedStroke = "";
@@ -176,7 +175,6 @@
 		CurX += itemText.charStyle(0).fontSize() * itemText.charStyle(0).tracking() / 10000.0;
 		totalTextLen += itemText.charStyle(0).fontSize() * itemText.charStyle(0).tracking() / 10000.0;
 	}
-	segLen = PoLine.lenPathSeg(seg);
 	itemRenderText.setDefaultStyle(itemText.defaultStyle());
 	itemRenderText.clear();
 	for (a = firstChar; a < itemText.length(); ++a)

Modified: trunk/Scribus/scribus/scpageoutput.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17033&path=/trunk/Scribus/scribus/scpageoutput.cpp
==============================================================================
--- trunk/Scribus/scribus/scpageoutput.cpp (original)
+++ trunk/Scribus/scribus/scpageoutput.cpp Sat Nov 26 21:57:19 2011
@@ -903,11 +903,9 @@
 	FPoint point = FPoint(0, 0);
 	FPoint tangent = FPoint(0, 0);
 	uint seg = 0;
-	double chs, dx, segLen = 0;
 	double CurX = item->textToFrameDistLeft(); // item->CurX = item->textToFrameDistLeft()
-	double CurY = 0;
 	QString actFill, actStroke;
-	double actFillShade, actStrokeShade;
+	double actFillShade, actStrokeShade, dx;
 	StoryText& itemText = item->itemText;
 	if (item->pathTextShowFrame())
 	{
@@ -942,7 +940,6 @@
 		CurX += itemText.item(0)->fontSize() * itemText.charStyle(0).tracking() / 10000.0;
 		totalTextLen += itemText.charStyle(0).fontSize() * itemText.charStyle(0).tracking() / 10000.0;
 	}
-	segLen = item->PoLine.lenPathSeg(seg);
 	for (int a = 0; a < itemText.length(); ++a)
 	{
 		hl = itemText.item(a);
@@ -983,13 +980,11 @@
 	int currPathIndex = 0;
 	for (int a = item->firstInFrame(); a < itemText.length(); ++a)
 	{
-		CurY = 0;
 		hl = itemText.item(a);
 		chstr = hl->ch;
 		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 < itemText.length()-1)
 			chstr += itemText.text(a+1, 1);
 		hl->glyph.yadvance = 0;

Modified: trunk/Scribus/scribus/ui/prefs_guides.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17033&path=/trunk/Scribus/scribus/ui/prefs_guides.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_guides.cpp (original)
+++ trunk/Scribus/scribus/ui/prefs_guides.cpp Sat Nov 26 21:57:19 2011
@@ -44,7 +44,7 @@
 	int renderStackCount = renderStackOrder.count();
 	for (int r = renderStackCount - 1; r > -1; r--)
 	{
-		QListWidgetItem *item;
+		QListWidgetItem *item(0);
 		int it = renderStackOrder[r];
 		if (it == 4)
 			item = new QListWidgetItem( tr("Content Objects"), guidePlacementListBox);
@@ -56,8 +56,11 @@
 			item = new QListWidgetItem( tr("Baseline Grid"), guidePlacementListBox);
 		else if (it == 0)
 			item = new QListWidgetItem( tr("Margins"), guidePlacementListBox);
-		item->setData(Qt::UserRole, it);
-		item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+		if (item)
+		{
+			item->setData(Qt::UserRole, it);
+			item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+		}
 	}
 	int grTy = gridTypeCombo->currentIndex();
 	gridTypeCombo->clear();




More information about the scribus-commit mailing list