[Libreoffice-commits] core.git: sw/source

Jim Raykowski (via logerrit) logerrit at kemper.freedesktop.org
Sat Dec 26 16:09:46 UTC 2020


 sw/source/uibase/docvw/edtwin.cxx |   59 ++++++++++++++++++++------------------
 1 file changed, 32 insertions(+), 27 deletions(-)

New commits:
commit 6204c94aeec9f65244c487edecf03a78c5740fbc
Author:     Jim Raykowski <raykowj at gmail.com>
AuthorDate: Thu Dec 24 17:22:56 2020 -0900
Commit:     Jim Raykowski <raykowj at gmail.com>
CommitDate: Sat Dec 26 17:09:04 2020 +0100

    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 at gmail.com>

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);
+                                }
+                            }
+                        }
+                    }
+                }
             }
         }
 


More information about the Libreoffice-commits mailing list