From 9afc1d563e8af7118c36e4b4f5fc779236f5645d Mon Sep 17 00:00:00 2001 From: corvid Date: Sat, 19 Sep 2009 16:41:37 +0000 Subject: clean up Textblock::motionNotifyImpl --- dw/textblock.cc | 20 +++++++------------- 1 file changed, 7 insertions(+), 13 deletions(-) (limited to 'dw/textblock.cc') 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) -- cgit v1.2.3