]> git.lyx.org Git - lyx.git/blob - src/insets/insetparent.C
Don't remove cell selections after fontchange.
[lyx.git] / src / insets / insetparent.C
1 /* This file is part of*
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *       
6  *           Copyright 1997-2001 The LyX Team.
7  * 
8  * ====================================================== */
9
10
11 // Created by asierra 970813
12
13 #include <config.h>
14
15
16 #ifdef __GNUG__
17 #pragma implementation
18 #endif
19
20 #include "insetparent.h"
21 #include "support/filetools.h"
22 #include "BufferView.h"
23 #include "LyXView.h"
24 #include "support/LOstream.h"
25 #include "commandtags.h"
26 #include "buffer.h"
27 #include "gettext.h"
28 #include "lyxfunc.h"
29
30 using std::ostream;
31
32
33 InsetParent::InsetParent(InsetCommandParams const & p, Buffer const & bf, bool)
34         : InsetCommand(p)
35 {
36         string const fn = p.getContents();
37         setContents(MakeAbsPath(fn, bf.filePath()));
38 }
39
40
41 string const InsetParent::getScreenLabel(Buffer const *) const 
42 {
43         return string(_("Parent:")) + getContents();
44 }
45
46
47 void InsetParent::edit(BufferView * bv, int, int, unsigned int)
48 {    
49         bv->owner()->getLyXFunc()->
50                 dispatch(LFUN_CHILDOPEN, getContents());
51 }
52
53
54 void InsetParent::edit(BufferView * bv, bool)
55 {
56         edit(bv, 0, 0, 0);
57 }
58
59
60 // LaTeX must just ignore this command
61 int InsetParent::latex(Buffer const * buf, ostream & os,
62                        bool fragile, bool free_spc) const
63 {
64         os << "%%#{lyx}";
65         InsetCommand::latex(buf, os, fragile, free_spc);
66         return 0;
67 }