r22958 by jghali - #15654: Incorrect ordering of language list in Preferences document setup options

scribus-commit scribus-commit at lists.scribus.net
Sat Apr 20 22:37:04 UTC 2019


Author: jghali
Date: Sat Apr 20 22:37:03 2019
New Revision: 22958

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22958
Log:
#15654: Incorrect ordering of language list in Preferences document setup options

Modified:
    trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
    trunk/Scribus/scribus/ui/prefs_documentsetup.h
    trunk/Scribus/scribus/util_text.cpp
    trunk/Scribus/scribus/util_text.h

Modified: trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22958&path=/trunk/Scribus/scribus/ui/prefs_documentsetup.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsetup.cpp	(original)
+++ trunk/Scribus/scribus/ui/prefs_documentsetup.cpp	Sat Apr 20 22:37:03 2019
@@ -18,6 +18,7 @@
 #include "undomanager.h"
 #include "units.h"
 #include "util.h"
+#include "util_text.h"
 
 Prefs_DocumentSetup::Prefs_DocumentSetup(QWidget* parent, ScribusDoc* doc)
 	: Prefs_Pane(parent),
@@ -45,7 +46,7 @@
 
 	QStringList languageList;
 	LanguageManager::instance()->fillInstalledStringList(&languageList);
-	languageList.sort();
+	qSort(languageList.begin(), languageList.end(), localeAwareLessThan);
 	languageComboBox->addItems( languageList );
 
 	pageLayoutButtonGroup->setId(singlePageRadioButton,0);

Modified: trunk/Scribus/scribus/ui/prefs_documentsetup.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22958&path=/trunk/Scribus/scribus/ui/prefs_documentsetup.h
==============================================================================
--- trunk/Scribus/scribus/ui/prefs_documentsetup.h	(original)
+++ trunk/Scribus/scribus/ui/prefs_documentsetup.h	Sat Apr 20 22:37:03 2019
@@ -22,6 +22,7 @@
 	public:
 		Prefs_DocumentSetup(QWidget* parent, ScribusDoc* doc=nullptr);
 		~Prefs_DocumentSetup();
+
 		virtual void restoreDefaults(struct ApplicationPrefs *prefsData);
 		virtual void saveGuiToPrefs(struct ApplicationPrefs *prefsData) const;
 		void getResizeDocumentPages(bool &resizePages, bool &resizeMasterPages, bool &resizePageMargins, bool &resizeMasterPageMargins);

Modified: trunk/Scribus/scribus/util_text.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22958&path=/trunk/Scribus/scribus/util_text.cpp
==============================================================================
--- trunk/Scribus/scribus/util_text.cpp	(original)
+++ trunk/Scribus/scribus/util_text.cpp	Sat Apr 20 22:37:03 2019
@@ -51,6 +51,12 @@
 	return -1;
 }
 
+bool SCRIBUS_API localeAwareLessThan(const QString& s1, const QString& s2)
+{
+	int result = QString::localeAwareCompare(s1, s2);
+	return (result < 0);
+}
+
 StoryText desaxeString(ScribusDoc* doc, const QString& saxedString)
 {
 	assert(!saxedString.isEmpty());

Modified: trunk/Scribus/scribus/util_text.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22958&path=/trunk/Scribus/scribus/util_text.h
==============================================================================
--- trunk/Scribus/scribus/util_text.h	(original)
+++ trunk/Scribus/scribus/util_text.h	Sat Apr 20 22:37:03 2019
@@ -22,6 +22,8 @@
 int SCRIBUS_API findParagraphStyle(ScribusDoc* doc, const QString &name);
 #endif
 
+bool SCRIBUS_API localeAwareLessThan(const QString& s1, const QString& s2);
+
 // returns StoryText from saxed string
 StoryText SCRIBUS_API desaxeString(ScribusDoc* doc, const QString& saxedString);
 




More information about the scribus-commit mailing list