mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
DocBook: fix file inclusion.
Previously, nothing was output. Special care was needed for when new paragraphs should be open (this work is probably not finished yet).
This commit is contained in:
parent
334552ade5
commit
d1b9af3b1d
@ -2136,7 +2136,7 @@ Buffer::ExportStatus Buffer::writeDocBookSource(odocstream & os,
|
||||
bool const output_preamble =
|
||||
output == FullSource || output == OnlyPreamble;
|
||||
bool const output_body =
|
||||
output == FullSource || output == OnlyBody;
|
||||
output == FullSource || output == OnlyBody || output == IncludedFile;
|
||||
|
||||
if (output_preamble) {
|
||||
// XML preamble, no doctype needed.
|
||||
|
@ -26,8 +26,8 @@ OutputParams::OutputParams(Encoding const * enc)
|
||||
use_hyperref(false), use_CJK(false),
|
||||
use_indices(false), use_japanese(false), linelen(0), depth(0),
|
||||
exportdata(new ExportData), postpone_fragile_stuff(false), inDisplayMath(false),
|
||||
wasDisplayMath(false), inComment(false), openbtUnit(false), only_childbibs(false),
|
||||
inTableCell(NO), inFloat(NONFLOAT),
|
||||
wasDisplayMath(false), inComment(false), inInclude(false), openbtUnit(false),
|
||||
only_childbibs(false), inTableCell(NO), inFloat(NONFLOAT),
|
||||
inIndexEntry(false), inIPA(false), inDeletedInset(0),
|
||||
changeOfDeletedInset(Change::UNCHANGED), ctObject(CT_NORMAL),
|
||||
par_begin(0), par_end(0), lastid(-1), lastpos(0), isLastPar(false),
|
||||
|
@ -260,6 +260,10 @@ public:
|
||||
*/
|
||||
bool inComment;
|
||||
|
||||
/** Whether we are inside an include inset.
|
||||
*/
|
||||
bool inInclude;
|
||||
|
||||
/** Whether a btUnit (for multiple biblographies) is open.
|
||||
*/
|
||||
mutable bool openbtUnit;
|
||||
|
@ -1102,6 +1102,7 @@ void InsetInclude::docbook(XMLStream & xs, OutputParams const & rp) const
|
||||
if (all_pars) {
|
||||
op.par_begin = 0;
|
||||
op.par_end = 0;
|
||||
op.inInclude = true;
|
||||
ibuf->writeDocBookSource(xs.os(), op, Buffer::IncludedFile);
|
||||
} else {
|
||||
xs << XMLStream::ESCAPE_NONE << "<!-- Included file: ";
|
||||
|
@ -473,6 +473,10 @@ void makeParagraph(
|
||||
special_case |= nInsets == (size_t) par->size() && std::all_of(par->insetList().begin(), par->insetList().end(), [](InsetList::Element inset) {
|
||||
return inset.inset->lyxCode() == BOX_CODE;
|
||||
});
|
||||
// Includes should not have a paragraph.
|
||||
special_case |= nInsets == (size_t) par->size() && std::all_of(par->insetList().begin(), par->insetList().end(), [](InsetList::Element inset) {
|
||||
return inset.inset->lyxCode() == INCLUDE_CODE;
|
||||
});
|
||||
|
||||
bool const open_par = runparams.docbook_make_pars
|
||||
&& !runparams.docbook_in_par
|
||||
@ -922,7 +926,7 @@ void outputDocBookInfo(
|
||||
|
||||
// If there is no title, generate one (required for the document to be valid).
|
||||
// This code is called for the main document, for table cells, etc., so be precise in this condition.
|
||||
if (text.isMainText() && info.shouldBeInInfo.empty()) {
|
||||
if (text.isMainText() && info.shouldBeInInfo.empty() && !runparams.inInclude) {
|
||||
xs << xml::StartTag("title");
|
||||
xs << "Untitled Document";
|
||||
xs << xml::EndTag("title");
|
||||
|
Loading…
Reference in New Issue
Block a user