2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 2001 The LyX Team.
9 * ======================================================
11 * \file ControlBibitem.C
12 * \author John Levon, moz@compsoc.man.ac.uk
13 * \author Angus Leeming <a.leeming@ic.ac.uk>
19 #pragma implementation
23 #include "ControlBibitem.h"
26 #include "BufferView.h"
30 ControlBibitem::ControlBibitem(LyXView & lv, Dialogs & d)
31 : ControlCommand(lv, d)
33 d_.showBibitem.connect(slot(this, &ControlBibitem::showInset));
36 void ControlBibitem::apply()
40 if (inset_ && params() != inset_->params()) {
42 // confirm, is this only necessary for FormBibTeX ???
43 if (params().getContents() != inset_->params().getContents())
44 lv_.view()->ChangeCitationsIfUnique(
45 inset_->params().getContents(),
46 params().getContents());
48 inset_->setParams(params());
49 lv_.view()->updateInset(inset_, true);
51 // We need to do a redraw because the maximum
52 // InsetBibKey width could have changed
54 lv_.view()->fitCursor(lv_.view()->getLyXText());