r22164 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sat Sep 23 20:57:51 UTC 2017


Author: jghali
Date: Sat Sep 23 20:57:51 2017
New Revision: 22164

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22164
Log:
#14999: scribus crashes due to Signal #11 when inserting linebreak

Modified:
    trunk/Scribus/scribus/hyphenator.cpp
    trunk/Scribus/scribus/langmgr.cpp

Modified: trunk/Scribus/scribus/hyphenator.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22164&path=/trunk/Scribus/scribus/hyphenator.cpp
==============================================================================
--- trunk/Scribus/scribus/hyphenator.cpp	(original)
+++ trunk/Scribus/scribus/hyphenator.cpp	Sat Sep 23 20:57:51 2017
@@ -58,7 +58,7 @@
 
 bool Hyphenator::loadDict(const QString& name)
 {
-	if( LanguageManager::instance()->getHyphFilename(name).isEmpty() )
+	if (LanguageManager::instance()->getHyphFilename(name).isEmpty())
 		return false;
 		
 	if (m_language != name)
@@ -84,7 +84,7 @@
 		}
 	}
 
-	return true;
+	return (m_codec != 0 && m_hdict != 0);
 }
 
 void Hyphenator::slotNewSettings(bool Autom, bool ACheck)
@@ -98,6 +98,7 @@
 {
 	if (text.contains(SpecialChars::SHYPHEN))
 		return;
+
 	const CharStyle& style = it->itemText.charStyle(firstC);
 	if (text.length() >= style.hyphenWordMin())
 	{

Modified: trunk/Scribus/scribus/langmgr.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22164&path=/trunk/Scribus/scribus/langmgr.cpp
==============================================================================
--- trunk/Scribus/scribus/langmgr.cpp	(original)
+++ trunk/Scribus/scribus/langmgr.cpp	Sat Sep 23 20:57:51 2017
@@ -738,6 +738,8 @@
 int LanguageManager::langTableIndex(const QString &abbrev)
 {
 //	qDebug()<<"langTableIndex: Trying to find:"<<abbrev;
+	if (abbrev.isEmpty())
+		return -1;
 	for (int i = 0; i < m_langTable.size(); ++i)
 	{
 //		qDebug()<<abbrev<<langTable[i].m_priAbbrev<<langTable[i].m_altAbbrev;
@@ -1145,7 +1147,7 @@
 
 const QString LanguageManager::getHyphFilename(const QString & langAbbrev)
 {
-	int j=langTableIndex(langAbbrev);
+	int j = langTableIndex(langAbbrev);
 	if (j!=-1 && m_langTable[j].m_hyphAvailable)
 	{
 //		qDebug()<<"Found requested hyphenation dictionary:"<<langAbbrev<<" : "<<langTable[j].m_hyphFile;




More information about the scribus-commit mailing list