Author: rgheck
Date: Sun Dec 4 03:38:00 2011
New Revision: 40359
URL: http://www.lyx.org/trac/changeset/40359
Log:
There's no need to separate this logic out if it's only called
from the one place.
Modified:
lyx-devel/trunk/src/BufferView.cpp
lyx-devel/trunk/src/BufferView.h
Modified: lyx-devel/trunk/src/BufferView.cpp
==============================================================================
--- lyx-devel/trunk/src/BufferView.cpp Sun Dec 4 03:35:38 2011 (r40358)
+++ lyx-devel/trunk/src/BufferView.cpp Sun Dec 4 03:38:00 2011 (r40359)
@@ -1714,10 +1714,30 @@
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::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();
Modified: lyx-devel/trunk/src/BufferView.h
==============================================================================
--- lyx-devel/trunk/src/BufferView.h Sun Dec 4 03:35:38 2011 (r40358)
+++ lyx-devel/trunk/src/BufferView.h Sun Dec 4 03:38:00 2011 (r40359)
@@ -166,8 +166,6 @@
/// 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.