From: Abdelrazak Younes Date: Wed, 28 May 2008 10:30:25 +0000 (+0000) Subject: GuiToolbar::fill(): only once. X-Git-Tag: 1.6.10~4642 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5254716219769792b5fe9f9a169854e9c3f5a9c9;p=features.git GuiToolbar::fill(): only once. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24978 a592a061-630c-0410-9148-cb99ea01b6c8 --- diff --git a/src/frontends/qt4/GuiToolbar.cpp b/src/frontends/qt4/GuiToolbar.cpp index 3dd58a73ce..7ecd0b60ab 100644 --- a/src/frontends/qt4/GuiToolbar.cpp +++ b/src/frontends/qt4/GuiToolbar.cpp @@ -843,7 +843,7 @@ void GuiLayoutBox::selected(int index) GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner) : QToolBar(qt_(tbinfo.gui_name), &owner), visibility_(0), allowauto_(false), owner_(owner), layout_(0), command_buffer_(0), - tbinfo_(tbinfo) + tbinfo_(tbinfo), filled_(false) { // Toolbar dragging is allowed. setMovable(true); @@ -857,10 +857,13 @@ GuiToolbar::GuiToolbar(ToolbarInfo const & tbinfo, GuiView & owner) void GuiToolbar::fill() { + if (filled_) + return; ToolbarInfo::item_iterator it = tbinfo_.items.begin(); ToolbarInfo::item_iterator end = tbinfo_.items.end(); for (; it != end; ++it) add(*it); + filled_ = true; } diff --git a/src/frontends/qt4/GuiToolbar.h b/src/frontends/qt4/GuiToolbar.h index 095be20f90..ec0b4cec28 100644 --- a/src/frontends/qt4/GuiToolbar.h +++ b/src/frontends/qt4/GuiToolbar.h @@ -172,6 +172,8 @@ private: GuiCommandBuffer * command_buffer_; /// ToolbarInfo const & tbinfo_; + /// + bool filled_; }; } // namespace frontend