From cc983b8fa95e2be0e7a58ccf723fcee0063c0791 Mon Sep 17 00:00:00 2001 From: Dekel Tsur Date: Wed, 24 Jan 2001 15:33:06 +0000 Subject: [PATCH] Fix the sorting of the formats in menus. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1382 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/ChangeLog | 4 ++++ src/MenuBackend.C | 9 ++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/ChangeLog b/src/ChangeLog index a24700f73e..de1de2b395 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,7 @@ +2001-01-24 Dekel Tsur + + * MenuBackend.C (expand): Fix the sorting of the formats. + 2001-01-24 John Levon * lyx_main.C: tiny error message fix diff --git a/src/MenuBackend.C b/src/MenuBackend.C index 1196dbaf2c..a73b2aa175 100644 --- a/src/MenuBackend.C +++ b/src/MenuBackend.C @@ -226,6 +226,13 @@ void Menu::checkShortcuts() const } } +class compare_format { +public: + bool operator()(Format const * p1, Format const * p2) { + return *p1 < *p2; + } +}; + void Menu::expand(Menu & tomenu, Buffer * buf) const { for (const_iterator cit = begin(); @@ -292,7 +299,7 @@ void Menu::expand(Menu & tomenu, Buffer * buf) const formats = Exporter::GetExportableFormats(buf, false); action = LFUN_EXPORT; } - sort(formats.begin(), formats.end()); + sort(formats.begin(), formats.end(), compare_format()); for (vector::const_iterator fit = formats.begin(); fit != formats.end() ; ++fit) {