]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/GuiToolbars.cpp
'using namespace std' instead of 'using std::xxx'
[lyx.git] / src / frontends / qt4 / GuiToolbars.cpp
index e5999ef2d9f30a41e0d6b49661feeb9d6ace6168..3bc5a4a3f6af3f699e07a38b4a041308590e61a8 100644 (file)
 
 #include "Buffer.h"
 #include "BufferParams.h"
-#include "debug.h"
+#include "support/debug.h"
 #include "FuncRequest.h"
 #include "FuncStatus.h"
-#include "gettext.h"
+#include "support/gettext.h"
 #include "Layout.h"
 #include "LyX.h"
 #include "LyXFunc.h"
 #include "TextClass.h"
 #include "ToolbarBackend.h"
 
-
-using std::endl;
-using std::string;
+using namespace std;
 
 namespace lyx {
 namespace frontend {
@@ -41,10 +39,10 @@ namespace frontend {
 #define TurnOffFlag(x)  flags &= ~ToolbarInfo::x
 
 GuiToolbars::GuiToolbars(GuiView & owner)
-       : owner_(owner),
-         layout_(0),
-         last_textclass_(TextClassPtr())
-{}
+       : owner_(owner)
+{
+       init();
+}
 
 
 void GuiToolbars::initFlags(ToolbarInfo & tbinfo)
@@ -112,6 +110,11 @@ void GuiToolbars::initFlags(ToolbarInfo & tbinfo)
 
 void GuiToolbars::init()
 {
+       ToolbarsMap::const_iterator it = toolbars_.begin();
+       for (; it != toolbars_.end(); ++it)
+               delete it->second;
+       toolbars_.clear();
+
        // extracts the toolbars from the backend
        ToolbarBackend::Toolbars::iterator cit = toolbarbackend.begin();
        ToolbarBackend::Toolbars::iterator end = toolbarbackend.end();
@@ -286,41 +289,6 @@ void GuiToolbars::saveToolbarInfo()
 }
 
 
-void GuiToolbars::setLayout(docstring const & layout)
-{
-       if (layout_)
-               layout_->set(layout);
-}
-
-
-bool GuiToolbars::updateLayoutList(TextClassPtr textclass, bool force)
-{
-       // update the layout display
-       if (last_textclass_ != textclass || force) {
-               if (layout_)
-                       layout_->updateContents();
-               last_textclass_ = textclass;
-               return true;
-       } else
-               return false;
-}
-
-
-void GuiToolbars::openLayoutList()
-{
-       if (layout_)
-               layout_->showPopup();
-}
-
-
-void GuiToolbars::clearLayoutList()
-{
-       last_textclass_ = TextClassPtr();
-       if (layout_)
-               layout_->clear();
-}
-
-
 void GuiToolbars::add(ToolbarInfo const & tbinfo, bool newline)
 {
        GuiToolbar * tb_ptr = owner_.makeToolbar(tbinfo, newline);
@@ -330,9 +298,6 @@ void GuiToolbars::add(ToolbarInfo const & tbinfo, bool newline)
                tb_ptr->show();
        else
                tb_ptr->hide();
-
-       if (tb_ptr->layout())
-               layout_ = tb_ptr->layout();
 }
 
 
@@ -358,12 +323,6 @@ void GuiToolbars::updateIcons()
        ToolbarsMap::const_iterator const end = toolbars_.end();
        for (; it != end; ++it)
                it->second->updateContents();
-
-       bool const enable =
-               lyx::getStatus(FuncRequest(LFUN_LAYOUT)).enabled();
-
-       if (layout_)
-               layout_->setEnabled(enable);
 }