[Libreoffice-commits] core.git: sw/qa sw/source
Jim Raykowski (via logerrit)
logerrit at kemper.freedesktop.org
Sat Jan 16 22:31:56 UTC 2021
sw/qa/uitest/navigator/tdf114724.py | 4 ++--
sw/qa/uitest/navigator/tdf137274.py | 9 +++------
sw/source/core/crsr/crstrvl.cxx | 6 ++++++
sw/source/uibase/utlui/content.cxx | 2 +-
sw/source/uibase/utlui/navipi.cxx | 5 +++++
5 files changed, 17 insertions(+), 9 deletions(-)
New commits:
commit 602a044014b55a5a1b1a5f0e96af603590ee899f
Author: Jim Raykowski <raykowj at gmail.com>
AuthorDate: Tue Dec 29 15:12:44 2020 -0900
Commit: Jim Raykowski <raykowj at gmail.com>
CommitDate: Sat Jan 16 23:31:18 2021 +0100
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 at gmail.com>
diff --git a/sw/qa/uitest/navigator/tdf114724.py b/sw/qa/uitest/navigator/tdf114724.py
index 9c538739048f..a84bab60da60 100644
--- a/sw/qa/uitest/navigator/tdf114724.py
+++ b/sw/qa/uitest/navigator/tdf114724.py
@@ -22,8 +22,8 @@ class tdf114724(UITestCase):
xWriterEdit.executeAction("FOCUS", tuple())
- self.ui_test.wait_until_property_is_updated(xNavigatorPanel, "selectedtext", "Headings")
- self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectedtext"], "Headings")
+ self.ui_test.wait_until_property_is_updated(xNavigatorPanel, "selectedtext", "HEADING 1")
+ self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectedtext"], "HEADING 1")
self.assertEqual(get_state_as_dict(xNavigatorPanel)["selectioncount"], "1")
for _ in range(0,3):
xWriterEdit.executeAction("TYPE", mkPropertyValues({"KEYCODE": "DOWN"}))
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 a41f3ae86799..893233c7ec1a 100644
--- a/sw/source/core/crsr/crstrvl.cxx
+++ b/sw/source/core/crsr/crstrvl.cxx
@@ -1148,6 +1148,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 5ac56dbabc43..5b3ce3b6474b 100644
--- a/sw/source/uibase/utlui/content.cxx
+++ b/sw/source/uibase/utlui/content.cxx
@@ -3210,7 +3210,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 725e4257ee14..7c440647e4e3 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -750,6 +750,11 @@ void SwNavigationPI::StateChanged(StateChangedType nStateChange)
// show content if docked
if (SfxChildWindowContext::GetFloatingWindow(GetParent()) == nullptr && IsZoomedIn())
ZoomOut();
+ if (m_xContentTree)
+ {
+ m_xContentTree->SetActiveShell(GetActiveWrtShell());
+ m_xContentTree->UpdateTracking();
+ }
}
else if (nStateChange == StateChangedType::ControlFocus)
{
More information about the Libreoffice-commits
mailing list