// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
-int const LYX_FORMAT = 345; // jamatos: xml elements
+int const LYX_FORMAT = 348; // uwestoehr: add support for \*phantom
typedef map<string, bool> DepClean;
typedef map<docstring, pair<InsetLabel const *, Buffer::References> > RefCache;
// loop over children
Impl::BufferPositionMap::iterator it = d->children_positions.begin();
Impl::BufferPositionMap::iterator end = d->children_positions.end();
- for (; it != end; ++it)
- theBufferList().releaseChild(this, const_cast<Buffer *>(it->first));
+ for (; it != end; ++it) {
+ Buffer * child = const_cast<Buffer *>(it->first);
+ // The child buffer might have been closed already.
+ if (theBufferList().isLoaded(child))
+ theBufferList().releaseChild(this, child);
+ }
// clear references to children in macro tables
d->children_positions.clear();
// Uwe C. Schroeder
// changed to be public and have one parameter
-// Returns false if "\end_document" is not read (Asger)
+// Returns true if "\end_document" is not read (Asger)
bool Buffer::readDocument(Lexer & lex)
{
ErrorList & errorList = d->errorLists["Parse"];
if (params().outputChanges) {
bool dvipost = LaTeXFeatures::isAvailable("dvipost");
- bool xcolorsoul = LaTeXFeatures::isAvailable("soul") &&
+ bool xcolorulem = LaTeXFeatures::isAvailable("ulem") &&
LaTeXFeatures::isAvailable("xcolor");
- if (!dvipost && !xcolorsoul) {
+ if (!dvipost && !xcolorulem) {
Alert::warning(_("Changes not shown in LaTeX output"),
_("Changes will not be highlighted in LaTeX output, "
- "because neither dvipost nor xcolor/soul are installed.\n"
+ "because neither dvipost nor xcolor/ulem are installed.\n"
"Please install these packages or redefine "
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
- } else if (!xcolorsoul) {
+ } else if (!xcolorulem) {
Alert::warning(_("Changes not shown in LaTeX output"),
_("Changes will not be highlighted in LaTeX output "
- "when using pdflatex, because xcolor and soul are not installed.\n"
+ "when using pdflatex, because xcolor and ulem are not installed.\n"
"Please install both packages or redefine "
"\\lyxadded and \\lyxdeleted in the LaTeX preamble."));
}
FileName const master_file = makeAbsPath(params().master,
onlyPath(absFileName()));
if (isLyXFilename(master_file.absFilename())) {
- Buffer * master = checkAndLoadLyXFile(master_file);
- d->parent_buffer = master;
+ Buffer * master =
+ checkAndLoadLyXFile(master_file, true);
+ if (master) {
+ // set master as master buffer, but only
+ // if we are a real child
+ if (master->isChild(this))
+ setParent(master);
+ // if the master is not fully loaded
+ // it is probably just loading this
+ // child. No warning needed then.
+ else if (master->isFullyLoaded())
+ LYXERR0("The master '"
+ << params().master
+ << "' assigned to this document '"
+ << absFileName()
+ << "' does not include "
+ "this document. Ignoring the master assignment.");
+ }
}
}
{
FileName fname(filename);
+ params().compressed = fname.isZippedFile();
+
// remove dummy empty par
paragraphs().clear();
Lexer lex;
}
+std::vector<Buffer *> Buffer::getChildren() const
+{
+ std::vector<Buffer *> clist;
+ // loop over children
+ Impl::BufferPositionMap::iterator it = d->children_positions.begin();
+ Impl::BufferPositionMap::iterator end = d->children_positions.end();
+ for (; it != end; ++it) {
+ Buffer * child = const_cast<Buffer *>(it->first);
+ clist.push_back(child);
+ // there might be grandchildren
+ std::vector<Buffer *> glist = child->getChildren();
+ for (vector<Buffer *>::const_iterator git = glist.begin();
+ git != glist.end(); ++git)
+ clist.push_back(*git);
+ }
+ return clist;
+}
+
+
template<typename M>
typename M::iterator greatest_below(M & m, typename M::key_type const & x)
{
}
+bool Buffer::hasGuiDelegate() const
+{
+ return gui_;
+}
+
+
void Buffer::setGuiDelegate(frontend::GuiBufferDelegate * gui)
{
gui_ = gui;
if (master != this) {
bufToUpdate.insert(this);
master->updateLabels(false);
+ // Do this here in case the master has no gui associated with it. Then,
+ // the TocModel is not updated and TocModel::toc_ is invalid (bug 5699).
+ if (!master->gui_)
+ structureChanged();
// was buf referenced from the master (i.e. not in bufToUpdate anymore)?
if (bufToUpdate.find(this) == bufToUpdate.end())
// update all caches
clearReferenceCache();
- inset().setBuffer(const_cast<Buffer &>(*this));
updateMacros();
Buffer & cbuf = const_cast<Buffer &>(*this);