#include "lyxtext.h"
#include "lyxrc.h"
#include "lyxvc.h"
-#include "lyx_main.h"
#include "messages.h"
#include "output.h"
#include "output_docbook.h"
closing();
- if (!temppath().empty() && !destroyDir(temppath())) {
+ if (!temppath().empty() && !destroyDir(FileName(temppath()))) {
Alert::warning(_("Could not remove temporary directory"),
bformat(_("Could not remove the temporary directory %1$s"),
from_utf8(temppath())));
string theclass = params().getLyXTextClass().name();
Alert::error(_("Can't load document class"), bformat(
_("Using the default document class, because the "
- " class %1$s could not be loaded."), from_utf8(theclass)));
+ "class %1$s could not be loaded."), from_utf8(theclass)));
params().textclass = 0;
}
}
-bool Buffer::makeLaTeXFile(string const & fname,
+bool Buffer::makeLaTeXFile(FileName const & fname,
string const & original_path,
OutputParams const & runparams,
bool output_preamble, bool output_body)
{
- string encoding;
- if (params().inputenc == "auto")
- encoding = params().language->encoding()->iconvName();
- else {
- Encoding const * enc = encodings.getFromLaTeXName(params().inputenc);
- if (enc)
- encoding = enc->iconvName();
- else {
- lyxerr << "Unknown inputenc value `"
- << params().inputenc
- << "'. Using `auto' instead." << endl;
- encoding = params().language->encoding()->iconvName();
- }
- }
+ string const encoding = params().encoding().iconvName();
lyxerr[Debug::LATEX] << "makeLaTeXFile encoding: "
<< encoding << "..." << endl;
}
-void Buffer::makeDocBookFile(string const & fname,
+void Buffer::makeDocBookFile(FileName const & fname,
OutputParams const & runparams,
bool const body_only)
{
if (!openFileWrite(ofs, fname))
return;
- writeDocBookSource(ofs, fname, runparams, body_only);
+ writeDocBookSource(ofs, fname.absFilename(), runparams, body_only);
ofs.close();
if (ofs.fail())
busy(true);
// get LaTeX-Filename
- string const name = getLatexName();
+ string const name = getLatexName(false);
string const path = temppath();
string const org_path = filePath();
OutputParams runparams;
runparams.flavor = OutputParams::LATEX;
runparams.nice = false;
- makeLaTeXFile(name, org_path, runparams);
+ makeLaTeXFile(FileName(name), org_path, runparams);
TeXErrors terr;
- Chktex chktex(lyxrc.chktex_command, name, filePath());
+ Chktex chktex(lyxrc.chktex_command, onlyFilename(name), filePath());
int const res = chktex.run(terr); // run chktex
if (res == -1) {
if (it->lyxCode() == InsetBase::BIBTEX_CODE) {
InsetBibtex const & inset =
dynamic_cast<InsetBibtex const &>(*it);
- vector<string> const bibfiles = inset.getFiles(*this);
+ vector<FileName> const bibfiles = inset.getFiles(*this);
bibfilesCache_.insert(bibfilesCache_.end(),
bibfiles.begin(),
bibfiles.end());
InsetInclude & inset =
dynamic_cast<InsetInclude &>(*it);
inset.updateBibfilesCache(*this);
- vector<string> const & bibfiles =
+ vector<FileName> const & bibfiles =
inset.getBibfilesCache(*this);
bibfilesCache_.insert(bibfilesCache_.end(),
bibfiles.begin(),
}
-vector<string> const & Buffer::getBibfilesCache() const
+vector<FileName> const & Buffer::getBibfilesCache() const
{
// if this is a child document and the parent is already loaded
// use the parent's cache instead