]> git.lyx.org Git - features.git/commitdiff
cleanup GuiLayoutBox a bit.
authorAbdelrazak Younes <younes@lyx.org>
Mon, 1 Oct 2007 21:08:07 +0000 (21:08 +0000)
committerAbdelrazak Younes <younes@lyx.org>
Mon, 1 Oct 2007 21:08:07 +0000 (21:08 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@20645 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/qt4/GuiToolbar.cpp

index d0a6f9fc6be8b37b0bd61417e93b6eb09e733215..f687ad4facc3b1d1b756811b74d2c0018cd2319f 100644 (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));
-}
-
 
 
 /////////////////////////////////////////////////////////////////////