Jürgen Spitzmüller schreef:
Vincent van Ravesteijn wrote:
Can I start backporting the fixes for the following bugs:
5998, 2034, 2213, 3706, 3918, 4177, 4509, 4952, 5390, 5435, 5458, 5944,
5948 ?
Yes. Please post the patches subsequently.
Jürgen
Patch for bug 5998 (last one).
Vincent
Property changes on: .
___________________________________________________________________
Added: svn:mergeinfo
Merged /lyx-devel/trunk:r30416,30521
Index: src/frontends/qt4/GuiView.cpp
===================================================================
--- src/frontends/qt4/GuiView.cpp (revision 30651)
+++ src/frontends/qt4/GuiView.cpp (working copy)
@@ -529,12 +529,22 @@
setFocus();
GuiWorkArea const * active_wa = currentWorkArea();
- int splitter_count = d.splitter_->count();
- for (; splitter_count > 0; --splitter_count) {
- TabWorkArea * twa = d.tabWorkArea(0);
+ // We might be in a situation that there is still a tabWorkArea, but
+ // there are no tabs anymore. This can happen when we get here after a
+ // TabWorkArea::lastWorkAreaRemoved() signal. Therefore we count how
+ // many TabWorkArea's have no documents anymore.
+ int empty_twa = 0;
+
+ // 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() > empty_twa; ) {
+ TabWorkArea * twa = d.tabWorkArea(empty_twa);
int twa_count = twa->count();
- for (; twa_count > 0; --twa_count) {
+ if (twa_count == 0)
+ ++empty_twa;
+
+ for (; twa_count; --twa_count) {
twa->setCurrentIndex(twa_count-1);
GuiWorkArea * wa = twa->currentWorkArea();