]> git.lyx.org Git - features.git/commitdiff
These two routines are now redundant.
authorRichard Heck <rgheck@lyx.org>
Fri, 21 Oct 2016 02:56:40 +0000 (22:56 -0400)
committerRichard Heck <rgheck@lyx.org>
Thu, 25 May 2017 03:44:03 +0000 (23:44 -0400)
(cherry picked from commit c19794a01360a26824ddcabd82cde810e4d1867a)

src/Buffer.cpp
src/BufferParams.cpp
src/BufferParams.h
src/frontends/qt4/GuiView.cpp
status.22x

index 94e94fa766eb73f18aa3b24a60b4d3a88f085022..7b1f1698e3a1b211655253328b48c7172ae92d14 100644 (file)
@@ -2527,7 +2527,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                size_t pos = format.find(' ');
                if (pos != string::npos)
                        format = format.substr(0, pos);
-               enable = params().isExportable(format);
+               enable = params().isExportable(format, false);
                if (!enable)
                        flag.message(bformat(
                                             _("Don't know how to export to format: %1$s"), arg));
@@ -2539,7 +2539,7 @@ bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                break;
 
        case LFUN_BUILD_PROGRAM:
-               enable = params().isExportable("program");
+               enable = params().isExportable("program", false);
                break;
 
        case LFUN_BRANCH_ACTIVATE:
index 8af927ade3a062269b5638b671e545e43b1a47fb..a379e2740d4bbb594140fd202e2cffd5d56c2d8f 100644 (file)
@@ -2401,9 +2401,9 @@ string BufferParams::bufferFormat() const
 }
 
 
-bool BufferParams::isExportable(string const & format) const
+bool BufferParams::isExportable(string const & format, bool need_viewable) const
 {
-       FormatList const & formats = exportableFormats(false);
+       FormatList const & formats = exportableFormats(need_viewable);
        FormatList::const_iterator fit = formats.begin();
        FormatList::const_iterator end = formats.end();
        for (; fit != end ; ++fit) {
@@ -2444,19 +2444,6 @@ FormatList const & BufferParams::exportableFormats(bool only_viewable) const
 }
 
 
-bool BufferParams::isExportableFormat(string const & format) const
-{
-       FormatList const & formats = exportableFormats(true);
-       FormatList::const_iterator fit = formats.begin();
-       FormatList::const_iterator end = formats.end();
-       for (; fit != end ; ++fit) {
-               if ((*fit)->name() == format)
-                       return true;
-       }
-       return false;
-}
-
-
 vector<string> BufferParams::backends() const
 {
        vector<string> v;
index f4caa3010049a20062053d9f897602c926696396..4ae689401f350c92901b347a03123c4f6ba08798 100644 (file)
@@ -179,11 +179,9 @@ public:
        OutputParams::FLAVOR getOutputFlavor(
                  std::string const & format = std::string()) const;
        ///
-       bool isExportable(std::string const & format) const;
+       bool isExportable(std::string const & format, bool need_viewable) const;
        ///
        std::vector<const Format *> const & exportableFormats(bool only_viewable) const;
-       ///
-       bool isExportableFormat(std::string const & format) const;
        /// the backends appropriate for use with this document.
        /// so, e.g., latex is excluded , if we're using non-TeX fonts
        std::vector<std::string> backends() const;
index 38f34332b9f05a8abad9784cbe750811549e26ec..8d8ca5916a11aab68648cd3ef37686e747bfcbbb 100644 (file)
@@ -1803,7 +1803,7 @@ bool GuiView::getStatus(FuncRequest const & cmd, FuncStatus & flag)
                string format = to_utf8(cmd.argument());
                if (cmd.argument().empty())
                        format = doc_buffer->params().getDefaultOutputFormat();
-               enable = doc_buffer->params().isExportableFormat(format);
+               enable = doc_buffer->params().isExportable(format, true);
                break;
        }
 
index d3105f16f8087f5f19b3297a5fee070bbff6b3fa..186a18898af82662a838b9c7f422f945123d919a 100644 (file)
@@ -24,6 +24,8 @@ What's new
 
 - On Windows, allow to automatically bring the LyX window to top (bug 10469).
 
+- Cache information on exportable formats (bug 9980).
+
 
 * DOCUMENTATION AND LOCALIZATION