mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-11 05:33:33 +00:00
54 lines
1.2 KiB
C++
54 lines
1.2 KiB
C++
|
// -*- C++ -*-
|
||
|
/* This file is part of
|
||
|
* ======================================================
|
||
|
*
|
||
|
* LyX, The Document Processor
|
||
|
*
|
||
|
* Copyright 2000 The LyX Team.
|
||
|
*
|
||
|
* ======================================================
|
||
|
*
|
||
|
* \file ControlBibtex.C
|
||
|
* \author Angus Leeming <a.leeming@ic.ac.uk>
|
||
|
*/
|
||
|
|
||
|
#include <algorithm>
|
||
|
|
||
|
#ifdef __GNUG__
|
||
|
#pragma implementation
|
||
|
#endif
|
||
|
|
||
|
#include <config.h>
|
||
|
#include "ControlBibtex.h"
|
||
|
#include "Dialogs.h"
|
||
|
#include "LyXView.h"
|
||
|
#include "BufferView.h"
|
||
|
|
||
|
using SigC::slot;
|
||
|
|
||
|
ControlBibtex::ControlBibtex(LyXView & lv, Dialogs & d)
|
||
|
: ControlCommand(lv, d)
|
||
|
{
|
||
|
d_.showBibtex.connect(slot(this, &ControlBibtex::showInset));
|
||
|
}
|
||
|
|
||
|
void ControlBibtex::apply()
|
||
|
{
|
||
|
view().apply();
|
||
|
|
||
|
if (inset_ && params() != inset_->params()) {
|
||
|
if (params().getContents() != inset_->params().getContents())
|
||
|
lv_.view()->ChangeCitationsIfUnique(
|
||
|
inset_->params().getContents(),
|
||
|
params().getContents());
|
||
|
|
||
|
inset_->setParams(params());
|
||
|
lv_.view()->updateInset(inset_, true);
|
||
|
|
||
|
// We need to do a redraw because the maximum
|
||
|
// InsetBibKey width could have changed
|
||
|
lv_.view()->redraw();
|
||
|
lv_.view()->fitCursor(lv_.view()->getLyXText());
|
||
|
}
|
||
|
}
|