From: Richard Heck Date: Wed, 19 Oct 2016 21:30:48 +0000 (-0400) Subject: There is no need now to cache format information in the SendTo X-Git-Tag: 2.3.0alpha1~834 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=e7f39ed37715777afbd2285231cc1645eb663fe6;p=features.git There is no need now to cache format information in the SendTo dialog. --- diff --git a/src/frontends/qt4/GuiSendto.cpp b/src/frontends/qt4/GuiSendto.cpp index 13ba03d729..a3c125eac8 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 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(line) < all_formats_.size() + if (line >= 0 && static_cast(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 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 38f0f531a7..ba0a2456f4 100644 --- a/src/frontends/qt4/GuiSendto.h +++ b/src/frontends/qt4/GuiSendto.h @@ -46,8 +46,6 @@ private: /// Update the dialog void updateContents(); - /// - std::vector all_formats_; /// bool initialiseParams(std::string const & data); ///