X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Finsets%2Finsetinclude.C;h=1d28e3347b4e8ab3b3389c3a5a03c663182e5127;hb=3c8aba3b556871fb1100a2f98cd93d5d4e3f70c9;hp=99c39b550d6683a67328c9d8619d3af07fee3d83;hpb=fa492d6bf09db7f1c278687e0000ad1c4833af3d;p=lyx.git diff --git a/src/insets/insetinclude.C b/src/insets/insetinclude.C index 99c39b550d..1d28e3347b 100644 --- a/src/insets/insetinclude.C +++ b/src/insets/insetinclude.C @@ -21,10 +21,13 @@ #include "include_form.h" #include "support/FileInfo.h" #include "layout.h" +#include "lyxfunc.h" + +using std::ostream; +using std::endl; extern BufferView * current_view; -extern LyXRC * lyxrc; extern BufferList bufferlist; @@ -107,7 +110,7 @@ extern "C" void include_cb(FL_OBJECT *, long arg) else ext = "*.lyx"; // launches dialog - fileDlg.SetButton(0, _("Documents"), lyxrc->document_path); + fileDlg.SetButton(0, _("Documents"), lyxrc.document_path); // Use by default the master's path string filename = fileDlg.Select(_("Select Child Document"), @@ -281,6 +284,12 @@ void InsetInclude::Read(LyXLex & lex) } +bool InsetInclude::display() const +{ + return !isInput(); +} + + string InsetInclude::getScreenLabel() const { string temp; @@ -301,6 +310,14 @@ string InsetInclude::getScreenLabel() const } +void InsetInclude::setContents(string const & c) +{ + InsetCommand::setContents(c); + filename = MakeAbsPath(contents, + OnlyPath(getMasterFilename())); +} + + bool InsetInclude::loadIfNeeded() const { if (isNoLoad() || isVerb()) return false; @@ -315,7 +332,8 @@ bool InsetInclude::loadIfNeeded() const } -int InsetInclude::Latex(ostream & os, signed char /*fragile*/, bool /*fs*/) const +int InsetInclude::Latex(ostream & os, + bool /*fragile*/, bool /*fs*/) const { // Do nothing if no file name has been specified if (contents.empty())