]> git.lyx.org Git - features.git/commitdiff
GuiToolbar::fill(): only once.
authorAbdelrazak Younes <younes@lyx.org>
Wed, 28 May 2008 10:30:25 +0000 (10:30 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Wed, 28 May 2008 10:30:25 +0000 (10:30 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24978 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToolbar.cpp
src/frontends/qt4/GuiToolbar.h

index 3dd58a73ce02417c2835ae43170a860db86d2400..7ecd0b60ab5c53390ba751fafed5c9bae68dfce5 100644 (file)
@@ -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;
 }
 
 
index 095be20f90438682b0b54c7510b8553f960478f5..ec0b4cec2872a030bf19567d3fabd432f581a316 100644 (file)
@@ -172,6 +172,8 @@ private:
        GuiCommandBuffer * command_buffer_;
        ///
        ToolbarInfo const & tbinfo_;
+       ///
+       bool filled_;
 };
 
 } // namespace frontend