mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-08 10:51:03 +00:00
This commit replaces BufferView->LyXView->getLyXFunc() with theApp->lyxFunc() and BufferView->LyXView->dispatch() with theApp->lyxFunc().dispatch().
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15121 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
6104eebe0d
commit
480b4f4fdc
@ -1105,13 +1105,13 @@ void LCursor::handleFont(string const & font)
|
||||
|
||||
void LCursor::message(docstring const & msg) const
|
||||
{
|
||||
bv().owner()->getLyXFunc().setMessage(msg);
|
||||
theApp->lyxFunc().setMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
void LCursor::errorMessage(docstring const & msg) const
|
||||
{
|
||||
bv().owner()->getLyXFunc().setErrorMessage(msg);
|
||||
theApp->lyxFunc().setErrorMessage(msg);
|
||||
}
|
||||
|
||||
|
||||
|
@ -87,6 +87,15 @@ public:
|
||||
/// return the buffer currently shown in this window
|
||||
Buffer * buffer() const;
|
||||
|
||||
/* FIXME: Abdel 22/09/71
|
||||
there is only one lyxFunc() for now but there is maybe a need
|
||||
for more in the feature. Something like that:
|
||||
|
||||
LyXFunc & getLyXFunc() { return theApp->lyxFunc(id_); }
|
||||
|
||||
where id_ would be the this LyXView ID.
|
||||
That's the reason why I didn't remove these methods for now.
|
||||
*/
|
||||
/// return the LyX function handler for this view
|
||||
LyXFunc & getLyXFunc() { return theApp->lyxFunc(); }
|
||||
///
|
||||
|
@ -48,7 +48,7 @@ void InsetRef::doDispatch(LCursor & cur, FuncRequest & cmd)
|
||||
case LFUN_MOUSE_PRESS:
|
||||
// Eventually trigger dialog with button 3 not 1
|
||||
if (cmd.button() == mouse_button::button3)
|
||||
cur.bv().owner()->dispatch(FuncRequest(LFUN_LABEL_GOTO, getContents()));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_LABEL_GOTO, getContents()));
|
||||
else {
|
||||
InsetCommandMailer("ref", *this).showDialog(&cur.bv());
|
||||
cur.undispatched();
|
||||
|
@ -1264,7 +1264,7 @@ void InsetMathHull::mutateToText()
|
||||
view_->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
|
||||
|
||||
// remove ourselves
|
||||
//view_->owner()->dispatch(LFUN_ESCAPE);
|
||||
//theApp->lyxFunc().dispatch(LFUN_ESCAPE);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -366,13 +366,13 @@ void LyXText::setLayout(LCursor & cur, string const & layout)
|
||||
if (lyxlayout->is_environment) {
|
||||
// move everything in a new environment inset
|
||||
lyxerr[Debug::DEBUG] << "setting layout " << layout << endl;
|
||||
bv.owner()->dispatch(FuncRequest(LFUN_LINE_BEGIN));
|
||||
bv.owner()->dispatch(FuncRequest(LFUN_LINE_END_SELECT));
|
||||
bv.owner()->dispatch(FuncRequest(LFUN_CUT));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_LINE_BEGIN));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_LINE_END_SELECT));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_CUT));
|
||||
InsetBase * inset = new InsetEnvironment(params, layout);
|
||||
insertInset(cur, inset);
|
||||
//inset->edit(cur, true);
|
||||
//bv.owner()->dispatch(FuncRequest(LFUN_PASTE));
|
||||
//theApp->lyxFunc().dispatch(FuncRequest(LFUN_PASTE));
|
||||
return;
|
||||
}
|
||||
|
||||
|
18
src/text3.C
18
src/text3.C
@ -266,7 +266,7 @@ bool doInsertInset(LCursor & cur, LyXText * text,
|
||||
recordUndo(cur);
|
||||
bool gotsel = false;
|
||||
if (cur.selection()) {
|
||||
cur.bv().owner()->dispatch(FuncRequest(LFUN_CUT));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_CUT));
|
||||
gotsel = true;
|
||||
}
|
||||
text->insertInset(cur, inset);
|
||||
@ -275,7 +275,7 @@ bool doInsertInset(LCursor & cur, LyXText * text,
|
||||
inset->edit(cur, true);
|
||||
|
||||
if (gotsel && pastesel) {
|
||||
cur.bv().owner()->dispatch(FuncRequest(LFUN_PASTE));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_PASTE));
|
||||
// reset first par to default
|
||||
if (cur.lastpit() != 0 || cur.lastpos() != 0) {
|
||||
LyXLayout_ptr const layout =
|
||||
@ -936,16 +936,16 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
cur.posRight();
|
||||
}
|
||||
else
|
||||
bv->owner()->dispatch(FuncRequest(LFUN_SELF_INSERT, "\""));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_SELF_INSERT, "\""));
|
||||
break;
|
||||
}
|
||||
|
||||
case LFUN_DATE_INSERT:
|
||||
if (cmd.argument().empty())
|
||||
bv->owner()->dispatch(FuncRequest(LFUN_SELF_INSERT,
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_SELF_INSERT,
|
||||
lyx::formatted_time(lyx::current_time())));
|
||||
else
|
||||
bv->owner()->dispatch(FuncRequest(LFUN_SELF_INSERT,
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_SELF_INSERT,
|
||||
lyx::formatted_time(lyx::current_time(), lyx::to_utf8(cmd.argument()))));
|
||||
break;
|
||||
|
||||
@ -980,7 +980,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
// we have to check this first
|
||||
bool paste_internally = false;
|
||||
if (cmd.button() == mouse_button::button2 && cur.selection()) {
|
||||
bv->owner()->dispatch(FuncRequest(LFUN_COPY));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_COPY));
|
||||
paste_internally = true;
|
||||
}
|
||||
|
||||
@ -991,9 +991,9 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
// insert this
|
||||
if (cmd.button() == mouse_button::button2) {
|
||||
if (paste_internally)
|
||||
bv->owner()->dispatch(FuncRequest(LFUN_PASTE));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_PASTE));
|
||||
else
|
||||
bv->owner()->dispatch(FuncRequest(LFUN_PRIMARY_SELECTION_PASTE, "paragraph"));
|
||||
theApp->lyxFunc().dispatch(FuncRequest(LFUN_PRIMARY_SELECTION_PASTE, "paragraph"));
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1384,7 +1384,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
case LFUN_ACCENT_HUNGARIAN_UMLAUT:
|
||||
case LFUN_ACCENT_CIRCLE:
|
||||
case LFUN_ACCENT_OGONEK:
|
||||
bv->owner()->getLyXFunc().handleKeyFunc(cmd.action);
|
||||
theApp->lyxFunc().handleKeyFunc(cmd.action);
|
||||
if (!cmd.argument().empty())
|
||||
// FIXME: Are all these characters encoded in one byte in utf8?
|
||||
bv->getIntl().getTransManager()
|
||||
|
Loading…
Reference in New Issue
Block a user