r20497 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Mon Oct 26 21:49:46 UTC 2015


Author: jghali
Date: Mon Oct 26 21:49:46 2015
New Revision: 20497

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=20497
Log:
#13471: Fix for broken hyphenation language selection <Mikko Rasa>

Modified:
    trunk/Scribus/scribus/fileloader.cpp
    trunk/Scribus/scribus/scribus.cpp
    trunk/Scribus/scribus/scribusdoc.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/fileloader.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20497&path=/trunk/Scribus/scribus/fileloader.cpp
==============================================================================
--- trunk/Scribus/scribus/fileloader.cpp	(original)
+++ trunk/Scribus/scribus/fileloader.cpp	Mon Oct 26 21:49:46 2015
@@ -425,18 +425,6 @@
 
 bool FileLoader::postLoad(ScribusDoc* currDoc)
 {
-	//CB #3749 We have to set these up in post load as each format will load into the doc itself
-	//settings. As the hyphenator was created in the doc constructor, it needs to be updated.
-	//FIXME: Remove these duplicate settings altogether
-	if (currDoc->docHyphenator!=0)
-	{
-			currDoc->docHyphenator->Automatic=currDoc->hyphAutomatic();
-			currDoc->docHyphenator->AutoCheck=currDoc->hyphAutoCheck();
-			currDoc->docHyphenator->Language=currDoc->hyphLanguage();
-			currDoc->docHyphenator->MinWordLen=currDoc->hyphMinimumWordLength();
-			currDoc->docHyphenator->HyCount=currDoc->hyphConsecutiveLines();
-	}
-	
 	ReplacedFonts = currDoc->AllFonts->getSubstitutions(ReplacedFonts.keys());
 	if (ReplacedFonts.isEmpty())
 		return true;

Modified: trunk/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20497&path=/trunk/Scribus/scribus/scribus.cpp
==============================================================================
--- trunk/Scribus/scribus/scribus.cpp	(original)
+++ trunk/Scribus/scribus/scribus.cpp	Mon Oct 26 21:49:46 2015
@@ -2264,6 +2264,7 @@
 	tempDoc->setGUI(requiresGUI, this, tempView);
 	if (requiresGUI)
 	{
+		tempDoc->createHyphenator();
 		tempDoc->docHyphenator->ignoredWords = prefsManager->appPrefs.hyphPrefs.ignoredWords;
 		tempDoc->docHyphenator->specialWords = prefsManager->appPrefs.hyphPrefs.specialWords;
 	}
@@ -3701,6 +3702,7 @@
 			doc->setName(FName);
 		doc->setMasterPageMode(false);
 		//IL doc->setHyphLanguage(GetLang(doc->hyphLanguage()));
+		doc->createHyphenator();
 		HaveNewDoc();
 //		propertiesPalette->Cpal->showGradient(0);
 //		propertiesPalette->updateCList();

Modified: trunk/Scribus/scribus/scribusdoc.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20497&path=/trunk/Scribus/scribus/scribusdoc.cpp
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.cpp	(original)
+++ trunk/Scribus/scribus/scribusdoc.cpp	Mon Oct 26 21:49:46 2015
@@ -883,8 +883,14 @@
 	m_ScMW = mw;
 	//FIXME: stop using m_View
 	m_View = view;
+}
+
+void ScribusDoc::createHyphenator()
+{
 	if (m_hasGUI)
 	{
+		if (docHyphenator)
+			delete docHyphenator;
 		docHyphenator = new Hyphenator(m_ScMW, this);
 		Q_CHECK_PTR(docHyphenator);
 	}

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=20497&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Mon Oct 26 21:49:46 2015
@@ -115,6 +115,7 @@
 	ScribusView* view() const;
 	ScribusMainWindow* scMW() const {return m_ScMW;}
 	void setGUI(bool hasgui, ScribusMainWindow* mw, ScribusView* view);
+	void createHyphenator();
 
 	/**
 	 * @brief Return the guarded object associated with the document




More information about the scribus-commit mailing list