aboutsummaryrefslogtreecommitdiff
path: root/dw
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2009-09-19 16:41:37 +0000
committercorvid <corvid@lavabit.com>2009-09-19 16:41:37 +0000
commit9afc1d563e8af7118c36e4b4f5fc779236f5645d (patch)
tree10ff13aea0ddc6bd94b598ef90d623b2e265338d /dw
parente94aab2e1b0ac1ac90a59e8067e71b73d265cdc8 (diff)
clean up Textblock::motionNotifyImpl
Diffstat (limited to 'dw')
-rw-r--r--dw/textblock.cc20
1 files changed, 7 insertions, 13 deletions
diff --git a/dw/textblock.cc b/dw/textblock.cc
index 52ea7ed3..0958c1d2 100644
--- a/dw/textblock.cc
+++ b/dw/textblock.cc
@@ -521,28 +521,22 @@ bool Textblock::motionNotifyImpl (core::EventMotion *event)
if (event->state & core::BUTTON1_MASK)
return sendSelectionEvent (core::SelectionState::BUTTON_MOTION, event);
else {
- int linkOld, wordIndex;
- core::style::Tooltip *tooltipOld;
+ int wordIndex, linkOld = hoverLink;
+ core::style::Tooltip *tooltipOld = hoverTooltip;
wordIndex = findWord (event->xWidget, event->yWidget);
// cursor from word or widget style
- if (wordIndex == -1)
- setCursor (getStyle()->cursor);
- else
- setCursor (words->getRef(wordIndex)->style->cursor);
-
- linkOld = hoverLink;
- tooltipOld = hoverTooltip;
-
if (wordIndex == -1) {
+ setCursor (getStyle()->cursor);
hoverLink = -1;
hoverTooltip = NULL;
} else {
- hoverLink = words->getRef(wordIndex)->style->x_link;
- hoverTooltip = words->getRef(wordIndex)->style->x_tooltip;
+ core::style::Style *style = words->getRef(wordIndex)->style;
+ setCursor (style->cursor);
+ hoverLink = style->x_link;
+ hoverTooltip = style->x_tooltip;
}
-
// Show/hide tooltip
if (tooltipOld != hoverTooltip) {
if (tooltipOld)