From 6204c94aeec9f65244c487edecf03a78c5740fbc Mon Sep 17 00:00:00 2001 From: Jim Raykowski Date: Thu, 24 Dec 2020 17:22:56 -0900 Subject: tdf#138545 fix mouse pointer not changing when over a hyperlink Rework of offending code that changes the mouse pointer to a hand icon when outline content visibility feature is active. Change-Id: Ia30a8f951b341a4f44f8b900cc756c205f6a273d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108275 Tested-by: Jenkins Reviewed-by: Jim Raykowski --- sw/source/uibase/docvw/edtwin.cxx | 59 +++++++++++++++++++++------------------ 1 file changed, 32 insertions(+), 27 deletions(-) (limited to 'sw/source') diff --git a/sw/source/uibase/docvw/edtwin.cxx b/sw/source/uibase/docvw/edtwin.cxx index 303bb7b7aa8f..7edaa5eea53a 100644 --- a/sw/source/uibase/docvw/edtwin.cxx +++ b/sw/source/uibase/docvw/edtwin.cxx @@ -557,36 +557,11 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) IsAttrAtPos::ClickField | IsAttrAtPos::InetAttr | IsAttrAtPos::Ftn | - IsAttrAtPos::SmartTag | - IsAttrAtPos::Outline); + IsAttrAtPos::SmartTag); if( rSh.GetContentAtPos( rLPt, aSwContentAtPos) ) { - if (IsAttrAtPos::Outline == aSwContentAtPos.eContentAtPos) - { - if (nModifier == KEY_MOD1 - && GetView().GetWrtShell().GetViewOptions()->IsShowOutlineContentVisibilityButton()) - { - eStyle = PointerStyle::RefHand; - // set quick help - if(aSwContentAtPos.aFnd.pNode && aSwContentAtPos.aFnd.pNode->IsTextNode()) - { - const SwNodes& rNds = GetView().GetWrtShell().GetDoc()->GetNodes(); - SwOutlineNodes::size_type nPos; - rNds.GetOutLineNds().Seek_Entry(aSwContentAtPos.aFnd.pNode->GetTextNode(), &nPos); - SwOutlineNodes::size_type nOutlineNodesCount - = rSh.getIDocumentOutlineNodesAccess()->getOutlineNodesCount(); - int nLevel = rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos); - OUString sQuickHelp(SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY)); - if (!rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent() - && nPos + 1 < nOutlineNodesCount - && rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos + 1) > nLevel) - sQuickHelp += " (" + SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) + ")"; - SetQuickHelpText(sQuickHelp); - } - } - } // Is edit inline input field - else if (IsAttrAtPos::Field == aSwContentAtPos.eContentAtPos + if (IsAttrAtPos::Field == aSwContentAtPos.eContentAtPos && aSwContentAtPos.pFndTextAttr != nullptr && aSwContentAtPos.pFndTextAttr->Which() == RES_TXTATR_INPUTFIELD) { @@ -604,6 +579,36 @@ void SwEditWin::UpdatePointer(const Point &rLPt, sal_uInt16 nModifier ) eStyle = PointerStyle::RefHand; } } + else if (GetView().GetWrtShell().GetViewOptions()->IsShowOutlineContentVisibilityButton()) + { + aSwContentAtPos.eContentAtPos = IsAttrAtPos::Outline; + if (rSh.GetContentAtPos(rLPt, aSwContentAtPos)) + { + if (IsAttrAtPos::Outline == aSwContentAtPos.eContentAtPos) + { + if (nModifier == KEY_MOD1) + { + eStyle = PointerStyle::RefHand; + // set quick help + if(aSwContentAtPos.aFnd.pNode && aSwContentAtPos.aFnd.pNode->IsTextNode()) + { + const SwNodes& rNds = GetView().GetWrtShell().GetDoc()->GetNodes(); + SwOutlineNodes::size_type nPos; + rNds.GetOutLineNds().Seek_Entry(aSwContentAtPos.aFnd.pNode->GetTextNode(), &nPos); + SwOutlineNodes::size_type nOutlineNodesCount + = rSh.getIDocumentOutlineNodesAccess()->getOutlineNodesCount(); + int nLevel = rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos); + OUString sQuickHelp(SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY)); + if (!rSh.GetViewOptions()->IsTreatSubOutlineLevelsAsContent() + && nPos + 1 < nOutlineNodesCount + && rSh.getIDocumentOutlineNodesAccess()->getOutlineLevel(nPos + 1) > nLevel) + sQuickHelp += " (" + SwResId(STR_CLICK_OUTLINE_CONTENT_TOGGLE_VISIBILITY_EXT) + ")"; + SetQuickHelpText(sQuickHelp); + } + } + } + } + } } } -- cgit