#include "lyxlex.h"
#include "metricsinfo.h"
#include "outputparams.h"
+#include "TocBackend.h"
#include "frontends/Alert.h"
#include "frontends/Painter.h"
#include <boost/bind.hpp>
#include <boost/filesystem/operations.hpp>
-#include "support/std_ostream.h"
-
-#include <sstream>
-
namespace lyx {
using support::changeExtension;
using support::contains;
using support::copy;
-using support::FileName;
+using support::DocFileName;
using support::getFileContents;
using support::isFileReadable;
using support::isLyXFilename;
// write it to a file (so far the complete file)
string const exportfile = changeExtension(incfile, ".tex");
- string const mangled = FileName(changeExtension(included_file,
+ string const mangled = DocFileName(changeExtension(included_file,
".tex")).mangledFilename();
string const writefile = makeAbsPath(mangled, m_buffer->temppath());
if (loadIfNeeded(buffer, params_)) {
Buffer * tmp = theBufferList().getBuffer(included_file);
- string const mangled = FileName(writefile).mangledFilename();
+ string const mangled = DocFileName(writefile).mangledFilename();
writefile = makeAbsPath(mangled,
buffer.getMasterBuffer()->temppath());
if (!runparams.nice)
runparams.exportdata->addExternalFile("docbook-xml", writefile,
exportfile);
- // FIXME UNICODE
if (isVerbatim(params_)) {
os << "<inlinegraphic fileref=\""
<< '&' << include_label << ';'
writefile = included_file;
if (!features.runparams().nice && !isVerbatim(params_)) {
- incfile = FileName(writefile).mangledFilename();
+ incfile = DocFileName(writefile).mangledFilename();
writefile = makeAbsPath(incfile,
buffer.getMasterBuffer()->temppath());
}
}
+void InsetInclude::addToToc(TocList & toclist, Buffer const & buffer) const
+{
+ Buffer const * const childbuffer = getChildBuffer(buffer, params_);
+ if (!childbuffer)
+ return;
+
+ TocList const & childtoclist = childbuffer->tocBackend().tocs();
+ TocList::const_iterator it = childtoclist.begin();
+ TocList::const_iterator const end = childtoclist.end();
+ for(; it != end; ++it)
+ toclist[it->first].insert(toclist[it->first].end(),
+ it->second.begin(), it->second.end());
+}
+
+
+void InsetInclude::updateLabels(Buffer const & buffer) const
+{
+ Buffer const * const childbuffer = getChildBuffer(buffer, params_);
+ if (!childbuffer)
+ return;
+
+ lyx::updateLabels(*childbuffer, true);
+}
+
+
string const InsetIncludeMailer::name_("include");
InsetIncludeMailer::InsetIncludeMailer(InsetInclude & inset)