summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorJim Raykowski <raykowj@gmail.com>2020-12-29 15:12:44 -0900
committerSzymon Kłos <szymon.klos@collabora.com>2021-05-25 12:12:28 +0200
commita5486bc97e8701adbdaa42a7e41f9d326d8f572f (patch)
treeb029aa96af5d5f7357f25162dfebea88f6174bb5 /sw
parentcdc96d9f24622283d1862cb93cc66b9a634e8121 (diff)
tdf#137358 Fix incorrect outline position returned
when the cursor position is before the first outline node and there are outline nodes in the document model extras section. plus fix to update Navigator tracking on Navigator show Change-Id: Ib93ba0d460128314efef228810c06dbd929c672e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108492 Tested-by: Jenkins Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/qa/uitest/navigator/tdf137274.py9
-rw-r--r--sw/source/core/crsr/crstrvl.cxx6
-rw-r--r--sw/source/uibase/utlui/content.cxx2
-rw-r--r--sw/source/uibase/utlui/navipi.cxx5
4 files changed, 15 insertions, 7 deletions
diff --git a/sw/qa/uitest/navigator/tdf137274.py b/sw/qa/uitest/navigator/tdf137274.py
index 2c23960ddf75..f1e153992e2d 100644
--- a/sw/qa/uitest/navigator/tdf137274.py
+++ b/sw/qa/uitest/navigator/tdf137274.py
@@ -30,13 +30,10 @@ class tdf137274(UITestCase):
xWriterEdit.executeAction("SIDEBAR", mkPropertyValues({"PANEL": "SwNavigatorPanel"}))
- xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
-
- xWriterEdit.executeAction("FOCUS", tuple())
+ # wait until the navigator panel is available
+ self.ui_test.wait_until_child_is_available(xMainWindow, 'NavigatorPanelParent')
- # Wait until the navigator is available
- self.ui_test.wait_until_property_is_updated(xNavigatorPanel, "selectedtext", "Headings")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectedtext"], "Headings")
+ xNavigatorPanel = xWriterEdit.getChild("NavigatorPanelParent")
xContentTree = xNavigatorPanel.getChild("contenttree")
xComments = xContentTree.getChild('10')
diff --git a/sw/source/core/crsr/crstrvl.cxx b/sw/source/core/crsr/crstrvl.cxx
index 9c6e1fe8e13f..4dff3021baa2 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1150,6 +1150,12 @@ SwOutlineNodes::size_type SwCursorShell::GetOutlinePos(sal_uInt8 nLevel, SwPaM*
if (sw::IsParaPropsNode(*GetLayout(), *pNd->GetTextNode())
&& pNd->GetTextNode()->GetAttrOutlineLevel()-1 <= nLevel)
{
+ if (pNd->GetIndex() < rNds.GetEndOfExtras().GetIndex()
+ && pCursor->GetNode().GetIndex() > rNds.GetEndOfExtras().GetIndex())
+ {
+ // node found in extras but cursor position is not in extras
+ return SwOutlineNodes::npos;
+ }
return nPos;
}
}
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx
index 220a2be35534..cce23916c2ae 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3196,7 +3196,7 @@ IMPL_LINK_NOARG(SwContentTree, TimerUpdate, Timer *, void)
void SwContentTree::UpdateTracking()
{
- if (State::HIDDEN == m_eState)
+ if (State::HIDDEN == m_eState || !m_pActiveShell)
return;
// m_bIgnoreViewChange is set on delete
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index 97c210e9065f..a80f5f053824 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -737,6 +737,11 @@ void SwNavigationPI::StateChanged(StateChangedType nStateChange)
// show content if docked
if (!ParentIsFloatingWindow(GetParent()) && IsZoomedIn())
ZoomOut();
+ if (m_xContentTree)
+ {
+ m_xContentTree->SetActiveShell(GetActiveWrtShell());
+ m_xContentTree->UpdateTracking();
+ }
}
else if (nStateChange == StateChangedType::ControlFocus)
{