summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2022-04-13 18:44:19 -0800
committerJim Raykowski <raykowj@gmail.com>2022-04-17 05:19:20 +0200
commitf7102dafc44a66b8ffb7b8d516fe1720fc45f8fe (patch)
tree8404c2187a3f4e83045d783c5c04b49b76a49493 /sw
parent7337c4181331eaf091050181d4c21be5911ac815 (diff)
SwNavigator content tracking: clear selections and entry cursor
when entry is not found in content tree This happens when the document cursor is positioned on table of content hyperlinks. Change-Id: I717b2dae31780b26cf5450fbea0c8f461659770c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132989 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/utlui/content.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 64a710b6f3f3..05e9eabfbdca 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3257,7 +3257,11 @@ static void lcl_SelectByContentTypeAndAddress(SwContentTree* pThis, weld::TreeVi
ContentTypeId nType, const void* ptr)
{
if (!ptr)
+ {
+ rContentTree.set_cursor(-1);
+ pThis->Select();
return;
+ }
// find content type entry
std::unique_ptr<weld::TreeIter> xIter(rContentTree.make_iterator());
@@ -3273,7 +3277,11 @@ static void lcl_SelectByContentTypeAndAddress(SwContentTree* pThis, weld::TreeVi
}
if (!bFoundEntry)
+ {
+ rContentTree.set_cursor(-1);
+ pThis->Select();
return;
+ }
// assure content type entry is expanded
rContentTree.expand_row(*xIter);
@@ -3332,6 +3340,10 @@ static void lcl_SelectByContentTypeAndAddress(SwContentTree* pThis, weld::TreeVi
return;
}
}
+
+ rContentTree.set_cursor(-1);
+ pThis->Select();
+ return;
}
static void lcl_SelectByContentTypeAndName(SwContentTree* pThis, weld::TreeView& rContentTree,