]> git.lyx.org Git - features.git/commitdiff
* Transfer Intl member from LyXView to BufferView.
authorAbdelrazak Younes <younes@lyx.org>
Sun, 17 Sep 2006 10:03:00 +0000 (10:03 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Sun, 17 Sep 2006 10:03:00 +0000 (10:03 +0000)
* delete unused offset_ref() method.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15030 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.C
src/BufferView.h
src/frontends/LyXView.C
src/frontends/LyXView.h
src/lyxfunc.C
src/mathed/InsetMathHull.C
src/text3.C

index 86d8c8e761bf3df6fa100afb5abf53fc9d26ea04..e16a2da665e60296e04f6a506bbd70a54975d404 100644 (file)
@@ -136,7 +136,8 @@ T * getInsetByCode(LCursor & cur, InsetBase::Code code)
 BufferView::BufferView(LyXView * owner)
        : owner_(owner), buffer_(0), wh_(0),
          cursor_(*this),
-         multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0)
+         multiparsel_cache_(false), anchor_ref_(0), offset_ref_(0),
+         intl_(new Intl)
 {
        xsel_cache_.set = false;
 
@@ -149,6 +150,8 @@ BufferView::BufferView(LyXView * owner)
                        saved_positions[bm->get<0>()] = Position( bm->get<1>(), bm->get<2>(), bm->get<3>() );
        // and then clear them
        bmList.clear();
+
+       intl_->initKeyMapper(lyxrc.use_kbmap);
 }
 
 
@@ -594,13 +597,12 @@ void BufferView::switchKeyMap()
        if (!lyxrc.rtl_support)
                return;
 
-       Intl & intl = owner_->getIntl();
        if (getLyXText()->real_current_font.isRightToLeft()) {
-               if (intl.keymap == Intl::PRIMARY)
-                       intl.keyMapSec();
+               if (intl_->keymap == Intl::PRIMARY)
+                       intl_->keyMapSec();
        } else {
-               if (intl.keymap == Intl::SECONDARY)
-                       intl.keyMapPrim();
+               if (intl_->keymap == Intl::SECONDARY)
+                       intl_->keyMapPrim();
        }
 }
 
@@ -1261,12 +1263,6 @@ lyx::pit_type BufferView::anchor_ref() const
 }
 
 
-int BufferView::offset_ref() const
-{
-       return offset_ref_;
-}
-
-
 ViewMetricsInfo const & BufferView::viewMetricsInfo()
 {
        return metrics_info_;
index 248366789373f81b8aaca51cd973dbc6ea9b6388..43f197be7af6c2ca43b69da11a0d5c5b9fc240f7 100644 (file)
@@ -32,6 +32,7 @@ class Change;
 class DocIterator;
 class FuncRequest;
 class FuncStatus;
+class Intl;
 class Language;
 class LCursor;
 class LyXText;
@@ -184,8 +185,6 @@ public:
        /// a function should be executed from the workarea
        bool workAreaDispatch(FuncRequest const & ev);
 
-       /// access to offset
-       int offset_ref() const;
        /// access to anchor
        lyx::pit_type anchor_ref() const;
 
@@ -210,6 +209,11 @@ public:
        ///
        void updateMetrics(bool singlepar = false);
 
+       /// get this view's keyboard map handler
+       Intl & getIntl() { return *intl_.get(); }
+       ///
+       Intl const & getIntl() const { return *intl_.get(); }
+
        /// This signal is emitted when some message shows up.
        boost::signal<void(lyx::docstring)> message;
 
@@ -270,6 +274,9 @@ private:
        lyx::pit_type anchor_ref_;
        ///
        int offset_ref_;
+
+       /// keyboard mapping object
+       boost::scoped_ptr<Intl> const intl_;
 };
 
 #endif // BUFFERVIEW_H
index 62d41ff69fa6352b2f9158572ee35941eaa62686..7b06cf9684f037b620e220760c07955f1423ff8d 100644 (file)
@@ -75,7 +75,6 @@ LyXView::LyXView(Gui & owner)
        : work_area_(0),
          owner_(owner),
          toolbars_(new Toolbars(*this)),
-         intl_(new Intl),
          autosave_timeout_(new Timeout(5000)),
          lyxfunc_(new LyXFunc(this)),
          dialogs_(new Dialogs(*this)),
@@ -119,8 +118,6 @@ void LyXView::init()
                autosave_timeout_->setTimeout(lyxrc.autosave * 1000);
                autosave_timeout_->start();
        }
-
-       intl_->initKeyMapper(lyxrc.use_kbmap);
 }
 
 
index 0ef9ee778fdae489944058a2f75c2ac5210c32e6..b353571f03c4c16d7385373bedab188068fd60ac 100644 (file)
@@ -23,7 +23,6 @@
 
 class Buffer;
 class InsetBase;
-class Intl;
 class Menubar;
 
 class BufferView;
@@ -107,11 +106,6 @@ public:
        ///
        Dialogs const & getDialogs() const { return *dialogs_.get(); }
 
-       /// get this view's keyboard map handler
-       Intl & getIntl() { return *intl_.get(); }
-       ///
-       Intl const & getIntl() const { return *intl_.get(); }
-
        //@}
 
        /// load a buffer into the current workarea
@@ -195,8 +189,6 @@ private:
 
        /// view's toolbar
        boost::scoped_ptr<Toolbars> toolbars_;
-       /// keyboard mapping object
-       boost::scoped_ptr<Intl> const intl_;
        /// auto-saving of buffers
        boost::scoped_ptr<Timeout> const autosave_timeout_;
        /// our function handler
index 89c92637b88bfea81ab21001faa877d049e94dbe..a861048e66262123a5d47837340d967146eb1c07 100644 (file)
@@ -220,7 +220,7 @@ void LyXFunc::handleKeyFunc(kb_action action)
                c = 0;
        }
 
-       owner->getIntl().getTransManager()
+       owner->view()->getIntl().getTransManager()
                .deadkey(c, get_accent(action).accent, view()->getLyXText());
        // Need to clear, in case the minibuffer calls these
        // actions
@@ -1304,19 +1304,19 @@ void LyXFunc::dispatch(FuncRequest const & cmd)
                        break;
 
                case LFUN_KEYMAP_OFF:
-                       owner->getIntl().keyMapOn(false);
+                       owner->view()->getIntl().keyMapOn(false);
                        break;
 
                case LFUN_KEYMAP_PRIMARY:
-                       owner->getIntl().keyMapPrim();
+                       owner->view()->getIntl().keyMapPrim();
                        break;
 
                case LFUN_KEYMAP_SECONDARY:
-                       owner->getIntl().keyMapSec();
+                       owner->view()->getIntl().keyMapSec();
                        break;
 
                case LFUN_KEYMAP_TOGGLE:
-                       owner->getIntl().toggleKeyMap();
+                       owner->view()->getIntl().toggleKeyMap();
                        break;
 
                case LFUN_REPEAT: {
index 81af5ffa747914ad4e631ec4682452eb29d61cb9..08d9d147a06f5246ab40e2b88e570f43db63de5e 100644 (file)
@@ -1261,7 +1261,7 @@ void InsetMathHull::mutateToText()
        string::const_iterator cit = str.begin();
        string::const_iterator end = str.end();
        for (; cit != end; ++cit)
-               view_->owner()->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
+               view_->getIntl()->getTransManager().TranslateAndInsert(*cit, lt);
 
        // remove ourselves
        //view_->owner()->dispatch(LFUN_ESCAPE);
index 9917005793cd5319bc0e16bd22c03d449e96ffa1..7f0e8465726625e9381ab528e8290b07c0e51a14 100644 (file)
@@ -606,7 +606,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
 
        case LFUN_CHAR_DELETE_BACKWARD:
                if (!cur.selection()) {
-                       if (bv->owner()->getIntl().getTransManager().backspace()) {
+                       if (bv->getIntl().getTransManager().backspace()) {
                                // Par boundary, full-screen update
                                if (cur.pos() == 0)
                                        singleParUpdate = false;
@@ -1077,7 +1077,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                docstring::const_iterator end = cmd.argument().end();
                for (; cit != end; ++cit)
 #if 0
-                       bv->owner()->getIntl().getTransManager().
+                       bv->getIntl().getTransManager().
                                translateAndInsert(*cit, this);
 #else
                        insertChar(bv->cursor(), *cit);
@@ -1389,7 +1389,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
                bv->owner()->getLyXFunc().handleKeyFunc(cmd.action);
                if (!cmd.argument().empty())
                        // FIXME: Are all these characters encoded in one byte in utf8?
-                       bv->owner()->getIntl().getTransManager()
+                       bv->getIntl().getTransManager()
                                .translateAndInsert(cmd.argument()[0], this);
                break;