mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-23 10:18:50 +00:00
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:
parent
3ca9ddb6ed
commit
f16caac393
@ -149,13 +149,12 @@ void GuiLayoutBox::setEnabled(bool enable)
|
|||||||
combo_->setEnabled(enable);
|
combo_->setEnabled(enable);
|
||||||
}
|
}
|
||||||
|
|
||||||
namespace {
|
|
||||||
|
|
||||||
// FIXME: put that in frontends/LayoutBox class.
|
void GuiLayoutBox::selected(const QString & str)
|
||||||
void layoutSelected(LyXView & lv, docstring const & name)
|
|
||||||
{
|
{
|
||||||
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 it = tc.begin();
|
||||||
TextClass::const_iterator const end = tc.end();
|
TextClass::const_iterator const end = tc.end();
|
||||||
for (; it != end; ++it) {
|
for (; it != end; ++it) {
|
||||||
@ -163,7 +162,7 @@ void layoutSelected(LyXView & lv, docstring const & name)
|
|||||||
if (translateIfPossible(itname) == name) {
|
if (translateIfPossible(itname) == name) {
|
||||||
FuncRequest const func(LFUN_LAYOUT, itname,
|
FuncRequest const func(LFUN_LAYOUT, itname,
|
||||||
FuncRequest::TOOLBAR);
|
FuncRequest::TOOLBAR);
|
||||||
lv.dispatch(func);
|
owner_.dispatch(func);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -171,15 +170,6 @@ void layoutSelected(LyXView & lv, docstring const & name)
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
} // anon namespace
|
|
||||||
|
|
||||||
void GuiLayoutBox::selected(const QString & str)
|
|
||||||
{
|
|
||||||
owner_.setFocus();
|
|
||||||
|
|
||||||
layoutSelected(owner_, qstring_to_ucs4(str));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/////////////////////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////////////////////
|
||||||
|
Loading…
Reference in New Issue
Block a user