#include "InsetInclude.h"
-#include "LayoutFile.h"
#include "Buffer.h"
#include "buffer_funcs.h"
#include "BufferList.h"
#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>
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);
}
if (!isLyXFilename(included_file.absFilename()))
return 0;
- Buffer * child = theBufferList().getBuffer(included_file.absFilename());
+ Buffer * child = theBufferList().getBuffer(included_file);
if (!child) {
// the readonly flag can/will be wrong, not anymore I think.
if (!included_file.exists())
if (!loadIfNeeded(buffer(), params()))
return false;
- Buffer * tmp = theBufferList().getBuffer(included_file.absFilename());
+ Buffer * tmp = theBufferList().getBuffer(included_file);
if (tmp->params().baseClass() != masterBuffer->params().baseClass()) {
// FIXME UNICODE
DocFileName writefile(changeExtension(included_file, ".sgml"));
if (loadIfNeeded(buffer(), params())) {
- Buffer * tmp = theBufferList().getBuffer(included_file);
+ Buffer * tmp = theBufferList().getBuffer(FileName(included_file));
string const mangled = writefile.mangledFilename();
writefile = makeAbsPath(mangled,
// to be loaded:
if (loadIfNeeded(buffer(), params())) {
// a file got loaded
- Buffer * const tmp = theBufferList().getBuffer(included_file);
+ Buffer * const tmp = theBufferList().getBuffer(FileName(included_file));
// make sure the buffer isn't us
// FIXME RECURSIVE INCLUDES
// This is not sufficient, as recursive includes could be
{
if (loadIfNeeded(buffer(), params())) {
string const included_file = includedFilename(buffer(), params()).absFilename();
- Buffer * tmp = theBufferList().getBuffer(included_file);
+ Buffer * tmp = theBufferList().getBuffer(FileName(included_file));
BiblioInfo const & newkeys = tmp->localBibInfo();
keys.mergeBiblioInfo(newkeys);
}
InsetListingsParams const par(to_utf8(params()["lstparams"]));
if (par.getParamValue("caption").empty()) {
- listings_label_.clear();
+ listings_label_ = buffer().B_("Program Listing");
return;
}
Buffer const & master = *buffer().masterBuffer();