r20991 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Fri Feb 12 00:30:05 UTC 2016


Author: jghali
Date: Fri Feb 12 00:30:05 2016
New Revision: 20991

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20991
Log:
coverity #1350611: uninitialized pointer field

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

Modified: trunk/Scribus/scribus/ui/storyeditor.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20991&path=/trunk/Scribus/scribus/ui/storyeditor.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.cpp	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.cpp	Fri Feb 12 00:30:05 2016
@@ -116,10 +116,12 @@
 	setAutoFillBackground(true);
 	setPalette(pal);
 	offs = 0;
+	currentPar = 0;
 	editor = 0;
 	noUpdt = true;
 	inRep = false;
 	pmen = new QMenu(this);
+	paraStyleAct = NULL;
 	setMinimumWidth(fontMetrics().width( tr("No Style") )+30);
 }
 
@@ -128,7 +130,7 @@
 	QPoint globalPos = m->globalPos();
 	QPoint viewPos   = editor->viewport()->mapFromGlobal(globalPos);
 	int p = editor->cursorForPosition(QPoint(2, viewPos.y())).position();
-	CurrentPar = editor->StyledText.nrOfParagraph(p);
+	currentPar = editor->StyledText.nrOfParagraph(p);
 	int pos = editor->StyledText.startOfParagraph( editor->StyledText.nrOfParagraph(p) );
 
 	pmen->clear();
@@ -136,9 +138,9 @@
 	QString styleName = "";
 	ParaStyleComboBox* paraStyleCombo = new ParaStyleComboBox(pmen);
 	paraStyleCombo->setDoc(editor->doc);
-	if ((CurrentPar < static_cast<int>(editor->StyledText.nrOfParagraphs())) && (editor->StyledText.length() != 0))
-	{
-		int len = editor->StyledText.endOfParagraph(CurrentPar) - editor->StyledText.startOfParagraph(CurrentPar);
+	if ((currentPar < static_cast<int>(editor->StyledText.nrOfParagraphs())) && (editor->StyledText.length() != 0))
+	{
+		int len = editor->StyledText.endOfParagraph(currentPar) - editor->StyledText.startOfParagraph(currentPar);
 		if (len > 0)
 			styleName = editor->StyledText.paragraphStyle(pos).parent(); //FIXME ParaStyleComboBox and use localized style name
 	}
@@ -158,7 +160,7 @@
 
 void SideBar::setPStyle(const QString& name)
 {
-	emit ChangeStyle(CurrentPar, name);
+	emit ChangeStyle(currentPar, name);
 	pmen->close();
 }
 

Modified: trunk/Scribus/scribus/ui/storyeditor.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20991&path=/trunk/Scribus/scribus/ui/storyeditor.h
==============================================================================
--- trunk/Scribus/scribus/ui/storyeditor.h	(original)
+++ trunk/Scribus/scribus/ui/storyeditor.h	Fri Feb 12 00:30:05 2016
@@ -191,7 +191,7 @@
 	SideBar(QWidget *pa);
 	~SideBar() {};
 	int offs;
-	int CurrentPar;
+	int currentPar;
 	SEditor *editor;
 	QMenu *pmen;
 	QWidgetAction* paraStyleAct;




More information about the scribus-commit mailing list