diff options
author | Jim Raykowski <raykowj@gmail.com> | 2020-08-31 13:08:06 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2020-09-05 07:39:17 +0200 |
commit | 6935dcd80f1677a293a412da3d94afd1217c0bd1 (patch) | |
tree | f4e555bfd28b68aaaeb94cb4789828cb89d90fbc /sw/source/uibase | |
parent | bb64b19e3e8942e610db2d3596d859f7c7864811 (diff) |
Improve outline position tracking and content visibility
state update in Writer Navigator when outline content visibility is
toggled.
Change-Id: I28ff127bc2f7776b72a2dc32ae2f6147169c8bac
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/101771
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase')
-rw-r--r-- | sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx | 4 | ||||
-rw-r--r-- | sw/source/uibase/wrtsh/wrtsh1.cxx | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx index 7ab66b9c3291..e554534a34bc 100644 --- a/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx +++ b/sw/source/uibase/docvw/OutlineContentVisibilityWin.cxx @@ -158,6 +158,9 @@ void SwOutlineContentVisibilityWin::ToggleOutlineContentVisibility(const bool bS if (GetEditWin()->GetView().IsDrawMode()) GetEditWin()->GetView().LeaveDrawCreate(); rSh.EnterStdMode(); + // set cursor position here so Navigator tracks outline + // when doc changed broadcast message is sent in toggle function + rSh.GotoOutline(m_nOutlinePos); if (bSubs) { // toggle including sub levels @@ -177,7 +180,6 @@ void SwOutlineContentVisibilityWin::ToggleOutlineContentVisibility(const bool bS rSh.ToggleOutlineContentVisibility(m_nOutlinePos); SetSymbol(rSh.IsOutlineContentFolded(m_nOutlinePos) ? SymbolType::ARROW_RIGHT : SymbolType::ARROW_DOWN); - rSh.GotoOutline(m_nOutlinePos); // sets cursor position rSh.LockView(false); } diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 96cc83e62167..60ac6cca4cc6 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -2107,7 +2107,8 @@ void SwWrtShell::ToggleOutlineContentVisibility(size_t nPos, bool bForceFold) } pSttNd->GetTextNode()->SetAttrOutlineContentVisible(false); } - GetView().GetEditWin().Invalidate(); + GetView().GetEditWin().Invalidate(InvalidateFlags::Update); + GetDoc()->GetDocShell()->Broadcast(SfxHint(SfxHintId::DocChanged)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |