LFUN_INSET_MODIFY

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@6336 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Angus Leeming 2003-03-04 14:31:04 +00:00
parent 543964eb3a
commit e5cd3ce1a4
13 changed files with 49 additions and 25 deletions

View File

@ -1178,14 +1178,14 @@ bool BufferView::Pimpl::dispatch(FuncRequest const & ev_in)
string const name = ev.getArg(0);
InsetBase * base = owner_->getDialogs().getOpenInset(name);
Inset * inset = 0;
if (base) {
// This works both for 'original' and 'mathed' insets.
// Note that the localDispatch performs updateInset
// also.
base->localDispatch(ev);
FuncRequest fr(bv_, LFUN_INSET_MODIFY, ev.argument);
base->localDispatch(fr);
} else {
inset = createInset(ev);
Inset * inset = createInset(ev);
if (inset && insertInset(inset)) {
updateInset(inset, true);
} else {

View File

@ -1,3 +1,11 @@
2003-03-04 Angus Leeming <leeming@lyx.org>
* commandtags.h:
* LyXAction.C: new LFUN_INSET_MODIFY.
* BufferView_pimpl.C (dispatch): if an inset is found to be open
on LFUN_INSET_APPLY, pass LFUN_INSET_MODIFY to its localDispatch.
2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* several files: ws changes only

View File

@ -421,6 +421,7 @@ void LyXAction::init()
{ LFUN_DIALOG_DISCONNECT_INSET, "dialog-disconnect-inset",
N_("Disconnect the dialog from the current inset"), Noop },
{ LFUN_INSET_APPLY, "inset-apply", "", Noop },
{ LFUN_INSET_MODIFY, "", "internal only", Noop },
{ LFUN_NOACTION, "", "", Noop }
};

View File

@ -297,6 +297,7 @@ enum kb_action {
LFUN_DIALOG_HIDE,
LFUN_DIALOG_DISCONNECT_INSET,
LFUN_INSET_APPLY,
LFUN_INSET_MODIFY,
LFUN_LASTACTION /* this marks the end of the table */
};

View File

@ -1,3 +1,12 @@
2003-03-04 Angus Leeming <leeming@lyx.org>
* insetbibitem.C (localDispatch):
* insetbibtex.C (localDispatch):
* insetcommand.C (localDispatch):
* insetert.C (localDispatch):
* insetlabel.C (localDispatch):
handle LFUN_INSET_MODIFY, not LFUN_INSET_APPLY.
2003-03-04 Lars Gullik Bjønnes <larsbj@gullik.net>
* insettext.C (latex): adjust for ParagraphList::iterator

View File

@ -51,7 +51,7 @@ Inset * InsetBibitem::clone(Buffer const &, bool) const
dispatch_result InsetBibitem::localDispatch(FuncRequest const & cmd)
{
if (cmd.action != LFUN_INSET_APPLY)
if (cmd.action != LFUN_INSET_MODIFY)
return UNDISPATCHED;
InsetCommandParams p;

View File

@ -48,7 +48,7 @@ InsetBibtex::~InsetBibtex()
dispatch_result InsetBibtex::localDispatch(FuncRequest const & cmd)
{
if (cmd.action != LFUN_INSET_APPLY)
if (cmd.action != LFUN_INSET_MODIFY)
return UNDISPATCHED;
InsetCommandParams p;

View File

@ -67,7 +67,7 @@ int InsetCommand::docbook(Buffer const *, ostream &, bool) const
dispatch_result InsetCommand::localDispatch(FuncRequest const & cmd)
{
if (cmd.action != LFUN_INSET_APPLY)
if (cmd.action != LFUN_INSET_MODIFY)
return UNDISPATCHED;
InsetCommandParams p;

View File

@ -442,7 +442,7 @@ int InsetERT::docbook(Buffer const *, ostream & os, bool) const
Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
{
Inset::RESULT result = DISPATCHED_NOUPDATE;
Inset::RESULT result = UNDISPATCHED;
BufferView * bv = cmd.view();
if (inset.paragraph()->empty()) {
@ -450,33 +450,34 @@ Inset::RESULT InsetERT::localDispatch(FuncRequest const & cmd)
}
switch (cmd.action) {
case LFUN_INSET_APPLY: {
if (!bv)
return UNDISPATCHED;
case LFUN_INSET_MODIFY: {
InsetERT::ERTStatus status_;
InsetERTMailer::string2params(cmd.argument, status_);
status(bv, status_);
bv->updateInset(this, true);
return DISPATCHED;
result = DISPATCHED;
}
break;
case LFUN_MOUSE_PRESS:
lfunMousePress(cmd);
return DISPATCHED;
result = DISPATCHED;
break;
case LFUN_MOUSE_MOTION:
lfunMouseMotion(cmd);
return DISPATCHED;
result = DISPATCHED;
break;
case LFUN_MOUSE_RELEASE:
lfunMouseRelease(cmd);
return DISPATCHED;
result = DISPATCHED;
break;
case LFUN_LAYOUT:
bv->owner()->setLayout(inset.paragraph()->layout()->name());
result = DISPATCHED_NOUPDATE;
break;
default:

View File

@ -54,7 +54,7 @@ void InsetLabel::edit(BufferView *, int, int, mouse_button::state)
dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
{
if (cmd.action != LFUN_INSET_APPLY)
if (cmd.action != LFUN_INSET_MODIFY)
return UNDISPATCHED;
InsetCommandParams p;
@ -64,8 +64,8 @@ dispatch_result InsetLabel::localDispatch(FuncRequest const & cmd)
bool clean = true;
if (view() && p.getContents() != params().getContents()) {
clean = view()->ChangeCitationsIfUnique(params().getContents(),
p.getContents());
clean = view()->ChangeRefsIfUnique(params().getContents(),
p.getContents());
}
setParams(p);

View File

@ -1,3 +1,11 @@
2003-03-04 Angus Leeming <leeming@lyx.org>
* formulabase.C (localDispatch): if an inset is found on
LFUN_INSET_APPLY, send LFUN_INSET_MODIFY to the inset's localDispatch.
* ref_inset.C (localDispatch): handle LFUN_INSET_MODIFY, not
LFUN_INSET_APPLY.
2003-03-03 Lars Gullik Bjønnes <larsbj@gullik.net>
* formulabase.h: adjust for boost 1.30.0

View File

@ -806,16 +806,12 @@ dispatch_result InsetFormulaBase::localDispatch(FuncRequest const & cmd)
case LFUN_INSET_APPLY: {
string const name = cmd.getArg(0);
if (name != "ref") {
result = UNDISPATCHED;
break;
}
InsetBase * base =
bv->owner()->getDialogs().getOpenInset(name);
if (base) {
result = base->localDispatch(cmd);
FuncRequest fr(bv, LFUN_INSET_MODIFY, cmd.argument);
result = base->localDispatch(fr);
} else {
// Turn 'argument' into a temporary RefInset.
MathArray ar;

View File

@ -133,7 +133,7 @@ int RefInset::docbook(std::ostream & os, bool) const
dispatch_result RefInset::localDispatch(FuncRequest const & cmd)
{
if (cmd.action != LFUN_INSET_APPLY || cmd.getArg(0) != "ref")
if (cmd.action != LFUN_INSET_MODIFY || cmd.getArg(0) != "ref")
return UNDISPATCHED;
MathArray ar;