]> git.lyx.org Git - features.git/commitdiff
Fix bug #5998.
authorVincent van Ravesteijn <vfr@lyx.org>
Wed, 8 Jul 2009 21:37:37 +0000 (21:37 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Wed, 8 Jul 2009 21:37:37 +0000 (21:37 +0000)
When one document has a split view, closing this document will close two splitters at a time.

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

src/frontends/qt4/GuiView.cpp

index c78a068978395c43fc7615c62f67a920554f5387..c22fb322c5278b4c8715d04f0abc8ee1e5f4920f 100644 (file)
@@ -538,8 +538,9 @@ void GuiView::closeEvent(QCloseEvent * close_event)
        GuiWorkArea * active_wa = currentMainWorkArea();
        setCurrentWorkArea(active_wa);
 
-       int splitter_count = d.splitter_->count();
-       for (; splitter_count; --splitter_count) {
+       // We have to call count() each time, because it can happen that
+       // more than one splitter will disappear in one iteration (bug 5998).
+       for (; d.splitter_->count(); ) {
                TabWorkArea * twa = d.tabWorkArea(0);
                                
                int twa_count = twa->count();