]> git.lyx.org Git - lyx.git/commitdiff
Some necessary cleanup, noticed by Pavel.
authorVincent van Ravesteijn <vfr@lyx.org>
Fri, 21 Aug 2009 20:29:40 +0000 (20:29 +0000)
committerVincent van Ravesteijn <vfr@lyx.org>
Fri, 21 Aug 2009 20:29:40 +0000 (20:29 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@31182 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiView.cpp
src/frontends/qt4/GuiView.h

index 854c702586ef08c95938e5df082c29709876a6db..52bb6c9f92a7677eab48b4ac93c1d86cdfa974ab 100644 (file)
@@ -1900,9 +1900,7 @@ bool GuiView::closeBufferAll()
 
 bool GuiView::closeWorkAreaAll()
 {
-       // To write in the session file which workarea was active.
-       GuiWorkArea * active_wa = currentMainWorkArea();
-       setCurrentWorkArea(active_wa);
+       setCurrentWorkArea(currentMainWorkArea());
 
        // 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 
@@ -1919,7 +1917,7 @@ bool GuiView::closeWorkAreaAll()
                        ++empty_twa;
                else {
                        setCurrentWorkArea(twa->currentWorkArea());
-                       if (!closeTabWorkArea(twa, active_wa))
+                       if (!closeTabWorkArea(twa))
                                return false;
                }
        }
@@ -1927,8 +1925,7 @@ bool GuiView::closeWorkAreaAll()
 }
 
 
-bool GuiView::closeWorkArea(GuiWorkArea * wa, bool close_buffer,
-       bool)
+bool GuiView::closeWorkArea(GuiWorkArea * wa, bool close_buffer)
 {
        Buffer & buf = wa->bufferView().buffer();
 
@@ -1976,13 +1973,12 @@ bool GuiView::closeWorkArea(GuiWorkArea * wa, bool close_buffer,
 }
 
 
-bool GuiView::closeTabWorkArea(TabWorkArea * twa, GuiWorkArea * main_work_area)
+bool GuiView::closeTabWorkArea(TabWorkArea * twa)
 {
        while (twa == d.currentTabWorkArea()) {
                twa->setCurrentIndex(twa->count()-1);
 
                GuiWorkArea * wa = twa->currentWorkArea();
-               bool const is_active_wa = main_work_area == wa;
                Buffer & b = wa->bufferView().buffer();
 
                // We only want to close the buffer if the same buffer is not visible
@@ -1991,7 +1987,7 @@ bool GuiView::closeTabWorkArea(TabWorkArea * twa, GuiWorkArea * main_work_area)
                bool const close_buffer = 
                        !inMultiViews(wa) && !b.parent() && closing_;
 
-               if (!closeWorkArea(wa, close_buffer, is_active_wa))
+               if (!closeWorkArea(wa, close_buffer))
                        return false;
        }
        return true;
@@ -2323,7 +2319,7 @@ bool GuiView::dispatch(FuncRequest const & cmd)
 
                case LFUN_CLOSE_TAB_GROUP:
                        if (TabWorkArea * twa = d.currentTabWorkArea()) {
-                               closeTabWorkArea(twa, false);
+                               closeTabWorkArea(twa);
                                d.current_work_area_ = 0;
                                twa = d.currentTabWorkArea();
                                // Switch to the next GuiWorkArea in the found TabWorkArea.
index 21ebdf81b854cf247ea64be707530bf8e655cee6..ce64c34d793489722952dbef6ad60b6ae40b967c 100644 (file)
@@ -299,13 +299,11 @@ private:
        bool saveBuffer(Buffer & b);
        /// closes a workarea, if close_buffer is true the buffer will
        /// also be released, otherwise the buffer will be hidden.
-       bool closeWorkArea(GuiWorkArea * wa, bool close_buffer,
-               bool is_active = false);
+       bool closeWorkArea(GuiWorkArea * wa, bool close_buffer);
        /// closes the tabworkarea and all tabs. If we are in a close event,
        /// all buffers will be closed, otherwise they will be hidden.
        /// main_work_area is the workarea marked in the session file as active.
-       bool closeTabWorkArea(TabWorkArea * twa,
-               GuiWorkArea * main_work_area = 0);
+       bool closeTabWorkArea(TabWorkArea * twa);
        /// gives the user the possibility to save his work 
        /// or to discard the changes. If hiding is true, the
        /// document will be reloaded.