]> git.lyx.org Git - features.git/commitdiff
Fix bug 5819: Close button of tabbar closes wrong document
authorVincent van Ravesteijn <vfr@lyx.org>
Sat, 28 Feb 2009 13:56:41 +0000 (13:56 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Sat, 28 Feb 2009 13:56:41 +0000 (13:56 +0000)
http://bugzilla.lyx.org/show_bug.cgi?id=5819.

If no call to setCurrentIndex is made, we should make sure ourselves that the currentWorkArea switches to the clicked TabWorkArea.

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

src/frontends/qt4/GuiWorkArea.cpp

index 360884389ae033ca1c457aeee6d4907cb0cb61b5..f638805ab043176025d0b07390e8180961b86fc3 100644 (file)
@@ -1498,6 +1498,10 @@ void TabWorkArea::closeCurrentBuffer()
 {
        if (clicked_tab_ != -1)
                setCurrentIndex(clicked_tab_);
+       else
+               // Before dispatching the LFUN we should be sure this
+               // is the current workarea.
+               currentWorkAreaChanged(currentWorkArea());
 
        lyx::dispatch(FuncRequest(LFUN_BUFFER_CLOSE));
 }