X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2FInsetInclude.cpp;h=d6e3ae2c63f9a7e808b6d0f62dd557b17528cc43;hb=cf6ff2cac79d09adafa63e3a1ec02dfb09f707b9;hp=7f33dadd6579ce5f369bfdc09784d4f967304599;hpb=28be7d552f62cc02fa86d7f79201d089bfb2d7b5;p=lyx.git diff --git a/src/insets/InsetInclude.cpp b/src/insets/InsetInclude.cpp index 7f33dadd65..d6e3ae2c63 100644 --- a/src/insets/InsetInclude.cpp +++ b/src/insets/InsetInclude.cpp @@ -165,7 +165,7 @@ InsetLabel * createLabel(Buffer * buf, docstring const & label_str) return new InsetLabel(buf, icp); } -} // namespace anon +} // namespace InsetInclude::InsetInclude(Buffer * buf, InsetCommandParams const & p) @@ -265,24 +265,24 @@ void InsetInclude::doDispatch(Cursor & cur, FuncRequest & cmd) InsetListingsParams new_params(to_utf8(p["lstparams"])); docstring const new_label = from_utf8(new_params.getParamValue("label")); - + if (new_label.empty()) { delete label_; label_ = 0; } else { docstring old_label; - if (label_) + if (label_) old_label = label_->getParam("name"); else { label_ = createLabel(buffer_, new_label); label_->setBuffer(buffer()); - } + } if (new_label != old_label) { label_->updateLabelAndRefs(new_label, &cur); // the label might have been adapted (duplicate) if (new_label != label_->getParam("name")) { - new_params.addParam("label", "{" + + new_params.addParam("label", "{" + to_utf8(label_->getParam("name")) + "}", true); p["lstparams"] = from_utf8(new_params.params()); } @@ -412,7 +412,7 @@ docstring InsetInclude::screenLabel() const Buffer * InsetInclude::getChildBuffer() const { - Buffer * childBuffer = loadIfNeeded(); + Buffer * childBuffer = loadIfNeeded(); // FIXME RECURSIVE INCLUDE // This isn't sufficient, as the inclusion could be downstream. @@ -427,7 +427,7 @@ Buffer * InsetInclude::loadIfNeeded() const // try to load the cloned child document again. if (buffer().isClone()) return child_buffer_; - + // Don't try to load it again if we failed before. if (failedtoload_ || isVerbatim(params()) || isListings(params())) return 0; @@ -436,7 +436,7 @@ Buffer * InsetInclude::loadIfNeeded() const // Use cached Buffer if possible. if (child_buffer_ != 0) { if (theBufferList().isLoaded(child_buffer_) - // additional sanity check: make sure the Buffer really is + // additional sanity check: make sure the Buffer really is // associated with the file we want. && child_buffer_ == theBufferList().getBuffer(included_file)) return child_buffer_; @@ -898,20 +898,20 @@ docstring InsetInclude::xhtml(XHTMLStream & xs, OutputParams const & rp) const return docstring(); // are we generating only some paragraphs, or all of them? - bool const all_pars = !rp.dryrun || - (rp.par_begin == 0 && + bool const all_pars = !rp.dryrun || + (rp.par_begin == 0 && rp.par_end == (int)buffer().text().paragraphs().size()); - + OutputParams op = rp; if (all_pars) { op.par_begin = 0; op.par_end = 0; ibuf->writeLyXHTMLSource(xs.os(), op, Buffer::IncludedFile); } else - xs << XHTMLStream::ESCAPE_NONE - << ""; return docstring(); } @@ -1072,7 +1072,7 @@ void InsetInclude::validate(LaTeXFeatures & features) const } -void InsetInclude::collectBibKeys(InsetIterator const & /*di*/) const +void InsetInclude::collectBibKeys(InsetIterator const & /*di*/, FileNameList & checkedFiles) const { Buffer * child = loadIfNeeded(); if (!child) @@ -1082,7 +1082,7 @@ void InsetInclude::collectBibKeys(InsetIterator const & /*di*/) const // But it'll have to do for now. if (child == &buffer()) return; - child->collectBibKeys(); + child->collectBibKeys(checkedFiles); } @@ -1209,7 +1209,7 @@ void add_preview(RenderMonitoredPreview & renderer, InsetInclude const & inset, } } -} // namespace anon +} // namespace void InsetInclude::addPreview(DocIterator const & /*inset_pos*/, @@ -1281,7 +1281,7 @@ void InsetInclude::updateCommand() InsetListingsParams par(to_utf8(params()["lstparams"])); par.addParam("label", "{" + to_utf8(new_label) + "}", true); p["lstparams"] = from_utf8(par.params()); - setParams(p); + setParams(p); }