#include "frontends/Dialogs.h"
#include "insets/insetspecialchar.h"
#include "insets/insettext.h"
-#include "insets/insetbib.h"
#include "insets/insetquotes.h"
#include "insets/insetcommand.h"
#include "undo_funcs.h"
bv->updateInset(new_inset, true);
}
+
void doInsertInset(LyXText * lt, FuncRequest const & cmd,
bool edit, bool pastesel)
{
Inset * inset = createInset(cmd);
BufferView * bv = cmd.view();
-
+
if (inset) {
bool gotsel = false;
if (lt->selection.set()) {
else
delete inset;
}
-
}
}
case LFUN_UPCASE_WORD:
update(bv, false);
- changeCase(bv, LyXText::text_uppercase);
+ changeCase(*bv, LyXText::text_uppercase);
if (inset_owner)
bv->updateInset(inset_owner, true);
update(bv);
case LFUN_LOWCASE_WORD:
update(bv, false);
- changeCase(bv, LyXText::text_lowercase);
+ changeCase(*bv, LyXText::text_lowercase);
if (inset_owner)
bv->updateInset(inset_owner, true);
update(bv);
case LFUN_CAPITALIZE_WORD:
update(bv, false);
- changeCase(bv, LyXText::text_capitalization);
+ changeCase(*bv, LyXText::text_capitalization);
if (inset_owner)
bv->updateInset(inset_owner, true);
update(bv);
case LFUN_BEGINNINGBUFSEL:
if (inset_owner)
- return Inset::UNDISPATCHED;
+ return UNDISPATCHED;
update(bv, false);
cursorTop(bv);
finishChange(bv, true);
case LFUN_ENDBUFSEL:
if (inset_owner)
- return Inset::UNDISPATCHED;
+ return UNDISPATCHED;
update(bv, false);
cursorBottom(bv);
finishChange(bv, true);
} else {
FuncRequest cmd1(bv, LFUN_MOUSE_RELEASE, x, y, cmd.button());
inset_hit->localDispatch(cmd1);
- // IMO this is a grosshack! Inset's should be changed so that
+ // IMO this is a gross hack! Insets should be changed so that
// they call the actions they have to do with the insetButtonRel.
// function and not in the edit(). This should be changed
// (Jug 20020329)
break;
}
- // Maybe we want to edit a bibitem ale970302
- if (bv->text->cursor.par()->bibkey) {
- bool const is_rtl =
- bv->text->cursor.par()->isRightToLeftPar(bv->buffer()->params);
- int const width =
- bibitemMaxWidth(bv, bv->buffer()->params.getLyXTextClass().defaultfont());
- if ((is_rtl && x > bv->text->workWidth(bv)-20-width) ||
- (!is_rtl && x < 20 + width)) {
- bv->text->cursor.par()->bibkey->edit(bv, 0, 0, mouse_button::none);
- }
- }
break;
}
case LFUN_HTMLURL: {
InsetCommandParams p("htmlurl");
- bv->owner()->getDialogs().createUrl(p.getAsString());
+ string const data = InsetCommandMailer::params2string("url", p);
+ bv->owner()->getDialogs().show("url", data, 0);
break;
}
case LFUN_URL: {
InsetCommandParams p("url");
- bv->owner()->getDialogs().createUrl(p.getAsString());
+ string const data = InsetCommandMailer::params2string("url", p);
+ bv->owner()->getDialogs().show("url", data, 0);
break;
}
case LFUN_INSET_CAPTION:
#endif
case LFUN_INSERT_NOTE:
+ case LFUN_INSERT_BIBITEM:
case LFUN_INSET_ERT:
case LFUN_INSET_FLOAT:
case LFUN_INSET_FOOTNOTE:
doInsertInset(this, cmd, true, true);
break;
- case LFUN_INSERT_URL:
- case LFUN_INSET_EXTERNAL:
case LFUN_INDEX_INSERT:
// Just open the inset
doInsertInset(this, cmd, true, false);
break;
default:
- return Inset::UNDISPATCHED;
+ return UNDISPATCHED;
}
- return Inset::DISPATCHED;
+ return DISPATCHED;
}