OutputParams runparams = runparams_in;
string const encoding = runparams.encoding->iconvName();
- LYXERR(Debug::LATEX, "makeLaTeXFile encoding: " << encoding << ", fname=" << fname.realPath());
+ LYXERR(Debug::OUTFILE, "makeLaTeXFile encoding: " << encoding << ", fname=" << fname.realPath());
ofdocstream ofs;
try { ofs.reset(encoding); }
BufferEncodings::initUnicodeMath(*this);
// validate the buffer.
- LYXERR(Debug::LATEX, " Validating buffer...");
+ LYXERR(Debug::OUTFILE, " Validating buffer...");
LaTeXFeatures features(*this, params(), runparams);
validate(features);
// This is only set once per document (in master)
runparams.use_hyperref = features.isRequired("hyperref");
runparams.use_CJK = features.mustProvide("CJK");
}
- LYXERR(Debug::LATEX, " Buffer validation done.");
+ LYXERR(Debug::OUTFILE, " Buffer validation done.");
bool const output_preamble =
output == FullSource || output == OnlyPreamble;
if (output_preamble) {
os << "\\end{document}\n";
- LYXERR(Debug::LATEX, "makeLaTeXFile...done");
+ LYXERR(Debug::OUTFILE, "makeLaTeXFile...done");
} else {
- LYXERR(Debug::LATEX, "LaTeXFile for inclusion made.");
+ LYXERR(Debug::OUTFILE, "LaTeXFile for inclusion made.");
}
runparams_in.encoding = runparams.encoding;
OutputParams const & runparams,
OutputWhat output) const
{
- LYXERR(Debug::LATEX, "makeDocBookFile...");
+ LYXERR(Debug::OUTFILE, "makeDocBookFile...");
ofdocstream ofs;
if (!openFileWrite(ofs, fname))
bool const output_preamble =
output == FullSource || output == OnlyPreamble;
bool const output_body =
- output == FullSource || output == OnlyBody || output == IncludedFile;
+ output == FullSource || output == OnlyBody || output == IncludedFile;
if (output_preamble) {
// XML preamble, no doctype needed.
// Prepare the name space declaration for MathML depending on document preferences.
string mathmlNamespace;
if (params().docbook_mathml_prefix != BufferParams::NoPrefix) {
- string mathmlPrefix;
- if (params().docbook_mathml_prefix == BufferParams::MPrefix)
- mathmlPrefix = "m";
- else if (params().docbook_mathml_prefix == BufferParams::MMLPrefix)
- mathmlPrefix = "mml";
+ string mathmlPrefix;
+ if (params().docbook_mathml_prefix == BufferParams::MPrefix)
+ mathmlPrefix = "m";
+ else if (params().docbook_mathml_prefix == BufferParams::MMLPrefix)
+ mathmlPrefix = "mml";
mathmlNamespace = + " xmlns:" + mathmlPrefix + "=\"http://www.w3.org/1998/Math/MathML\"";
- }
+ }
// Directly output the root tag, based on the current type of document.
string languageCode = params().language->code();
Buffer::ExportStatus Buffer::makeLyXHTMLFile(FileName const & fname,
OutputParams const & runparams) const
{
- LYXERR(Debug::LATEX, "makeLyXHTMLFile...");
+ LYXERR(Debug::OUTFILE, "makeLyXHTMLFile...");
ofdocstream ofs;
if (!openFileWrite(ofs, fname))
for (Paragraph const & p : paragraphs())
p.validate(features);
- if (lyxerr.debugging(Debug::LATEX)) {
+ if (lyxerr.debugging(Debug::OUTFILE)) {
features.showStruct();
}
}
-void Buffer::getLabelList(vector<docstring> & list) const
+void Buffer::getLabelList(vector<std::pair<docstring, docstring>> & list) const
{
// If this is a child document, use the master's list instead.
if (parent()) {
shared_ptr<Toc> toc = d->toc_backend.toc("label");
for (auto const & tocit : *toc) {
if (tocit.depth() == 0)
- list.push_back(tocit.str());
+ list.push_back(make_pair(tocit.str(), tocit.asString()));
}
}
// loop over children
for (auto const & p : d->children_positions) {
Buffer * child = const_cast<Buffer *>(p.first);
- // This can happen when called during GUI operations
- if (!theBufferList().isLoaded(child))
- continue;
// No duplicates
ListOfBuffers::const_iterator bit = find(children.begin(), children.end(), child);
if (bit != children.end())
{
LBUFERR(!text().paragraphs().empty());
+ // This can be called when loading a file, so that there be no
+ // open undo group.
+ UndoGroupHelper ugh(const_cast<Buffer *>(this));
+
// Use the master text class also for child documents
Buffer const * const master = masterBuffer();
DocumentClass const & textclass = master->params().documentClass();
switch(layout.labeltype) {
case LABEL_ITEMIZE: {
- // At some point of time we should do something more
- // clever here, like:
- // par.params().labelString(
- // bp.user_defined_bullet(par.itemdepth).getText());
- // for now, use a simple hardcoded label
- docstring itemlabel;
- switch (par.itemdepth) {
- case 0:
- // • U+2022 BULLET
- itemlabel = char_type(0x2022);
- break;
- case 1:
- // – U+2013 EN DASH
- itemlabel = char_type(0x2013);
- break;
- case 2:
- // ∗ U+2217 ASTERISK OPERATOR
- itemlabel = char_type(0x2217);
- break;
- case 3:
- // · U+00B7 MIDDLE DOT
- itemlabel = char_type(0x00b7);
- break;
- }
- par.params().labelString(itemlabel);
+ par.params().labelString(
+ (par.itemdepth < 4)
+ ? bp.user_defined_bullet(par.itemdepth).getLabel()
+ // Display fallback for too deeply nested items
+ : bformat(from_ascii("[?%1$d]"), int(par.itemdepth + 1)));
break;
}