]> git.lyx.org Git - features.git/commitdiff
There's no need to separate this logic out if it's only called
authorRichard Heck <rgheck@comcast.net>
Sun, 4 Dec 2011 02:38:00 +0000 (02:38 +0000)
committerRichard Heck <rgheck@comcast.net>
Sun, 4 Dec 2011 02:38:00 +0000 (02:38 +0000)
from the one place.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40359 a592a061-630c-0410-9148-cb99ea01b6c8

src/BufferView.cpp
src/BufferView.h

index f43cd7363cc803784ee56121edfc54d5cf11e5eb..8cea9baf1c510192c08278e8ccdcda8e76d83beb 100644 (file)
@@ -1714,10 +1714,30 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr)
                break;
        }
 
-       case LFUN_SCROLL:
-               lfunScroll(cmd);
+       case LFUN_SCROLL: {
+               string const scroll_type = cmd.getArg(0);
+               int scroll_step = 0;
+               if (scroll_type == "line")
+                       scroll_step = d->scrollbarParameters_.single_step;
+               else if (scroll_type == "page")
+                       scroll_step = d->scrollbarParameters_.page_step;
+               else
+                       return;
+               string const scroll_quantity = cmd.getArg(1);
+               if (scroll_quantity == "up")
+                       scrollUp(scroll_step);
+               else if (scroll_quantity == "down")
+                       scrollDown(scroll_step);
+               else {
+                       int const scroll_value = convert<int>(scroll_quantity);
+                       if (scroll_value)
+                               scroll(scroll_step * scroll_value);
+               }
+               buffer_.changed(true);
+               updateHoveredInset();
                dr.forceBufferUpdate();
                break;
+       }
 
        case LFUN_SCREEN_UP_SELECT: {
                cur.selHandle(true);
@@ -2171,31 +2191,6 @@ void BufferView::mouseEventDispatch(FuncRequest const & cmd0)
 }
 
 
-void BufferView::lfunScroll(FuncRequest const & cmd)
-{
-       string const scroll_type = cmd.getArg(0);
-       int scroll_step = 0;
-       if (scroll_type == "line")
-               scroll_step = d->scrollbarParameters_.single_step;
-       else if (scroll_type == "page")
-               scroll_step = d->scrollbarParameters_.page_step;
-       else
-               return;
-       string const scroll_quantity = cmd.getArg(1);
-       if (scroll_quantity == "up")
-               scrollUp(scroll_step);
-       else if (scroll_quantity == "down")
-               scrollDown(scroll_step);
-       else {
-               int const scroll_value = convert<int>(scroll_quantity);
-               if (scroll_value)
-                       scroll(scroll_step * scroll_value);
-       }
-       buffer_.changed(true);
-       updateHoveredInset();
-}
-
-
 int BufferView::minVisiblePart()
 {
        return 2 * defaultRowHeight();
index f24af0d21ed5cdf0b465173377f572d5592822cc..f6d5b1894baeca201817065cc28514681e76b281 100644 (file)
@@ -166,8 +166,6 @@ public:
        /// Scroll to the cursor.
        /// \param recenter Whether the cursor should be centered on screen
        bool scrollToCursor(DocIterator const & dit, bool recenter);
-       /// LFUN_SCROLL Helper.
-       void lfunScroll(FuncRequest const & cmd);
        /// scroll down document by the given number of pixels.
        int scrollDown(int pixels);
        /// scroll up document by the given number of pixels.