]> git.lyx.org Git - features.git/commitdiff
move 42, kill 12
authorAndré Pönitz <poenitz@gmx.net>
Tue, 27 Aug 2002 14:43:49 +0000 (14:43 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 27 Aug 2002 14:43:49 +0000 (14:43 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@5120 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.C
src/BufferView.h
src/BufferView_pimpl.C
src/BufferView_pimpl.h
src/text3.C

index 146699307e29734f4946453350092b9d2c014fa1..871b81975faedb720ba72f06834f4997b2857232 100644 (file)
@@ -230,9 +230,3 @@ bool BufferView::dispatch(FuncRequest const & ev)
 {
        return pimpl_->dispatch(ev);
 }
-
-
-void BufferView::moveCursorUpdate(bool selecting, bool fitcur)
-{
-       pimpl_->moveCursorUpdate(selecting, fitcur);
-}
index 149ef1b641c4ea3568fdf2bfc9a4f13794966613..7303ec2ad2d894cb9b49329d30f62ddf618e3c67 100644 (file)
@@ -190,8 +190,6 @@ public:
        void stuffClipboard(string const &) const;
        ///
        bool dispatch(FuncRequest const & argument);
-       ///
-       void moveCursorUpdate(bool selecting, bool fitcur = true);
 private:
        ///
        struct Pimpl;
index 00c98f725dfbd9deec83fe17089b2e840e5b84ae..6e1f60e2ef41bfa76c8921c3034d5b92c9b0a156 100644 (file)
@@ -1227,36 +1227,6 @@ void BufferView::Pimpl::stuffClipboard(string const & stuff) const
  */
 
 
-void BufferView::Pimpl::moveCursorUpdate(bool selecting, bool fitcur)
-{
-       LyXText * lt = bv_->getLyXText();
-
-       if (selecting || lt->selection.mark()) {
-               lt->setSelection(bv_);
-               if (lt->bv_owner)
-                       toggleToggle();
-               else
-                       updateInset(lt->inset_owner, false);
-       }
-       if (lt->bv_owner) {
-               if (fitcur)
-                       update(lt, BufferView::SELECT|BufferView::FITCUR);
-               else
-                       update(lt, BufferView::SELECT);
-               showCursor();
-       } else if (bv_->text->status() != LyXText::UNCHANGED) {
-               bv_->theLockingInset()->hideInsetCursor(bv_);
-               update(bv_->text, BufferView::SELECT|BufferView::FITCUR);
-               showCursor();
-       }
-
-       if (!lt->selection.set())
-               workarea().haveSelection(false);
-
-       switchKeyMap();
-}
-
-
 Inset * BufferView::Pimpl::getInsetByCode(Inset::Code code)
 {
 #if 0
index e7cc824406954b02ed213c5d6618f24eecaac550..868d4a55eb61a9a18ec353a286ae5c16e05b557e 100644 (file)
@@ -173,8 +173,6 @@ private:
        };
        ///
        std::vector<Position> saved_positions;
-       ///
-       void moveCursorUpdate(bool selecting, bool fitcur = true);
        /// Get next inset of this class from current cursor position
        Inset * getInsetByCode(Inset::Code code);
        ///
index 007e0ab6e066d463e24fcf184c1c0748d03d7714..207bb5e0ca9c492efe5799bdbc8a862798b9bf05 100644 (file)
@@ -42,10 +42,40 @@ extern string current_layout;
 
 namespace {
 
-       void finishChange(BufferView * bv, bool fitcur = false)
+       void moveCursorUpdate(BufferView * bv, bool selecting)
+       {
+               LyXText * lt = bv->getLyXText();
+
+               if (selecting || lt->selection.mark()) {
+                       lt->setSelection(bv);
+                       if (lt->bv_owner)
+                               bv->toggleToggle();
+                       else
+                               bv->updateInset(lt->inset_owner, false);
+               }
+               if (lt->bv_owner) {
+                       //if (fitcur)
+                       //      bv->update(lt, BufferView::SELECT|BufferView::FITCUR);
+                       //else
+                               bv->update(lt, BufferView::SELECT);
+                       bv->showCursor();
+               } else if (bv->text->status() != LyXText::UNCHANGED) {
+                       bv->theLockingInset()->hideInsetCursor(bv);
+                       bv->update(bv->text, BufferView::SELECT|BufferView::FITCUR);
+                       bv->showCursor();
+               }
+
+               if (!lt->selection.set())
+                       bv->workarea().haveSelection(false);
+
+               bv->switchKeyMap();
+       }
+
+
+       void finishChange(BufferView * bv, bool selecting = false)
        {
                finishUndo();
-               bv->moveCursorUpdate(fitcur);
+               moveCursorUpdate(bv, selecting);
                bv->owner()->view_state_changed();
        }
 
@@ -523,7 +553,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                finishChange(bv, false);
                // was:
                // finishUndo();
-               // moveCursorUpdate(false, false);
+               // moveCursorUpdate(bv, false, false);
                // owner_->view_state_changed();
                break;
 
@@ -556,7 +586,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                insertChar(bv, Paragraph::META_NEWLINE);
                update(bv, true);
                setCursor(bv, cursor.par(), cursor.pos());
-               bv->moveCursorUpdate(false);
+               moveCursorUpdate(bv, false);
                break;
 
        case LFUN_DELETE:
@@ -572,7 +602,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        cutSelection(bv, true);
                        update(bv);
                }
-               bv->moveCursorUpdate(false);
+               moveCursorUpdate(bv, false);
                bv->owner()->view_state_changed();
                bv->switchKeyMap();
                break;
@@ -769,7 +799,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                } else {
                        specialChar(this, bv, InsetSpecialChar::PROTECTED_SEPARATOR);
                }
-               bv->moveCursorUpdate(false);
+               moveCursorUpdate(bv, false);
                break;
 
        case LFUN_HYPHENATION:
@@ -997,7 +1027,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                // this was originally a beforeChange(bv->text), i.e
                // the outermost LyXText!
                bv->beforeChange(this);
-               string const clip(bv->workarea().getClipboard());
+               string const clip = bv->workarea().getClipboard();
                if (!clip.empty()) {
                        if (cmd.argument == "paragraph")
                                insertStringAsParagraphs(bv, clip);
@@ -1030,7 +1060,6 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                Paragraph const * par = cursor.par();
                lyx::pos_type pos = cursor.pos();
                char c;
-
                if (!pos)
                        c = ' ';
                else if (par->isInset(pos - 1) && par->getInset(pos - 1)->isSpace())
@@ -1067,7 +1096,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
                        update(bv, true);
                }
                selection.cursor = cursor;
-               bv->moveCursorUpdate(false);
+               moveCursorUpdate(bv, false);
                break;
        }
 
@@ -1100,7 +1129,7 @@ Inset::RESULT LyXText::dispatch(FuncRequest const & cmd)
 
                update(bv);
                selection.cursor = cursor;
-               bv->moveCursorUpdate(false);
+               moveCursorUpdate(bv, false);
 
                // real_current_font.number can change so we need to
                // update the minibuffer