From: Richard Heck Date: Thu, 9 Dec 2010 22:29:12 +0000 (+0000) Subject: This routine does not need to take a pointer to a WorkArea. Also, remove X-Git-Tag: 2.0.0~1441 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a7de5bc8b37655ea1f76254ae4a488aa17ca273a;p=lyx.git This routine does not need to take a pointer to a WorkArea. Also, remove some dead code. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@36798 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiView.cpp b/src/frontends/qt4/GuiView.cpp index 28e6fcf000..c75446f884 100644 --- a/src/frontends/qt4/GuiView.cpp +++ b/src/frontends/qt4/GuiView.cpp @@ -2529,7 +2529,7 @@ bool GuiView::closeTabWorkArea(TabWorkArea * twa) // in another view, and if this is not a child and if we are closing // a view (not a tabgroup). bool const close_buffer = - !inMultiViews(wa) && !b.parent() && closing_; + !inOtherView(b) && !b.parent() && closing_; if (!closeWorkArea(wa, close_buffer)) return false; @@ -2605,17 +2605,15 @@ bool GuiView::inMultiTabs(GuiWorkArea * wa) if (wa_ && wa_ != wa) return true; } - return inMultiViews(wa); + return inOtherView(buf); } -bool GuiView::inMultiViews(GuiWorkArea * wa) +bool GuiView::inOtherView(Buffer & buf) { QList const ids = guiApp->viewIds(); - Buffer & buf = wa->bufferView().buffer(); - int found_twa = 0; - for (int i = 0; i != ids.size() && found_twa <= 1; ++i) { + for (int i = 0; i != ids.size(); ++i) { if (id_ == ids[i]) continue; diff --git a/src/frontends/qt4/GuiView.h b/src/frontends/qt4/GuiView.h index 192516601b..d2d2f5214e 100644 --- a/src/frontends/qt4/GuiView.h +++ b/src/frontends/qt4/GuiView.h @@ -394,8 +394,8 @@ private: /// is the buffer in this workarea also shown in another tab ? /// This tab can either be in the same view or in another one. bool inMultiTabs(GuiWorkArea * wa); - /// is the buffer in this workarea also shown in another view ? - bool inMultiViews(GuiWorkArea * wa); + /// is the buffer shown in some other view ? + bool inOtherView(Buffer & buf); /// enum NextOrPrevious { NEXTBUFFER,