]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBibitem.C
Once again the user can use the Font button on the toolbar to get the current
[lyx.git] / src / frontends / controllers / ControlBibitem.C
1 /* This file is part of
2  * ====================================================== 
3  *
4  *           LyX, The Document Processor
5  *
6  *           Copyright 2001 The LyX Team.
7  *
8  * ======================================================
9  *
10  * \file ControlBibitem.C
11  * \author John Levon, moz@compsoc.man.ac.uk
12  * \author Angus Leeming <a.leeming@ic.ac.uk>
13  */
14
15 #include <algorithm>
16
17 #ifdef __GNUG__
18 #pragma implementation
19 #endif
20
21 #include <config.h>
22 #include "ViewBase.h"
23 #include "ButtonControllerBase.h"
24 #include "ControlBibitem.h"
25 #include "Dialogs.h"
26 #include "LyXView.h"
27 #include "buffer.h"
28
29 using SigC::slot;
30
31 ControlBibitem::ControlBibitem(LyXView & lv, Dialogs & d)
32         : ControlCommand(lv, d)
33 {
34         d_.showBibitem.connect(slot(this, &ControlBibitem::showInset));
35 }
36
37 void ControlBibitem::applyParamsToInset()
38 {
39         // FIXME:
40         // confirm, is this only necessary for FormBibTeX ???
41         if (params().getContents() != inset()->params().getContents())
42                 lv_.view()->ChangeCitationsIfUnique(inset()->params().getContents(),
43                                                     params().getContents());
44
45         inset()->setParams(params());
46         lv_.view()->updateInset(inset(), true);
47
48         // We need to do a redraw because the maximum
49         // InsetBibKey width could have changed
50         lv_.view()->redraw();
51         lv_.view()->fitCursor(lv_.view()->getLyXText());
52 }