#include "insets/insetinclude.h"
#include "insets/insettext.h"
-#include "mathed/math_macrotemplate.h"
-#include "mathed/math_macrotable.h"
-#include "mathed/math_support.h"
+#include "mathed/MathMacroTemplate.h"
+#include "mathed/MathMacroTable.h"
+#include "mathed/MathSupport.h"
#include "frontends/Alert.h"
using lyx::support::makeLatexName;
using lyx::support::onlyFilename;
using lyx::support::onlyPath;
-using lyx::support::Path;
using lyx::support::quoteName;
using lyx::support::removeAutosaveFile;
using lyx::support::rename;
if (!temppath().empty() && !destroyDir(temppath())) {
Alert::warning(_("Could not remove temporary directory"),
- bformat(_("Could not remove the temporary directory %1$s"), temppath()));
+ bformat(_("Could not remove the temporary directory %1$s"),
+ lyx::from_utf8(temppath())));
}
// Remove any previewed LaTeX snippets associated with this buffer.
void unknownClass(string const & unknown)
{
Alert::warning(_("Unknown document class"),
- bformat(_("Using the default document class, because the "
- "class %1$s is unknown."), unknown));
+ bformat(_("Using the default document class, because the "
+ "class %1$s is unknown."), lyx::from_utf8(unknown)));
}
} // anon
unknownClass(unknown);
} else {
++unknown_tokens;
- string const s = bformat(_("Unknown token: "
- "%1$s %2$s\n"),
- token,
- lex.getString());
+ docstring const s = bformat(_("Unknown token: "
+ "%1$s %2$s\n"),
+ lyx::from_utf8(token),
+ lyx::from_utf8(lex.getString()));
errorList.push_back(ErrorItem(_("Document header error"),
s, -1, 0, 0));
}
}
}
if (begin_header_line) {
- string const s = _("\\begin_header is missing");
+ docstring const s = _("\\begin_header is missing");
errorList.push_back(ErrorItem(_("Document header error"),
s, -1, 0, 0));
}
lex.next();
string const token = lex.getString();
if (token != "\\begin_document") {
- string const s = _("\\begin_document is missing");
+ docstring const s = _("\\begin_document is missing");
errorList.push_back(ErrorItem(_("Document header error"),
s, -1, 0, 0));
}
if (!params().getLyXTextClass().load(filePath())) {
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.", theclass));
+ _("Using the default document class, because the "
+ " class %1$s could not be loaded."), lyx::from_utf8(theclass)));
params().textclass = 0;
}
if (!lex.isOK()) {
Alert::error(_("Document could not be read"),
- bformat(_("%1$s could not be read."), filename));
+ bformat(_("%1$s could not be read."), lyx::from_utf8(filename)));
return false;
}
if (!lex.isOK()) {
Alert::error(_("Document could not be read"),
- bformat(_("%1$s could not be read."), filename));
+ bformat(_("%1$s could not be read."), lyx::from_utf8(filename)));
return false;
}
Alert::error(_("Document format failure"),
bformat(_("%1$s is not a LyX document."),
- filename));
+ lyx::from_utf8(filename)));
return false;
}
bformat(_("%1$s is from an earlier"
" version of LyX, but a temporary"
" file for converting it could"
- " not be created."),
- filename));
+ " not be created."),
+ lyx::from_utf8(filename)));
return false;
}
string const lyx2lyx = libFileSearch("lyx2lyx", "lyx2lyx");
bformat(_("%1$s is from an earlier"
" version of LyX, but the"
" conversion script lyx2lyx"
- " could not be found."),
- filename));
+ " could not be found."),
+ lyx::from_utf8(filename)));
return false;
}
ostringstream command;
Alert::error(_("Conversion script failed"),
bformat(_("%1$s is from an earlier version"
" of LyX, but the lyx2lyx script"
- " failed to convert it."),
- filename));
+ " failed to convert it."),
+ lyx::from_utf8(filename)));
return false;
} else {
bool const ret = readFile(tmpfile);
if (readDocument(lex)) {
Alert::error(_("Document format failure"),
bformat(_("%1$s ended unexpectedly, which means"
- " that it is probably corrupted."),
- filename));
+ " that it is probably corrupted."),
+ lyx::from_utf8(filename)));
}
//lyxerr << "removing " << MacroTable::localMacros().size()
}
catch (fs::filesystem_error const & fe) {
Alert::error(_("Backup failure"),
- bformat(_("LyX was not able to make a backup copy in %1$s.\n"
- "Please check if the directory exists and is writeable."),
- fs::path(s).branch_path().native_directory_string()));
+ bformat(_("LyX was not able to make a backup copy in %1$s.\n"
+ "Please check if the directory exists and is writeable."),
+ lyx::from_utf8(fs::path(s).branch_path().native_directory_string())));
lyxerr[Debug::DEBUG] << "Fs error: "
<< fe.what() << endl;
}
string const path = temppath();
string const org_path = filePath();
- Path p(path); // path to LaTeX file
+ lyx::support::Path p(path); // path to LaTeX file
message(_("Running chktex..."));
// Generate the LaTeX file if neccessary
}
-string const Buffer::B_(string const & l10n) const
+docstring const Buffer::B_(string const & l10n) const
{
if (pimpl_->messages.get()) {
return pimpl_->messages->get(l10n);
if (full_source) {
os << "% Preview source code\n\n";
- if (isLatex())
+ if (isLatex())
writeLaTeXSource(os, filePath(), runparams, true, true);
- else
+ else
writeDocBookSource(os, fileName(), runparams, false);
} else {
runparams.par_begin = par_begin;