]> git.lyx.org Git - lyx.git/blobdiff - src/insets/InsetInclude.cpp
Stupid bug fix.
[lyx.git] / src / insets / InsetInclude.cpp
index c0f10af568b3508656ae8a40404674ace52596c5..38e61ae59e63a3c8f5da3342e163c5595caec14c 100644 (file)
@@ -13,7 +13,6 @@
 
 #include "InsetInclude.h"
 
-#include "LayoutFile.h"
 #include "Buffer.h"
 #include "buffer_funcs.h"
 #include "BufferList.h"
@@ -27,6 +26,7 @@
 #include "FuncRequest.h"
 #include "FuncStatus.h"
 #include "LaTeXFeatures.h"
+#include "LayoutFile.h"
 #include "LyX.h"
 #include "LyXFunc.h"
 #include "LyXRC.h"
 #include "insets/InsetListingsParams.h"
 #include "insets/RenderPreview.h"
 
-#include "support/lassert.h"
+#include "support/convert.h"
 #include "support/debug.h"
 #include "support/docstream.h"
 #include "support/FileNameList.h"
 #include "support/filetools.h"
 #include "support/gettext.h"
+#include "support/lassert.h"
 #include "support/lstrings.h" // contains
 #include "support/lyxalgo.h"
-#include "support/convert.h"
 
 #include <boost/bind.hpp>
 
@@ -185,28 +185,6 @@ InsetInclude::InsetInclude(InsetInclude const & other)
 InsetInclude::~InsetInclude()
 {
        delete label_;
-       if (isVerbatim(params()) || isListings(params()))
-               return;
-
-
-       string const parent_filename = buffer().absFileName();
-       FileName const included_file = makeAbsPath(to_utf8(params()["filename"]),
-                          onlyPath(parent_filename));
-
-       if (!isLyXFilename(included_file.absFilename()))
-               return;
-
-       Buffer * child = theBufferList().getBuffer(included_file.absFilename());
-       // File not opened, nothing to close.
-       if (!child)
-               return;
-
-       // Child document has a different parent, don't close it.
-       if (child->parent() != &buffer())
-               return;
-
-       //close the buffer.
-       theBufferList().release(child);
 }