From f9963f83c8936922f4e9c2ab08052cd6e970d0d8 Mon Sep 17 00:00:00 2001 From: Abdelrazak Younes Date: Wed, 20 Feb 2008 20:05:01 +0000 Subject: [PATCH] small tweak for split view. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23083 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/GuiView.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 0f7f16ab1b..ec44d867dc 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -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(w); - if (tab_widget) - break; + if (TabWorkArea * tab_widget = dynamic_cast(w)) + return tab_widget; } - return tab_widget; + // None has the focus so we just take the first one. + return tabWorkArea(0); } public: