r22420 by jghali -

scribus-commit scribus-commit at lists.scribus.net
Sun Mar 4 15:34:35 UTC 2018


Author: jghali
Date: Sun Mar  4 15:34:35 2018
New Revision: 22420

URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=22420
Log:
#15178: Saved Bookmarks may appear in a random order when re-opening the document

Modified:
    trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
    trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
    trunk/Scribus/scribus/scribusdoc.h

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22420&path=/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp	Sun Mar  4 15:34:35 2018
@@ -6,6 +6,8 @@
 */
 #include "scribus134format.h"
 #include "scribus134formatimpl.h"
+
+#include <algorithm>
 
 #include "../../formatidlist.h"
 #include "commonstrings.h"
@@ -496,6 +498,7 @@
 			m_Doc->BookMarks.append( bookmark );
 		}
 	}
+	std::stable_sort(m_Doc->BookMarks.begin(), m_Doc->BookMarks.end());
 
 	if (TableItemsF.count() != 0)
 	{

Modified: trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22420&path=/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
==============================================================================
--- trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	(original)
+++ trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp	Sun Mar  4 15:34:35 2018
@@ -6,6 +6,8 @@
 */
 #include "scribus150format.h"
 #include "scribus150formatimpl.h"
+
+#include <algorithm>
 
 #include "../../formatidlist.h"
 #include "commonstrings.h"
@@ -1590,6 +1592,7 @@
 		bookmark.PageObject = item;
 		m_Doc->BookMarks.append( bookmark );
 	}
+	std::stable_sort(m_Doc->BookMarks.begin(), m_Doc->BookMarks.end());
 
 	if (isNewFormat)
 	{

Modified: trunk/Scribus/scribus/scribusdoc.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=22420&path=/trunk/Scribus/scribus/scribusdoc.h
==============================================================================
--- trunk/Scribus/scribus/scribusdoc.h	(original)
+++ trunk/Scribus/scribus/scribusdoc.h	Sun Mar  4 15:34:35 2018
@@ -1337,17 +1337,19 @@
 	PrintOptions Print_Options;
 	bool RePos;
 	struct BookMa {
-					QString Title;
-					QString Text;
-					QString Aktion;
-					PageItem *PageObject;
-					int Parent;
-					int ItemNr;
-					int First;
-					int Last;
-					int Prev;
-					int Next;
-					};
+		QString Title;
+		QString Text;
+		QString Aktion;
+		PageItem *PageObject;
+		int Parent;
+		int ItemNr;
+		int First;
+		int Last;
+		int Prev;
+		int Next;
+
+		bool operator<(const BookMa& other) const { return ItemNr < other.ItemNr; }
+	};
 	QList<BookMa> BookMarks;
 	bool OldBM;
 	bool hasName;




More information about the scribus-commit mailing list