r20884 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Tue Feb 2 21:48:44 UTC 2016


Author: jghali
Date: Tue Feb  2 21:48:43 2016
New Revision: 20884

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20884
Log:
coverity #1350723: uninitialized scalar field

Modified:
    trunk/Scribus/scribus/ui/prefs_documentsections.cpp
    trunk/Scribus/scribus/ui/prefs_documentsections.h

Modified: trunk/Scribus/scribus/ui/prefs_documentsections.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20884&path=/trunk/Scribus/scribus/ui/prefs_documentsections.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsections.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_documentsections.cpp	Tue Feb  2 21:48:43 2016
@@ -17,7 +17,7 @@
 
 Prefs_DocumentSections::Prefs_DocumentSections(QWidget* parent, ScribusDoc* doc)
 	: Prefs_Pane(parent),
-	m_doc(doc)
+	m_doc(doc), m_maxPageIndex(0)
 {
 	setupUi(this);
 	languageChange();
@@ -37,7 +37,7 @@
 void Prefs_DocumentSections::restoreDefaults(struct ApplicationPrefs *prefsData)
 {
 	localSections=prefsData->docSectionMap;
-	m_maxpageindex=m_doc->DocPages.count()-1;
+	m_maxPageIndex=m_doc->DocPages.count()-1;
 	styles.clear();
 	styles=getFormatListTr();
 	styles << CommonStrings::tr_None;
@@ -125,7 +125,7 @@
 	case 3:
 	case 4:
 		// Validate to/from page specification before conversion to an index
-		//!!!	There is still a problem here if m_maxpageindex == MAX_UINT ;)
+		//!!!	There is still a problem here if m_maxPageIndex == MAX_UINT ;)
 		newDocPageSpec=sectionsTable->item(row, col)->text().toUInt();
 		if (newDocPageSpec==0)
 		{
@@ -133,9 +133,9 @@
 			outOfRange=true;
 		}
 		else
-		if (newDocPageSpec>m_maxpageindex+1)
-		{
-			newDocPageSpec=m_maxpageindex+1;
+		if (newDocPageSpec>m_maxPageIndex+1)
+		{
+			newDocPageSpec=m_maxPageIndex+1;
 			outOfRange=true;
 		}
 		// Now, since newDocPageSpec >= 1, convert to index
@@ -181,7 +181,7 @@
 	if (outOfRange)
 	{
 		updateTable();
-		ScMessageBox::warning(parentWidget(), tr("Page Number Out Of Bounds"),"<qt>"+ tr("The value you have entered is outside the range of page numbers in the current document (%1-%2).").arg(1).arg(m_maxpageindex+1)+"</qt>");
+		ScMessageBox::warning(parentWidget(), tr("Page Number Out Of Bounds"),"<qt>"+ tr("The value you have entered is outside the range of page numbers in the current document (%1-%2).").arg(1).arg(m_maxPageIndex+1)+"</qt>");
 	}
 }
 
@@ -206,8 +206,8 @@
 		uint count=localSections.count();
 		blank.number=count;
 		blank.name=QString::number(count);
-		blank.fromindex=m_maxpageindex+1;
-		blank.toindex=m_maxpageindex+1;
+		blank.fromindex=m_maxPageIndex+1;
+		blank.toindex=m_maxPageIndex+1;
 		blank.type=Type_1_2_3;
 		blank.sectionstartindex=1;
 		blank.reversed=false;
@@ -286,7 +286,7 @@
 		int newCount=localSections.count();
 		//int preIndex=qMax(currentIndex-1, 0);
 		localSections[0].fromindex=0;
-		localSections[newCount-1].toindex=m_maxpageindex;
+		localSections[newCount-1].toindex = m_maxPageIndex;
 		updateTable();
 	}
 }

Modified: trunk/Scribus/scribus/ui/prefs_documentsections.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20884&path=/trunk/Scribus/scribus/ui/prefs_documentsections.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsections.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_documentsections.h	Tue Feb  2 21:48:43 2016
@@ -30,7 +30,7 @@
 
 	protected:
 		DocumentSectionMap localSections;
-		uint m_maxpageindex;
+		uint m_maxPageIndex;
 		QStringList styles;
 		ScribusDoc* m_doc;
 		virtual void updateTable();




More information about the scribus-commit mailing list