GuiToolbar::fill(): only once.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@24978 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2008-05-28 10:30:25 +00:00
parent 15b42ccd4a
commit 5254716219
2 changed files with 6 additions and 1 deletions

View 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;
}

View File

@ -172,6 +172,8 @@ private:
GuiCommandBuffer * command_buffer_;
///
ToolbarInfo const & tbinfo_;
///
bool filled_;
};
} // namespace frontend