]> git.lyx.org Git - features.git/commitdiff
This commit replaces BufferView->LyXView->getLyXFunc() with theApp->lyxFunc() and...
authorAbdelrazak Younes <younes@lyx.org>
Fri, 22 Sep 2006 14:26:06 +0000 (14:26 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Fri, 22 Sep 2006 14:26:06 +0000 (14:26 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15121 a592a061-630c-0410-9148-cb99ea01b6c8

src/cursor.C
src/frontends/LyXView.h
src/insets/insetref.C
src/mathed/InsetMathHull.C
src/text2.C
src/text3.C

index 3a4b3a6169cc98399b615813259c3a3ed2b3d6d4..0d71f751100345b472140dc64eb79a57141580f1 100644 (file)
@@ -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);
 }
 
 
index 932e98602e2035cfa6ca2fb2ab38b6ae71bb2293..d083869887e39945036f24bd8e3fcd14fa3d565e 100644 (file)
@@ -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(); }
        ///
index fa8fe76dd1a88f5ecb034dbac48232b78c635d2e..8576a1c677f68fae9af177295d7c55f88e4a4a61 100644 (file)
@@ -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();
index 0054d6f46151c2f00017116eaf7637560af823c5..b5ed8347f40b6aba9ac092fb0a8bdc403bcb1f22 100644 (file)
@@ -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
 }
 
index 09b9a2ce93747ded3f0604b420cb6074e439c1fd..5495f9bfa4045190a95711f7ffc4e76b64934c1a 100644 (file)
@@ -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;
        }
 
index f5142a1c76d1e0089c2e766d4e0c4697189e67d0..b6d0634a3254e1f2ebfc2df5325d16111abd1ca1 100644 (file)
@@ -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()