[EMAIL PROTECTED] (Lars Gullik Bjønnes) writes:

| Juergen Vigna <[EMAIL PROTECTED]> writes:
>
| | Or do you just like to discuss matters today :)
>
| I just want to find the best local solution.
>
| btw. can you check if this patch makes any difference and that
| everything just still works?

I guess this patch changes a bit less:

Index: src/BufferView_pimpl.C
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/src/BufferView_pimpl.C,v
retrieving revision 1.212
diff -u -p -r1.212 BufferView_pimpl.C
--- src/BufferView_pimpl.C      12 Mar 2002 13:27:49 -0000      1.212
+++ src/BufferView_pimpl.C      12 Mar 2002 14:41:18 -0000
@@ -311,8 +311,7 @@ int BufferView::Pimpl::resizeCurrentBuff
        pos_type selendpos = 0;
        bool selection = false;
        bool mark_set  = false;
-       bool text_found = false;
-
+       
        owner_->prohibitInput();
 
        owner_->message(_("Formatting document..."));
@@ -330,12 +329,12 @@ int BufferView::Pimpl::resizeCurrentBuff
                delete bv_->text;
                bv_->text = new LyXText(bv_);
                bv_->text->init(bv_);
+               buffer_->resizeInsets(bv_);
        } else {
                // See if we have a text in TextCache that fits
                // the new buffer_ with the correct width.
                bv_->text = textcache.findFit(buffer_, workarea_.workWidth());
                if (bv_->text) {
-                       text_found = true;
                        if (lyxerr.debugging()) {
                                lyxerr << "Found a LyXText that fits:\n";
                                textcache.show(lyxerr, make_pair(buffer_, 
make_pair(workarea_.workWidth(), bv_->text)));
@@ -347,14 +346,16 @@ int BufferView::Pimpl::resizeCurrentBuff
                } else {
                        bv_->text = new LyXText(bv_);
                        bv_->text->init(bv_);
+                       //buffer_->resizeInsets(bv_);
                }
        }
+
        updateScreen();
 
        if (par) {
                bv_->text->selection.set(true);
-               /* at this point just to avoid the Delete-Empty-Paragraph
-                * Mechanism when setting the cursor */
+               // At this point just to avoid the Delete-Empty-Paragraph-
+               // Mechanism when setting the cursor.
                bv_->text->selection.mark(mark_set);
                if (selection) {
                        bv_->text->setCursor(bv_, selstartpar, selstartpos);
@@ -370,13 +371,9 @@ int BufferView::Pimpl::resizeCurrentBuff
                // remake the inset locking
                bv_->theLockingInset(the_locking_inset);
        }
+
        bv_->text->first_y = screen_->topCursorVisible(bv_->text);
-       // please tell me WHY the heck you deactivated this code, whoever
-       // 'you' are (Jug 20020311)
-#if 1
-       if (!text_found)
-               buffer_->resizeInsets(bv_);
-#endif
+
        // this will scroll the screen such that the cursor becomes visible
        updateScrollbar();
        redraw();
@@ -1002,6 +999,7 @@ void BufferView::Pimpl::workAreaExpose()
                        if (lyxerr.debugging())
                                textcache.show(lyxerr, "Expose delete all");
                        textcache.clear();
+                       buffer_->resizeInsets(bv_);
                } else if (heightChange) {
                        // Rebuild image of current screen
                        updateScreen();

-- 
        Lgb

Reply via email to