]> git.lyx.org Git - lyx.git/blobdiff - src/Buffer.cpp
Abdel is right.
[lyx.git] / src / Buffer.cpp
index 65b1418140998a52c023f0cd16f45ee2a95338fb..78aaf190701e76ea13583563aa4187964d6189a9 100644 (file)
@@ -265,16 +265,9 @@ Buffer::~Buffer()
        // GuiView already destroyed
        gui_ = 0;
 
-       Buffer const * master = masterBuffer();
-       if (master != this && use_gui) {
-               // We are closing buf which was a child document so we
-               // must update the labels and section numbering of its master
-               // Buffer.
-               updateLabels(*master);
-               master->updateMacros();
-       }
-
-       resetChildDocuments(false);
+       // clear references to children in macro tables
+       d->children_positions.clear();
+       d->position_to_children.clear();
 
        if (!d->temppath.destroyDirectory()) {
                Alert::warning(_("Could not remove temporary directory"),
@@ -599,7 +592,7 @@ void Buffer::insertStringAsLines(ParagraphList & pars,
                if (*cit == '\n') {
                        if (autobreakrows && (!par.empty() || par.allowEmpty())) {
                                breakParagraph(params(), pars, pit, pos,
-                                              par.layout()->isEnvironment());
+                                              par.layout().isEnvironment());
                                ++pit;
                                pos = 0;
                                space_inserted = true;
@@ -1841,7 +1834,7 @@ void Buffer::updateEnvironmentMacros(DocIterator & it,
                // increased depth?
                if ((par.params().depth() > depth
                     || par.params().leftIndent() != leftIndent)
-                   && par.layout()->isEnvironment()) {
+                   && par.layout().isEnvironment()) {
                        updateBlockMacros(it, scope);
                        continue;
                }
@@ -1931,7 +1924,7 @@ void Buffer::updateBlockMacros(DocIterator & it, DocIterator & scope) const
        // set scope for macros in this paragraph:
        // * either the "old" outer scope
        // * or the scope ending after the environment
-       if (par.layout()->isEnvironment()) {
+       if (par.layout().isEnvironment()) {
                // find end of environment block,
                DocIterator envEnd = it;
                pit_type n = it.lastpit() + 1;
@@ -2359,26 +2352,6 @@ void Buffer::autoSave() const
 }
 
 
-void Buffer::resetChildDocuments(bool close_them) const
-{
-       if (text().empty())
-               return;
-
-       for (InsetIterator it = inset_iterator_begin(inset()); it; ++it) {
-               if (it->lyxCode() != INCLUDE_CODE)
-                       continue;
-               InsetCommand const & inset = static_cast<InsetCommand const &>(*it);
-               InsetCommandParams const & ip = inset.params();
-
-               resetParentBuffer(this, ip, close_them);
-       }
-
-       // clear references to children in macro tables
-       d->children_positions.clear();
-       d->position_to_children.clear();
-}
-
-
 string Buffer::bufferFormat() const
 {
        if (isDocBook())