]> git.lyx.org Git - lyx.git/blob - src/frontends/controllers/ControlBibitem.C
Compile fixes for DEC cxx, John's maths and keymap patches.
[lyx.git] / src / frontends / controllers / ControlBibitem.C
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2000 The LyX Team.
8  *
9  * ======================================================
10  *
11  * \file ControlBibitem.C
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 "ControlBibitem.h"
23 #include "Dialogs.h"
24 #include "LyXView.h"
25 #include "BufferView.h"
26
27 using SigC::slot;
28
29 ControlBibitem::ControlBibitem(LyXView & lv, Dialogs & d)
30         : ControlCommand(lv, d)
31 {
32         d_.showBibitem.connect(slot(this, &ControlBibitem::showInset));
33 }
34
35 void ControlBibitem::apply()
36 {
37         view().apply();
38
39         if (inset_ && params() != inset_->params()) {
40                 // FIXME:
41                 // confirm, is this only necessary for FormBibTeX ???
42                 if (params().getContents() != inset_->params().getContents())
43                         lv_.view()->ChangeCitationsIfUnique(
44                                 inset_->params().getContents(),
45                                 params().getContents());
46
47                 inset_->setParams(params());
48                 lv_.view()->updateInset(inset_, true);
49
50                 // We need to do a redraw because the maximum
51                 // InsetBibKey width could have changed
52                 lv_.view()->redraw();
53                 lv_.view()->fitCursor(lv_.view()->getLyXText());
54         }
55 }