]> git.lyx.org Git - features.git/commitdiff
fix bug 1694
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Oct 2004 08:27:59 +0000 (08:27 +0000)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Fri, 15 Oct 2004 08:27:59 +0000 (08:27 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@9090 a592a061-630c-0410-9148-cb99ea01b6c8

po/POTFILES.in
src/BufferView_pimpl.C
src/ChangeLog

index 5a90177e245c43ce1c855a740f7cc5e12e59153a..777315c364da50c8c6718d4525c9ab3de480054f 100644 (file)
@@ -35,12 +35,19 @@ src/frontends/gnome/GLog.C
 src/frontends/gnome/support.c
 src/frontends/gtk/Dialogs.C
 src/frontends/gtk/GBC.h
+src/frontends/gtk/GChanges.C
 src/frontends/gtk/GCharacter.C
+src/frontends/gtk/GErrorList.C
+src/frontends/gtk/GLog.C
 src/frontends/gtk/GMathDelim.C
 src/frontends/gtk/GMathPanel.C
+src/frontends/gtk/GMathsMatrix.C
 src/frontends/gtk/GParagraph.C
 src/frontends/gtk/GSearch.C
+src/frontends/gtk/GShowFile.C
+src/frontends/gtk/GSpellchecker.C
 src/frontends/gtk/GTableCreate.C
+src/frontends/gtk/GTexinfo.C
 src/frontends/gtk/GToc.C
 src/frontends/gtk/GUrl.C
 src/frontends/qt2/Alert_pimpl.C
index 2160fbb1d4deecc59f8f673577b7274e62d7b931..436ae13e6950637c9ecf7b14dab01600560c6497 100644 (file)
@@ -327,8 +327,17 @@ void BufferView::Pimpl::setBuffer(Buffer * b)
        if (buffer_)
                disconnectBuffer();
 
-       // set current buffer
-       buffer_ = b;
+       // if we are closing current buffer, switch to the first in
+       // buffer list.
+       if (!b) {
+               lyxerr[Debug::INFO] << "  No Buffer!" << endl;
+               // we are closing the buffer, use the first buffer as current
+               buffer_ = bufferlist.first();
+               owner_->getDialogs().hideBufferDependent();
+       } else {
+               // set current buffer
+               buffer_ = b;
+       }
 
        // reset old cursor
        top_y_ = 0;
@@ -355,12 +364,7 @@ void BufferView::Pimpl::setBuffer(Buffer * b)
                // hidden. This should go here because some dialogs (eg ToC)
                // require bv_->text.
                owner_->getDialogs().updateBufferDependent(true);
-       } else {
-               lyxerr[Debug::INFO] << "  No Buffer!" << endl;
-               // we are closing the buffer, use the first buffer as current
-               buffer_ = bufferlist.first();
-               owner_->getDialogs().hideBufferDependent();
-       }
+       } 
 
        update();
        updateScrollbar();
index 3897f5ebf2d029c8608a7ccfc7a395e167eaac3b..2b2d73b568ebe11d652b5e4ae94309ad1bb0e2dc 100644 (file)
@@ -1,6 +1,12 @@
+2004-10-14  Jean-Marc Lasgouttes  <lasgouttes@lyx.org>
+
+       * BufferView_pimpl.C (setBuffer): when closing a buffer, make sure
+       the cursor is correct (bug 1694)
+
 2004-10-13  José Matos  <jamatos@lyx.org>
 
-       * output_docbook.C (docbookParagraphs): fix closing tags in the end of the document.
+       * output_docbook.C (docbookParagraphs): fix closing tags in the
+       end of the document. 
 
 2004-10-09  José Matos  <jamatos@lyx.org>