+2006-01-07 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * outputparams.[Ch]: add new flag inComment
+
2006-01-04 Jean-Marc Lasgouttes <lasgouttes@lyx.org>
* text2.C (deleteEmptyParagraphMechanism): since we delete a
+2006-01-07 Georg Baum <Georg.Baum@post.rwth-aachen.de>
+
+ * ExternalSupport.[Ch] (updateExternal): add external_in_comment flag
+ * insetexternal.C (latex, linuxdoc, docbook, plaintext): Don't copy
+ files inside comments
+ * insetbibtex.C (latex): ditto
+ * insetinclude.C (latex, linuxdoc, docbook, plaintext): ditto
+ * insetnote.C (latex): set inComment flag in runparams and ignore
+ exported files for comment insets
+ * insetnote.C (linuxdoc): ditto
+ * insetnote.C (docbook): ditto
+ * insetnote.C (plaintext): ditto
+
2006-01-01 <larsbj@gullik.net>
* insetcharstyle.h: fix syntax error
string const & format,
Buffer const & buffer, ostream & os,
ExportData & exportdata,
- bool external_in_tmpdir)
+ bool external_in_tmpdir,
+ bool external_in_comment)
{
Template const * const et_ptr = getTemplatePtr(params);
if (!et_ptr)
return 0;
}
- updateExternal(params, format, buffer, exportdata, external_in_tmpdir);
+ if (!external_in_comment)
+ updateExternal(params, format, buffer, exportdata,
+ external_in_tmpdir);
bool const use_latex_path = format == "LaTeX";
string str = doSubstitution(params, buffer, cit->second.product,
Buffer const &,
std::ostream &,
ExportData &,
- bool external_in_tmpdir = false);
+ bool external_in_tmpdir,
+ bool external_in_comment);
} // namespace external
} // namespace lyx
normalize_name(buffer, runparams, input, ".bib");
string const in_file = database + ".bib";
- if (!runparams.nice && IsFileReadable(in_file)) {
+ if (!runparams.inComment && !runparams.nice &&
+ IsFileReadable(in_file)) {
database = FileName(database).mangledFilename();
string const out_file = MakeAbsPath(database + ".bib",
#include "insets/render_preview.h"
#include "buffer.h"
-#include "BufferView.h"
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
return external::writeExternal(params_, "PDFLaTeX",
buf, os,
*(runparams.exportdata),
- external_in_tmpdir);
+ external_in_tmpdir,
+ runparams.inComment);
}
return external::writeExternal(params_, "LaTeX", buf, os,
*(runparams.exportdata),
- external_in_tmpdir);
+ external_in_tmpdir,
+ runparams.inComment);
}
OutputParams const & runparams) const
{
return external::writeExternal(params_, "Ascii", buf, os,
- *(runparams.exportdata));
+ *(runparams.exportdata), false,
+ runparams.inComment);
}
OutputParams const & runparams) const
{
return external::writeExternal(params_, "LinuxDoc", buf, os,
- *(runparams.exportdata));
+ *(runparams.exportdata), false,
+ runparams.inComment);
}
OutputParams const & runparams) const
{
return external::writeExternal(params_, "DocBook", buf, os,
- *(runparams.exportdata));
+ *(runparams.exportdata), false,
+ runparams.inComment);
}
// of include files
Buffer const * m_buffer = buf.getMasterBuffer();
- // Return the output name if the file does not exist.
+ // Return the output name if we are inside a comment or the file does
+ // not exist.
// We are not going to change the extension or using the name of the
// temporary file, the code is already complicated enough.
- if (!IsFileReadable(orig_file))
+ if (runparams.inComment || !IsFileReadable(orig_file))
return params().filename.outputFilename(m_buffer->filePath());
// We place all temporary files in the master buffer's temp dir.
lyxerr[Debug::LATEX] << "exportfile:" << exportfile << endl;
lyxerr[Debug::LATEX] << "writefile:" << writefile << endl;
- if (loadIfNeeded(buffer, params_)) {
+ if (runparams.inComment)
+ // Don't try to load or copy the file
+ ;
+ else if (loadIfNeeded(buffer, params_)) {
Buffer * tmp = bufferlist.getBuffer(included_file);
if (tmp->params().textclass != m_buffer->params().textclass) {
tmp->markDepClean(m_buffer->temppath());
#ifdef WITH_WARNINGS
+#warning handle non existing files
#warning Second argument is irrelevant!
// since only_body is true, makeLaTeXFile will not look at second
// argument. Should we set it to string(), or should makeLaTeXFile
#include "cursor.h"
#include "debug.h"
#include "dispatchresult.h"
+#include "exporter.h"
#include "funcrequest.h"
#include "FuncStatus.h"
#include "gettext.h"
#include "LColor.h"
#include "lyxlex.h"
#include "metricsinfo.h"
+#include "outputparams.h"
#include "paragraph.h"
#include "support/lyxalgo.h"
int InsetNote::latex(Buffer const & buf, ostream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
+ OutputParams runparams(runparams_in);
string type;
- if (params_.type == InsetNoteParams::Comment)
+ if (params_.type == InsetNoteParams::Comment) {
type = "comment";
- else if (params_.type == InsetNoteParams::Greyedout)
+ runparams.inComment = true;
+ // Ignore files that are exported inside a comment
+ runparams.exportdata.reset(new ExportData);
+ } else if (params_.type == InsetNoteParams::Greyedout)
type = "lyxgreyedout";
ostringstream ss;
int InsetNote::linuxdoc(Buffer const & buf, std::ostream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
+ OutputParams runparams(runparams_in);
ostringstream ss;
- if (params_.type == InsetNoteParams::Comment)
+ if (params_.type == InsetNoteParams::Comment) {
ss << "<comment>\n";
+ runparams.inComment = true;
+ // Ignore files that are exported inside a comment
+ runparams.exportdata.reset(new ExportData);
+ }
InsetText::linuxdoc(buf, ss, runparams);
int InsetNote::docbook(Buffer const & buf, std::ostream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
+ OutputParams runparams(runparams_in);
ostringstream ss;
- if (params_.type == InsetNoteParams::Comment)
+ if (params_.type == InsetNoteParams::Comment) {
ss << "<remark>\n";
+ runparams.inComment = true;
+ // Ignore files that are exported inside a comment
+ runparams.exportdata.reset(new ExportData);
+ }
InsetText::docbook(buf, ss, runparams);
int InsetNote::plaintext(Buffer const & buf, std::ostream & os,
- OutputParams const & runparams) const
+ OutputParams const & runparams_in) const
{
if (params_.type == InsetNoteParams::Note)
return 0;
+ OutputParams runparams(runparams_in);
+ if (params_.type == InsetNoteParams::Comment) {
+ runparams.inComment = true;
+ // Ignore files that are exported inside a comment
+ runparams.exportdata.reset(new ExportData);
+ }
ostringstream ss;
ss << "[";
InsetText::plaintext(buf, ss, runparams);
: flavor(LATEX), nice(false), moving_arg(false),
local_font(0), free_spacing(false), use_babel(false),
linelen(0), depth(0),
- exportdata(new ExportData)
+ exportdata(new ExportData),
+ inComment(false)
{}
OutputParams instances.
*/
boost::shared_ptr<ExportData> exportdata;
+
+ /** Whether we are inside a comment inset. Insets that are including
+ * external files like InsetGraphics, InsetInclude and InsetExternal
+ * may only write the usual output and must not attempt to do
+ * something with the included files (e.g. copying, converting)
+ * if this flag is true, since they may not exist.
+ */
+ bool inComment;
};
#endif // NOT OUTPUTPARAMS_H