cleanup GuiLayoutBox a bit.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20645 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
Abdelrazak Younes 2007-10-01 21:08:07 +00:00
parent 3ca9ddb6ed
commit f16caac393

View File

@ -149,13 +149,12 @@ void GuiLayoutBox::setEnabled(bool enable)
combo_->setEnabled(enable);
}
namespace {
// FIXME: put that in frontends/LayoutBox class.
void layoutSelected(LyXView & lv, docstring const & name)
void GuiLayoutBox::selected(const QString & str)
{
TextClass const & tc = lv.buffer()->params().getTextClass();
owner_.setFocus();
TextClass const & tc = owner_.buffer()->params().getTextClass();
docstring const name = qstring_to_ucs4(str);
TextClass::const_iterator it = tc.begin();
TextClass::const_iterator const end = tc.end();
for (; it != end; ++it) {
@ -163,7 +162,7 @@ void layoutSelected(LyXView & lv, docstring const & name)
if (translateIfPossible(itname) == name) {
FuncRequest const func(LFUN_LAYOUT, itname,
FuncRequest::TOOLBAR);
lv.dispatch(func);
owner_.dispatch(func);
return;
}
}
@ -171,15 +170,6 @@ void layoutSelected(LyXView & lv, docstring const & name)
<< endl;
}
} // anon namespace
void GuiLayoutBox::selected(const QString & str)
{
owner_.setFocus();
layoutSelected(owner_, qstring_to_ucs4(str));
}
/////////////////////////////////////////////////////////////////////