]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetinclude.C
clear()->erase() ; lots of using directives for cxx
[lyx.git] / src / insets / insetinclude.C
index 99c39b550d6683a67328c9d8619d3af07fee3d83..1d28e3347b4e8ab3b3389c3a5a03c663182e5127 100644 (file)
 #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())