mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-14 06:57:01 +00:00
1eb8155fa0
Licence details can be found in the file COPYING. and thank God for sed. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5211 a592a061-630c-0410-9148-cb99ea01b6c8
57 lines
1.1 KiB
C
57 lines
1.1 KiB
C
/**
|
|
* \file ControlCommand.C
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Angus Leeming
|
|
*
|
|
* Full author contact details are available in file CREDITS
|
|
*/
|
|
|
|
#include <config.h>
|
|
|
|
#ifdef __GNUG__
|
|
#pragma implementation
|
|
#endif
|
|
|
|
#include "ControlCommand.h"
|
|
|
|
#include "BufferView.h"
|
|
#include "funcrequest.h"
|
|
#include "lyxfunc.h"
|
|
|
|
|
|
ControlCommand::ControlCommand(LyXView & lv, Dialogs & d, kb_action ac)
|
|
: ControlInset<InsetCommand, InsetCommandParams>(lv, d),
|
|
action_(ac)
|
|
{}
|
|
|
|
|
|
InsetCommandParams const ControlCommand::getParams(string const & arg)
|
|
{
|
|
InsetCommandParams params;
|
|
params.setFromString(arg);
|
|
return params;
|
|
}
|
|
|
|
|
|
InsetCommandParams const ControlCommand::getParams(InsetCommand const & inset)
|
|
{
|
|
return inset.params();
|
|
}
|
|
|
|
|
|
void ControlCommand::applyParamsToInset()
|
|
{
|
|
inset()->setParams(params());
|
|
bufferview()->updateInset(inset(), true);
|
|
}
|
|
|
|
|
|
void ControlCommand::applyParamsNoInset()
|
|
{
|
|
if (action_ == LFUN_NOACTION)
|
|
return;
|
|
lyxfunc().dispatch(FuncRequest(action_, params().getAsString()));
|
|
}
|