r19999 by craig - #13007: Fix crash, comment out unused function, use langmgr instead, rename some variables

scribus-commit scribus-commit at lists.scribus.net
Sun Apr 12 17:16:16 UTC 2015


Author: craig
Date: Sun Apr 12 17:16:16 2015
New Revision: 19999

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=19999
Log:
#13007: Fix crash, comment out unused function, use langmgr instead, rename some variables

Modified:
    trunk/Scribus/scribus/ui/smcstylewidget.cpp
    trunk/Scribus/scribus/ui/smcstylewidget.h
    trunk/Scribus/scribus/ui/smlinestylewidget.cpp
    trunk/Scribus/scribus/ui/smlinestylewidget.h
    trunk/Scribus/scribus/ui/smpstylewidget.cpp
    trunk/Scribus/scribus/ui/smpstylewidget.h

Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19999&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp Sun Apr 12 17:16:16 2015
@@ -121,13 +121,13 @@
 // 	tracking_->setSuffix( tr(" %"));
 	fontSize_->setSuffix(unitGetSuffixFromIndex(0));
 }
-
+/*
 void SMCStyleWidget::fillLangCombo(QMap<QString,QString> langMap)
 {
 	QStringList sortList;
 	QMap<QString,QString>::Iterator it;
 
-	langMap_ = langMap;
+	m_langMap = langMap;
 
 	language_->clear();
 
@@ -141,7 +141,7 @@
 	if (tmpWidth > 0)
 		tmpView->setMinimumWidth(tmpWidth + 24);
 }
-
+*/
 void SMCStyleWidget::fillLangComboFromList(QStringList langList)
 {
 	language_->clear();
@@ -560,7 +560,6 @@
 		else
 			s = cstyles[i]->language();
 	}
-
 	if (s.isEmpty())
 	{
 		if (language_->itemText(language_->count() - 1) != "")
@@ -568,10 +567,7 @@
 		language_->setCurrentIndex(language_->count() - 1);
 	}
 	else
-	{
-		Q_ASSERT(langMap_.contains(s));
-		setCurrentComboItem(language_, langMap_[s]);
-	}
+		setCurrentComboItem(language_, LanguageManager::instance()->getLangFromAbbrev(s));
 }
 
 void SMCStyleWidget::showParent(const QList<CharStyle*> &cstyles)

Modified: trunk/Scribus/scribus/ui/smcstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19999&path=/trunk/Scribus/scribus/ui/smcstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.h Sun Apr 12 17:16:16 2015
@@ -26,14 +26,14 @@
 
 	void show(CharStyle *cstyle, QList<CharStyle> &cstyles, const QString &defLang, int unitIndex);
 	void show(QList<CharStyle*> &cstyles, QList<CharStyle> &cstylesAll, const QString &defLang, int unitIndex);
-	void fillLangCombo(QMap<QString,QString> langMap);
+	//void fillLangCombo(QMap<QString,QString> langMap);
 	void fillLangComboFromList(QStringList langList);
 	void fillColorCombo(ColorList &colors);
 	void languageChange();
 	void clearAll();
 
 private:
-	QMap<QString, QString> langMap_;
+	QMap<QString, QString> m_langMap;
 
 	void showSizeAndPosition(const QList<CharStyle*> &cstyles);
 	void showEffects(const QList<CharStyle*> &cstyles);

Modified: trunk/Scribus/scribus/ui/smlinestylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19999&path=/trunk/Scribus/scribus/ui/smlinestylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smlinestylewidget.cpp Sun Apr 12 17:16:16 2015
@@ -77,10 +77,10 @@
 {
 // 	disconnect(lineStyles, SIGNAL(highlighted(int)), this, SLOT(slotEditNewLine(int)));
 	disconnect(lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotEditNewLine(int)));
-	currentStyle = lineStyle;
+	m_currentStyle = lineStyle;
 	colorCombo->clear();
 	colorCombo->updateBox(colorList, ColorCombo::fancyPixmaps, false);
-	colors = colorList;
+	m_colors = colorList;
 	updateLineList();
 	slotEditNewLine(subLine);
 	connect(lineStyles, SIGNAL(currentRowChanged(int)), this, SLOT(slotEditNewLine(int)));
@@ -94,17 +94,17 @@
 
 	// JG #5876 protect against broken line styles 
 	// JG #6099 no current item selected
-	if (currentStyle.count() <= i || (i < 0))
+	if (m_currentStyle.count() <= i || (i < 0))
 		return;
 
 	double unitRatio = lineWidth->unitRatio();
 
-	lineWidth->setValue(currentStyle[i].Width * unitRatio);
-	setCurrentComboItem(colorCombo, currentStyle[i].Color);
-	shadeBox->setValue(currentStyle[i].Shade);
+	lineWidth->setValue(m_currentStyle[i].Width * unitRatio);
+	setCurrentComboItem(colorCombo, m_currentStyle[i].Color);
+	shadeBox->setValue(m_currentStyle[i].Shade);
 	
-	dashCombo->setCurrentIndex(currentStyle[i].Dash - 1);
-	switch (static_cast<Qt::PenCapStyle>(currentStyle[i].LineEnd))
+	dashCombo->setCurrentIndex(m_currentStyle[i].Dash - 1);
+	switch (static_cast<Qt::PenCapStyle>(m_currentStyle[i].LineEnd))
 	{
 	case Qt::FlatCap:
 		endCombo->setCurrentIndex(0);
@@ -120,7 +120,7 @@
 		break;
 	}
 
-	switch (static_cast<Qt::PenJoinStyle>(currentStyle[i].LineJoin))
+	switch (static_cast<Qt::PenJoinStyle>(m_currentStyle[i].LineJoin))
 	{
 	case Qt::MiterJoin:
 		joinCombo->setCurrentIndex(0);
@@ -144,7 +144,7 @@
 	QPixmap * pm2;
 	double unitRatio = lineWidth->unitRatio();
 	int decimals = lineWidth->decimals();
-	for (multiLine::iterator it = currentStyle.begin(); it != currentStyle.end(); ++it)
+	for (multiLine::iterator it = m_currentStyle.begin(); it != m_currentStyle.end(); ++it)
 	{
 		pm2 = getWidePixmap(getColor(it->Color, it->Shade));
 		tmp2 = " "+ tmp.setNum(it->Width * unitRatio, 'f', decimals) + lineWidth->suffix() + " ";
@@ -156,8 +156,8 @@
 
 QColor SMLineStyleWidget::getColor(const QString &name, int shade)
 {
-	const ScColor& color = colors[name];
-	QColor tmpf = ScColorEngine::getDisplayColor(color, colors.document(), shade);
+	const ScColor& color = m_colors[name];
+	QColor tmpf = ScColorEngine::getDisplayColor(color, m_colors.document(), shade);
 	return tmpf;
 }
 

Modified: trunk/Scribus/scribus/ui/smlinestylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19999&path=/trunk/Scribus/scribus/ui/smlinestylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smlinestylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smlinestylewidget.h Sun Apr 12 17:16:16 2015
@@ -32,8 +32,8 @@
 	void unitChange(int unitIndex);
 
 private:
-	multiLine  currentStyle;
-	ColorList  colors;
+	multiLine  m_currentStyle;
+	ColorList  m_colors;
 
 	void updateLineList();
 	QColor getColor(const QString &name, int shade);

Modified: trunk/Scribus/scribus/ui/smpstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19999&path=/trunk/Scribus/scribus/ui/smpstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.cpp (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.cpp Sun Apr 12 17:16:16 2015
@@ -279,7 +279,7 @@
 
 void SMPStyleWidget::show(ParagraphStyle *pstyle, QList<ParagraphStyle> &pstyles, QList<CharStyle> &cstyles, int unitIndex, const QString &defLang)
 {
-	currPStyle = pstyle;
+	m_currPStyle = pstyle;
 	double unitRatio = unitGetRatioFromIndex(unitIndex);
 	parentCombo->setEnabled(!pstyle->isDefaultStyle());
 	const ParagraphStyle *parent = dynamic_cast<const ParagraphStyle*>(pstyle->parentStyle());
@@ -540,7 +540,7 @@
 		show(pstyles[0], pstylesAll, cstyles, unitIndex, defLang);
 	else if (pstyles.count() > 1)
 	{
-		currPStyle = pstyles[0];
+		m_currPStyle = pstyles[0];
 		showLineSpacing(pstyles);
 		showSpaceAB(pstyles, unitIndex);
 		showDropCap(pstyles, cstyles, unitIndex);
@@ -1157,8 +1157,8 @@
 		CharStyle chStyle = m_cstyles->get(styleName);
 		setCurrentComboItem(m_enhanced->fontSelector, chStyle.font().scName());
 	}
-	else if (currPStyle)
-		setCurrentComboItem(m_enhanced->fontSelector, currPStyle->charStyle().font().scName());
+	else if (m_currPStyle)
+		setCurrentComboItem(m_enhanced->fontSelector, m_currPStyle->charStyle().font().scName());
 	m_enhanced->newFont(m_enhanced->fontSelector->currentIndex());
 	m_enhanced->show();
 	QApplication::restoreOverrideCursor();

Modified: trunk/Scribus/scribus/ui/smpstylewidget.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=19999&path=/trunk/Scribus/scribus/ui/smpstylewidget.h
==============================================================================
--- trunk/Scribus/scribus/ui/smpstylewidget.h (original)
+++ trunk/Scribus/scribus/ui/smpstylewidget.h Sun Apr 12 17:16:16 2015
@@ -38,8 +38,8 @@
 	bool m_parentDC, m_parentBul, m_parentNum;
 	CharSelectEnhanced * m_enhanced;
 	ScribusDoc * m_Doc;
-	QString currFontName;
-	ParagraphStyle* currPStyle;
+	QString m_currFontName;
+	ParagraphStyle* m_currPStyle;
 	StyleSet<CharStyle> *m_cstyles;
 
 	void fillBulletStrEditCombo();




More information about the scribus-commit mailing list