commit e7f39ed37715777afbd2285231cc1645eb663fe6
Author: Richard Heck <rgh...@lyx.org>
Date:   Wed Oct 19 17:30:48 2016 -0400

    There is no need now to cache format information in the SendTo
    dialog.
---
 src/frontends/qt4/GuiSendto.cpp |   14 ++++++++------
 src/frontends/qt4/GuiSendto.h   |    2 --
 2 files changed, 8 insertions(+), 8 deletions(-)

diff --git a/src/frontends/qt4/GuiSendto.cpp b/src/frontends/qt4/GuiSendto.cpp
index 13ba03d..a3c125e 100644
--- a/src/frontends/qt4/GuiSendto.cpp
+++ b/src/frontends/qt4/GuiSendto.cpp
@@ -71,17 +71,17 @@ void GuiSendTo::changed_adaptor()
 
 void GuiSendTo::updateContents()
 {
-       all_formats_ = buffer().params().exportableFormats(false);
-       sort(all_formats_.begin(), all_formats_.end(), Format::formatSorter);
+       vector<Format const *> const & all_formats = 
+           buffer().params().exportableFormats(false);
        // Save the current selection if any
        Format const * current_format = nullptr;
        int const line = formatLW->currentRow();
-       if (line >= 0 && static_cast<unsigned int>(line) < all_formats_.size()
+       if (line >= 0 && static_cast<unsigned int>(line) < all_formats.size()
            && formatLW->selectedItems().size() > 0)
-               current_format = all_formats_[line];
+               current_format = all_formats[line];
        // Reset the list widget
        formatLW->clear();
-       for (Format const * f : all_formats_) {
+       for (Format const * f : all_formats) {
                formatLW->addItem(toqstr(translateIfPossible(f->prettyname())));
                // Restore the selection
                if (current_format && f->prettyname() == 
current_format->prettyname())
@@ -101,7 +101,9 @@ void GuiSendTo::applyView()
        if (line < 0 || line > formatLW->count())
                return;
 
-       format_ = all_formats_[line];
+       vector<Format const *> const & all_formats = 
+           buffer().params().exportableFormats(false);
+       format_ = all_formats[line];
        command_ = command;
 }
 
diff --git a/src/frontends/qt4/GuiSendto.h b/src/frontends/qt4/GuiSendto.h
index 38f0f53..ba0a245 100644
--- a/src/frontends/qt4/GuiSendto.h
+++ b/src/frontends/qt4/GuiSendto.h
@@ -47,8 +47,6 @@ private:
        void updateContents();
 
        ///
-       std::vector<Format const *> all_formats_;
-       ///
        bool initialiseParams(std::string const & data);
        ///
        void paramsToDialog(Format const * format, QString const & command);

Reply via email to