]> git.lyx.org Git - features.git/commitdiff
small tweak for split view.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 20 Feb 2008 20:05:01 +0000 (20:05 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 20 Feb 2008 20:05:01 +0000 (20:05 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23083 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp

index 0f7f16ab1be9934b57ec3e8981c94df27cfd5703..ec44d867dce7ead06d4ac2eead660687bca50dee 100644 (file)
@@ -224,17 +224,16 @@ struct GuiView::GuiViewPrivate
                        // The first TabWorkArea is always the first one, if any.
                        return tabWorkArea(0);
 
-               TabWorkArea * tab_widget = 0;
                for (int i = 0; i != splitter_->count(); ++i) {
                        QWidget * w = splitter_->widget(i);
                        if (!w->hasFocus())
                                continue;
-                       tab_widget = dynamic_cast<TabWorkArea *>(w);
-                       if (tab_widget)
-                               break;
+                       if (TabWorkArea * tab_widget = dynamic_cast<TabWorkArea *>(w))
+                               return tab_widget;
                }
 
-               return tab_widget;
+               // None has the focus so we just take the first one.
+               return tabWorkArea(0);
        }
 
 public: