r22065 by craig - #14859: Avoid paragraph style editing crash when no language is passed through, clena up some old debug code

scribus-commit scribus-commit at lists.scribus.net
Mon Jun 12 21:25:37 UTC 2017


Author: craig
Date: Mon Jun 12 21:25:37 2017
New Revision: 22065

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22065
Log:
#14859: Avoid paragraph style editing crash when no language is passed through, clena up some old debug code

Modified:
    trunk/Scribus/scribus/langmgr.h
    trunk/Scribus/scribus/localemgr.h
    trunk/Scribus/scribus/ui/smcstylewidget.cpp

Modified: trunk/Scribus/scribus/langmgr.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22065&path=/trunk/Scribus/scribus/langmgr.h
==============================================================================
--- trunk/Scribus/scribus/langmgr.h	(original)
+++ trunk/Scribus/scribus/langmgr.h	Mon Jun 12 21:25:37 2017
@@ -34,7 +34,7 @@
 
 class SCRIBUS_API LanguageManager
 {
-	LanguageManager() {};
+	LanguageManager() {}
 	~LanguageManager();
 
 	void init(bool generateInstalledList = true);

Modified: trunk/Scribus/scribus/localemgr.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22065&path=/trunk/Scribus/scribus/localemgr.h
==============================================================================
--- trunk/Scribus/scribus/localemgr.h	(original)
+++ trunk/Scribus/scribus/localemgr.h	Mon Jun 12 21:25:37 2017
@@ -36,13 +36,12 @@
 		LocaleDef();
 		LocaleDef(const QString& locale, const QString& unit, const QString& pageSize)
 		{
-
-				m_locale=locale;
-				m_unit=unit;
-				m_pageSize=pageSize;
+			m_locale=locale;
+			m_unit=unit;
+			m_pageSize=pageSize;
 
 		}
-		~LocaleDef() {};
+		~LocaleDef() {}
 
 	private:
 		QString m_locale;
@@ -52,7 +51,7 @@
 
 class SCRIBUS_API LocaleManager
 {
-	LocaleManager() {};
+	LocaleManager() {}
 	~LocaleManager();
 
 	void init();

Modified: trunk/Scribus/scribus/ui/smcstylewidget.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22065&path=/trunk/Scribus/scribus/ui/smcstylewidget.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/smcstylewidget.cpp	(original)
+++ trunk/Scribus/scribus/ui/smcstylewidget.cpp	Mon Jun 12 21:25:37 2017
@@ -308,33 +308,23 @@
 		parentCombo->setCurrentIndex(index);
 	}
 
-	QString clang = cstyle->language().isNull() || cstyle->language().isEmpty() ?
-	                                      defLang : cstyle->language();
-	//qDebug()<<"style lang"<<cstyle->language()<<clang;
+	QString defaultLang(defLang.isEmpty() ? "en_GB" : defLang);
+	QString clang(cstyle->language().isNull() || cstyle->language().isEmpty() ? defaultLang : cstyle->language());
 	QString plang(QString::null);
 	if (hasParent)
-		plang = parent->language().isNull() || parent->language().isEmpty() ?
-		                              defLang : parent->language();
+		plang = parent->language().isNull() || parent->language().isEmpty() ? defaultLang : parent->language();
 
 	int ci = -1, pi = -1, di = -1;
-// 	LanguageManager langmgr;
-// 	langmgr.init(true);
-	QString tl = LanguageManager::instance()->getAbbrevFromLang(defLang, false);
+	QString tl = LanguageManager::instance()->getAbbrevFromLang(defaultLang, false);
 	for (int i = 0; i < language_->count(); ++i)
 	{
-		QString ltAbbrev=LanguageManager::instance()->getAbbrevFromLang(language_->itemText(i), false);
-//		qDebug()<<"ltabbrev"<<ltAbbrev<<language_->itemText(i);
+		QString ltAbbrev(LanguageManager::instance()->getAbbrevFromLang(language_->itemText(i), false));
 		if (ltAbbrev == clang)
 			ci = i;
-		
 		if (hasParent && ltAbbrev == plang)
 			pi = i;
-//		qDebug() << i << language_->itemText(i) << defLang << langMap_[defLang] << tl;
-		if (ltAbbrev == defLang || ltAbbrev == tl)
-//		{
+		if (ltAbbrev == defaultLang || ltAbbrev == tl)
 			di = i;
-//			qDebug() << "match on:" << di;
-//		}
 	}
 
 	//qDebug() << QString("SMCStyleWidget::show(): deflan='%1'->'%2'").arg(defLang).arg(langMap_[defLang]);




More information about the scribus-commit mailing list