diff options
author | Jim Raykowski <raykowj@gmail.com> | 2020-12-24 17:22:56 -0900 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2020-12-26 17:09:04 +0100 |
commit | 6204c94aeec9f65244c487edecf03a78c5740fbc (patch) | |
tree | fece561ea1c46c3c43bad628ed7b8f26d1373f7e /sw/source | |
parent | 4abcdc50064aba00307f13f574c9116c6a2e4886 (diff) |
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 <raykowj@gmail.com>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/uibase/docvw/edtwin.cxx | 59 |
1 files changed, 32 insertions, 27 deletions
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); + } + } + } + } + } } } |