]> git.lyx.org Git - lyx.git/commitdiff
Fix the rebreak and cursor position if we had a CHANGED_IN_DRAW (fix #175).
authorJürgen Vigna <jug@sad.it>
Fri, 19 Apr 2002 14:16:08 +0000 (14:16 +0000)
committerJürgen Vigna <jug@sad.it>
Fri, 19 Apr 2002 14:16:08 +0000 (14:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@4035 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView_pimpl.C
src/ChangeLog
src/insets/ChangeLog
src/insets/insettext.C

index 2a6ad10609eac4b1003e321fdb1511f11ef60397..93fdc9f075c2d9347823a4fa68c3392924f5a712 100644 (file)
@@ -1075,6 +1075,14 @@ void BufferView::Pimpl::update()
                                st = LyXText::NEED_MORE_REFRESH;
                                bv_->text->setCursor(bv_, bv_->text->cursor.par(),
                                                                         bv_->text->cursor.pos());
+                               if (bv_->text->selection.set()) {
+                                       bv_->text->setCursor(bv_, bv_->text->selection.start,
+                                                                 bv_->text->selection.start.par(),
+                                                                 bv_->text->selection.start.pos());
+                                       bv_->text->setCursor(bv_, bv_->text->selection.end,
+                                                                 bv_->text->selection.end.par(),
+                                                                 bv_->text->selection.end.pos());
+                               }
                                fitc = true;
                        }
                        bv_->text->status(bv_, st);
index a37aa5c33f32b28156dd4e4cdb9cc5af42ebb31b..b583b89feed4b4ab2dd647f33114b794c16ff065 100644 (file)
@@ -2,6 +2,8 @@
 
        * BufferView_pimpl.C (resizeCurrentBuffer): resize the insets before
        reinitializing the buffer otherwise row-dimensions may be wrong.
+       (update): reset also the selection cursors if they do exits otherwise
+       their x/y positions may be wrong.
 
        * text2.C (cursorDown): don't enter the inset if we came from a row
        above and are one row over the inset.
index 8b25ead5bcdc4f34eeaa76c0399e1dba58d3fb31..0162a84c56769a716cb1b62e9e79fbe5455fa98a 100644 (file)
@@ -1,5 +1,8 @@
 2002-04-19  Juergen Vigna  <jug@sad.it>
 
+       * insettext.C (draw): call a fullRebreak on the row where we had a
+       change and reset the cursor and selection-cursors.
+
        * insettabular.C (insetUnlock): 
        (insetButtonPress): call an update before setting the_locking_inset = 0
        as otherwise we don't repaint!
index 4a7bf1f2e3053991386a9a761e8153181c8388d3..56eab7eafd4961b23c2ab613e7f4b08edd8c715b 100644 (file)
@@ -465,6 +465,21 @@ void InsetText::draw(BufferView * bv, LyXFont const & f,
                while ((row != 0) && (yf < ph)) {
                        lt->getVisibleRow(bv, y+y_offset+first, int(x), row,
                                                y+lt->first_y, cleared);
+                       if (bv->text->status() == LyXText::CHANGED_IN_DRAW) {
+                               lt->need_break_row = row;
+                               if (lt->fullRebreak(bv)) {
+                                       lt->setCursor(bv, lt->cursor.par(),lt->cursor.pos());
+                                       if (lt->selection.set()) {
+                                               lt->setCursor(bv, lt->selection.start,
+                                                                         lt->selection.start.par(),
+                                                                         lt->selection.start.pos());
+                                               lt->setCursor(bv, lt->selection.end,
+                                                                         lt->selection.end.par(),
+                                                                         lt->selection.end.pos());
+                                       }
+                               }
+                               break;
+                       }
                        y += row->height();
                        yf += row->height();
                        row = row->next();