r22197 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Fri Oct 20 18:10:14 UTC 2017


Author: jghali
Date: Fri Oct 20 18:10:14 2017
New Revision: 22197

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22197
Log:
add missing preflight profiles when loading old docs

Modified:
    branches/Version14x/Scribus/scribus/prefsmanager.cpp
    branches/Version14x/Scribus/scribus/prefsmanager.h
    branches/Version14x/Scribus/scribus/scribus.cpp

Modified: branches/Version14x/Scribus/scribus/prefsmanager.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22197&path=/branches/Version14x/Scribus/scribus/prefsmanager.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/prefsmanager.cpp	(original)
+++ branches/Version14x/Scribus/scribus/prefsmanager.cpp	Fri Oct 20 18:10:14 2017
@@ -422,7 +422,7 @@
 	appPrefs.paragraphsLI = 10;
 	appPrefs.showStartupDialog = true;
 	appPrefs.useSmallWidgets = false;
-	initDefaultCheckerPrefs(&appPrefs.checkerProfiles);
+	initDefaultCheckerPrefs(appPrefs.checkerProfiles);
 	appPrefs.curCheckProfile = CommonStrings::PostScript;
 	appPrefs.PDF_Options.Thumbnails = false;
 	appPrefs.PDF_Options.Articles = false;
@@ -930,7 +930,7 @@
 		ReadPrefsXML();
 	if (appPrefs.checkerProfiles.count() == 0)
 	{
-		initDefaultCheckerPrefs(&appPrefs.checkerProfiles);
+		initDefaultCheckerPrefs(appPrefs.checkerProfiles);
 		appPrefs.curCheckProfile = CommonStrings::PostScript;
 	}
 	if (!appPrefs.mainWinState.isEmpty())
@@ -2405,37 +2405,49 @@
 	return true;
 }
 
-void PrefsManager::initDefaultCheckerPrefs(CheckerPrefsList* cp)
-{
-	if (cp!=NULL)
-	{
-		struct checkerPrefs checkerSettings;
-		checkerSettings.ignoreErrors = false;
-		checkerSettings.autoCheck = true;
-		checkerSettings.checkGlyphs = true;
-		checkerSettings.checkOrphans = true;
-		checkerSettings.checkOverflow = true;
-		checkerSettings.checkPictures = true;
-		checkerSettings.checkResolution = true;
-		checkerSettings.checkTransparency = true;
-		checkerSettings.checkAnnotations = false;
-		checkerSettings.checkRasterPDF = true;
-		checkerSettings.checkForGIF = true;
-		checkerSettings.ignoreOffLayers = false;
-		checkerSettings.checkOffConflictLayers = false;
-		checkerSettings.minResolution = 144.0;
-		checkerSettings.maxResolution = 2400.0;
-		//TODO Stop translating these into settings!!!!!!!!!
-		cp->insert( CommonStrings::PostScript, checkerSettings);
-		cp->insert( CommonStrings::PDF_1_3   , checkerSettings);
-		checkerSettings.checkTransparency = false;
-		cp->insert( CommonStrings::PDF_1_4   , checkerSettings);
-		cp->insert( CommonStrings::PDF_1_5   , checkerSettings);
-		checkerSettings.checkTransparency = true;
-		checkerSettings.checkAnnotations = true;
-		checkerSettings.minResolution = 144.0;
-		cp->insert( CommonStrings::PDF_X1a  , checkerSettings);
-		cp->insert( CommonStrings::PDF_X3   , checkerSettings);
+void PrefsManager::initDefaultCheckerPrefs(CheckerPrefsList& cp)
+{
+	struct checkerPrefs checkerSettings;
+	checkerSettings.ignoreErrors = false;
+	checkerSettings.autoCheck = true;
+	checkerSettings.checkGlyphs = true;
+	checkerSettings.checkOrphans = true;
+	checkerSettings.checkOverflow = true;
+	checkerSettings.checkPictures = true;
+	checkerSettings.checkResolution = true;
+	checkerSettings.checkTransparency = true;
+	checkerSettings.checkAnnotations = false;
+	checkerSettings.checkRasterPDF = true;
+	checkerSettings.checkForGIF = true;
+	checkerSettings.ignoreOffLayers = false;
+	checkerSettings.checkOffConflictLayers = false;
+	checkerSettings.minResolution = 144.0;
+	checkerSettings.maxResolution = 2400.0;
+	//TODO Stop translating these into settings!!!!!!!!!
+	cp.insert(CommonStrings::PostScript, checkerSettings);
+	cp.insert(CommonStrings::PDF_1_3   , checkerSettings);
+	checkerSettings.checkTransparency = false;
+	cp.insert(CommonStrings::PDF_1_4   , checkerSettings);
+	cp.insert(CommonStrings::PDF_1_5   , checkerSettings);
+	checkerSettings.checkTransparency = true;
+	checkerSettings.checkAnnotations = true;
+	checkerSettings.minResolution = 144.0;
+	cp.insert(CommonStrings::PDF_X1a  , checkerSettings);
+	cp.insert(CommonStrings::PDF_X3   , checkerSettings);
+}
+
+void PrefsManager::insertMissingCheckerProfiles(CheckerPrefsList& cp)
+{
+	CheckerPrefsList defaultList;
+	initDefaultCheckerPrefs(defaultList);
+
+	CheckerPrefsList::const_iterator it = defaultList.constBegin();
+	for (; it != defaultList.constEnd(); ++it)
+	{
+		QString name = it.key();
+		if (cp.contains(name))
+			continue;
+		cp.insert(name, it.value());
 	}
 }
 

Modified: branches/Version14x/Scribus/scribus/prefsmanager.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22197&path=/branches/Version14x/Scribus/scribus/prefsmanager.h
==============================================================================
--- branches/Version14x/Scribus/scribus/prefsmanager.h	(original)
+++ branches/Version14x/Scribus/scribus/prefsmanager.h	Fri Oct 20 18:10:14 2017
@@ -66,10 +66,14 @@
 	*/
 	void initDefaults();
 	void initDefaultGUIFont(const QFont&);
-	void initDefaultCheckerPrefs(CheckerPrefsList* cp);
+	void initDefaultCheckerPrefs(CheckerPrefsList& cp);
 	void initDefaultActionKeys();
 	void applyLoadedShortCuts();
 	void initArrowStyles();
+	/*!
+	\brief Insert checker profiles not available in specified list
+	*/
+	void insertMissingCheckerProfiles(CheckerPrefsList& cp);
 	/*!
 	\author Craig Bradney
 	\date Thu 18 Nov 2004

Modified: branches/Version14x/Scribus/scribus/scribus.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22197&path=/branches/Version14x/Scribus/scribus/scribus.cpp
==============================================================================
--- branches/Version14x/Scribus/scribus/scribus.cpp	(original)
+++ branches/Version14x/Scribus/scribus/scribus.cpp	Fri Oct 20 18:10:14 2017
@@ -4033,9 +4033,10 @@
 		HaveDoc++;
 		if (doc->checkerProfiles.count() == 0)
 		{
-			prefsManager->initDefaultCheckerPrefs(&doc->checkerProfiles);
+			prefsManager->initDefaultCheckerPrefs(doc->checkerProfiles);
 			doc->curCheckProfile = CommonStrings::PostScript;
 		}
+		prefsManager->insertMissingCheckerProfiles(doc->checkerProfiles);
 		if (doc->PDF_Options.LPISettings.count() == 0)
 		{
 			struct LPIData lpo;




More information about the scribus-commit mailing list