]> git.lyx.org Git - features.git/commitdiff
Backport fix for #7764: Sort the file lists under
authorRichard Heck <rgheck@comcast.net>
Sun, 30 Oct 2011 20:07:46 +0000 (20:07 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 30 Oct 2011 20:07:46 +0000 (20:07 +0000)
Document>Settings>Output.

It turns out that we always want this list to be sorted when we get it,
so we can sort it in BufferParams rather than in three different places.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_2_0_X@40102 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferParams.cpp
src/frontends/qt4/GuiSendto.cpp
src/frontends/qt4/Menus.cpp
status.20x

index 09b970b01a4873e052e5d6f765b1f88405ba4d85..0bb61a7bf94c8203fdd189a64f82868b8235b63c 100644 (file)
@@ -2078,6 +2078,13 @@ bool BufferParams::isExportable(string const & format) const
 }
 
 
+namespace {
+bool formatSorter(Format const * lhs, Format const * rhs) {
+       return _(lhs->prettyname()) < _(rhs->prettyname());
+}
+}
+
+
 vector<Format const *> BufferParams::exportableFormats(bool only_viewable) const
 {
        vector<string> const backs = backends();
@@ -2094,6 +2101,7 @@ vector<Format const *> BufferParams::exportableFormats(bool only_viewable) const
                        theConverters().getReachable(*it, only_viewable, false, excludes);
                result.insert(result.end(), r.begin(), r.end());
        }
+       sort(result.begin(), result.end(), formatSorter);
        return result;
 }
 
index 8bb8242a5b91aace0f9cb8e1cabde9a6afad718a..4c9589c9a5974a84007ee843a6c3aa7bc7dca6dc 100644 (file)
@@ -69,19 +69,10 @@ void GuiSendTo::changed_adaptor()
 }
 
 
-namespace {
-bool formatSorter(Format const * lhs, Format const * rhs) {
-       return _(lhs->prettyname()) < _(rhs->prettyname());
-}
-} // end namespace
-
-
 void GuiSendTo::updateContents()
 {
        all_formats_ = buffer().params().exportableFormats(false);
        
-       sort(all_formats_.begin(), all_formats_.end(), formatSorter);
-
        // Save the current selection if any
        Format const * current_format = 0;
        int const line = formatLW->currentRow();
index 6af599be588bd2db1f416e92837838063a9379c4..6cc3195f3eeb598ba1aeb3d21358d978eab30e6c 100644 (file)
@@ -723,12 +723,6 @@ bool MenuDefinition::searchMenu(FuncRequest const & func, docstring_list & names
 }
 
 
-bool compareFormat(Format const * p1, Format const * p2)
-{
-       return *p1 < *p2;
-}
-
-
 QString limitStringLength(docstring const & str)
 {
        size_t const max_item_length = 45;
@@ -1018,7 +1012,6 @@ void MenuDefinition::expandFormats(MenuItem::Kind kind, Buffer const * buf)
                formats = buf->params().exportableFormats(false);
                action = LFUN_BUFFER_EXPORT;
        }
-       sort(formats.begin(), formats.end(), &compareFormat);
 
        bool const view_update = (kind == MenuItem::ViewFormats
                        || kind == MenuItem::UpdateFormats);
index e7c334f443b52a216381470388377377c3ea6923..1c0847a44a99a1f68aaf6e2943a22944a8b179a3 100644 (file)
@@ -231,6 +231,8 @@ What's new
 
 - Fix change of language of selected text with context menu (bug 7778).
 
+- Sort formats under Document>Settings>Output (bug 7758).
+
 
 * ADVANCED FIND AND REPLACE