mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
These two routines are now redundant.
This commit is contained in:
parent
7c9e9b4c90
commit
c19794a013
@ -2479,7 +2479,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));
|
||||
@ -2491,7 +2491,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:
|
||||
|
@ -2391,9 +2391,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) {
|
||||
@ -2434,19 +2434,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;
|
||||
|
@ -178,11 +178,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;
|
||||
|
@ -1844,7 +1844,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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user