]> git.lyx.org Git - features.git/commitdiff
There is no need now to cache format information in the SendTo
authorRichard Heck <rgheck@lyx.org>
Wed, 19 Oct 2016 21:30:48 +0000 (17:30 -0400)
committerRichard Heck <rgheck@lyx.org>
Fri, 21 Oct 2016 03:07:13 +0000 (23:07 -0400)
dialog.

src/frontends/qt4/GuiSendto.cpp
src/frontends/qt4/GuiSendto.h

index 13ba03d729764d4e21a17d2c8274782acab24718..a3c125eac8939ef4a597ae731fd6172ef4e7a6be 100644 (file)
@@ -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;
 }
 
index 38f0f531a780b0f16567a2a98c5e351f5cd029e9..ba0a2456f4960bf2ea63892ea1e4729fdecb5c80 100644 (file)
@@ -46,8 +46,6 @@ private:
        /// Update the dialog
        void updateContents();
 
-       ///
-       std::vector<Format const *> all_formats_;
        ///
        bool initialiseParams(std::string const & data);
        ///