]> git.lyx.org Git - features.git/commitdiff
Fix bug #5001: Tab order not preserved when starting lyx.
authorVincent van Ravesteijn <vfr@lyx.org>
Mon, 4 May 2009 11:48:23 +0000 (11:48 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Mon, 4 May 2009 11:48:23 +0000 (11:48 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@29530 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 94ab1c98c9fcb0a5d2e4032d0c3c852bb13d930d..4910e63062ba6c0c75147c7ca05a4bb5fd5c3824 100644 (file)
@@ -534,7 +534,16 @@ void GuiView::closeEvent(QCloseEvent * close_event)
        // e.g. when clicking the close button on a background window.
        setFocus();
        setCurrentWorkArea(currentMainWorkArea());
-       while (GuiWorkArea * wa = currentMainWorkArea()) {
+
+       int splitter_count = d.splitter_->count();
+       for (; splitter_count > 0; --splitter_count) {
+       TabWorkArea * twa = d.tabWorkArea(0);
+                       
+       int twa_count = twa->count();
+       for (; twa_count > 0; --twa_count) {
+               twa->setCurrentIndex(0);
+
+               GuiWorkArea * wa = twa->currentWorkArea();
                Buffer * b = &wa->bufferView().buffer();
                if (b->parent()) {
                        // This is a child document, just close the tab
@@ -587,7 +596,7 @@ void GuiView::closeEvent(QCloseEvent * close_event)
                        return;
                }
        }
-
+       }
        // Make sure that nothing will use this close to be closed View.
        guiApp->unregisterView(this);