r17765 by jghali - #11052: Scribus crash if file hyph_ga.dic does not exists in installl directory

scribus-commit scribus-commit at lists.scribus.net
Tue Aug 28 22:26:08 UTC 2012


Author: jghali
Date: Tue Aug 28 22:26:08 2012
New Revision: 17765

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=17765
Log:
#11052: Scribus crash if file hyph_ga.dic does not exists in installl directory

Modified:
    trunk/Scribus/scribus/scribus.cpp

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=17765&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp (original)
+++ trunk/Scribus/scribus/scribus.cpp Tue Aug 28 22:26:08 2012
@@ -4117,6 +4117,8 @@
 		}
 //		RestoreBookMarks();
 		doc->setMasterPageMode(false);
+		/*QTime t;
+		t.start();*/
 		int docItemsCount=doc->Items->count();
 		for (int azz=0; azz<docItemsCount; ++azz)
 		{
@@ -4131,6 +4133,7 @@
 			if(ite->nextInChain() == NULL)
 				ite->layout();
 		}
+		/*qDebug("Time elapsed: %d ms", t.elapsed());*/
 		doc->RePos = false;
 		doc->setModified(false);
 		updateRecent(FName);
@@ -9368,21 +9371,18 @@
 	{
 		LanguageManager *langmgr(LanguageManager::instance());
 // 		langmgr.init(false);
-		QString datein = "";
+		QString tLang = "";
 		for (uint dc = 0; dc < hyphDir.count(); ++dc)
 		{
 			QFileInfo fi(hyphDir[dc]);
-			QString fileLangAbbrev=fi.baseName().section('_', 1);
-			datein = langmgr->getLangFromAbbrev(fileLangAbbrev);
-			QString tDatein = datein;
-			datein = GetLang(datein);
-			LangTransl.insert(datein, tDatein);
+			QString fileLangAbbrev = fi.baseName().section('_', 1);
+			tLang = langmgr->getLangFromAbbrev(fileLangAbbrev);
+			LangTransl.insert(fileLangAbbrev, tLang);
 			langmgr->addHyphLang(fileLangAbbrev, hyphDir[dc]);
-// 			Sprachen.insert(datein, hyphDir[dc]);
 			if (fileLangAbbrev == lang)
 				prefsManager->appPrefs.hyphPrefs.Language = fileLangAbbrev;
 		}
-		if (datein.isEmpty())
+		if (tLang.isEmpty())
 			prefsManager->appPrefs.hyphPrefs.Language = "en_US";
 	}
 }
@@ -9393,7 +9393,7 @@
  	for (QMap<QString, QStringList>::Iterator itl = InstLang.begin(); itl != itlend; ++itl)
 	{
 		if (itl.value().contains(inLang))
-			return LanguageManager::instance()->getLangFromAbbrev(itl.key());
+			return LanguageManager::instance()->getLangFromAbbrev(itl.key(), false);
 	}
 	return inLang;
 }




More information about the scribus-commit mailing list