r14303 by jghali - #8509 (part of) : fix crash on application startup by doing some sanity checks on prefs loading

scribus-commit scribus-commit at lists.scribus.net
Wed Nov 18 00:55:36 CET 2009


Revision: 14303
Author: jghali
Date: 2009-11-17T15:31:22.020607Z
Commit message: #8509 (part of) : fix crash on application startup by doing some sanity checks on prefs loading

Changeset: 
M  /trunk/Scribus/scribus/prefsmanager.cpp

Diffs:
Index: scribus/prefsmanager.cpp
===================================================================
--- scribus/prefsmanager.cpp	(revision 14302)
+++ scribus/prefsmanager.cpp	(revision 14303)
@@ -2447,7 +2447,13 @@
 		}
 		DOC=DOC.nextSibling();
 	}
+	// Some sanity checks
 	appPrefs.colorPrefs.DColors.ensureBlackAndWhite();
+	if ((appPrefs.docSetupPrefs.pagePositioning  < 0) || (appPrefs.docSetupPrefs.pagePositioning >= appPrefs.pageSets.count()))
+		appPrefs.docSetupPrefs.pagePositioning = 0;
+	if ((appPrefs.docSetupPrefs.docUnitIndex < UNITMIN) || (appPrefs.docSetupPrefs.docUnitIndex > UNITMAX))
+		appPrefs.docSetupPrefs.docUnitIndex = int(SC_POINTS);
+	// Configure GUI
 	appPrefs.ui_SystemTheme = qApp->style()->objectName();
 	if (appPrefs.uiPrefs.style.length() > 0)
 	{




More information about the scribus-commit mailing list