]> git.lyx.org Git - lyx.git/blobdiff - src/insets/insetparent.C
fix compilation pb ; update eu.po
[lyx.git] / src / insets / insetparent.C
index 36721161105f8f7bd15eafa4a99eff937136a679..9ad0f61bbb7985cc0e7a78ef2c7c067d94812cfd 100644 (file)
 #include "support/filetools.h"
 #include "BufferView.h"
 #include "LyXView.h"
-#include "lyxfunc.h"
 #include "commandtags.h"
 #include "buffer.h"
 #include "gettext.h"
+#include "lyxfunc.h"
 
 using std::ostream;
 
-InsetParent::InsetParent(InsetCommandParams const & p, Buffer * bf)
+
+InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf)
        : InsetCommand(p)
 {
-       string fn = p.getContents();
-       if (bf)
-               setContents(MakeAbsPath(fn, OnlyPath(bf->fileName())));
-       else
-               setContents(fn);
+       string const fn = p.getContents();
+       setContents(MakeAbsPath(fn, OnlyPath(bf.fileName())));
 }
 
 
-string InsetParent::getScreenLabel() const 
+string const InsetParent::getScreenLabel() const 
 {
        return string(_("Parent:")) + getContents();
 }
@@ -48,7 +46,7 @@ string InsetParent::getScreenLabel() const
 void InsetParent::Edit(BufferView * bv, int, int, unsigned int)
 {    
        bv->owner()->getLyXFunc()->
-               Dispatch(LFUN_CHILDOPEN, getContents().c_str());
+               Dispatch(LFUN_CHILDOPEN, getContents());
 }