]> git.lyx.org Git - features.git/commitdiff
Fix the sorting of the formats in menus.
authorDekel Tsur <dekelts@tau.ac.il>
Wed, 24 Jan 2001 15:33:06 +0000 (15:33 +0000)
committerDekel Tsur <dekelts@tau.ac.il>
Wed, 24 Jan 2001 15:33:06 +0000 (15:33 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@1382 a592a061-630c-0410-9148-cb99ea01b6c8

src/ChangeLog
src/MenuBackend.C

index a24700f73ebf936d4fe77ac3e7ff1452299f7697..de1de2b395e33fb399fb234f45763235b44b721c 100644 (file)
@@ -1,3 +1,7 @@
+2001-01-24  Dekel Tsur  <dekelts@tau.ac.il>
+
+       * MenuBackend.C (expand): Fix the sorting of the formats.
+
 2001-01-24  John Levon  <moz@compsoc.man.ac.uk>
 
        * lyx_main.C: tiny error message fix
index 1196dbaf2c23aeb7fc1b906dc3136d837d93cffd..a73b2aa17518be602cc53634b3c0b93437165c07 100644 (file)
@@ -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<Format const *>::const_iterator fit = formats.begin();
                             fit != formats.end() ; ++fit) {