diff options
author | Jim Raykowski <raykowj@gmail.com> | 2020-03-13 23:24:47 -0800 |
---|---|---|
committer | Jim Raykowski <raykowj@gmail.com> | 2020-11-29 20:52:19 +0100 |
commit | f7e2f5bca938aa916830e07895d2da6820282055 (patch) | |
tree | fa210dda8b46000ee32a46ac5407975448ca94d6 /sw/source/uibase/utlui/content.cxx | |
parent | f28c8085d14f65aa40da434c1d9d5ae60bfad862 (diff) |
tdf#131218 Assure standard mode at shell before goto content
Also resolves tdf#133039
This is a copy of SwPostItMgr::AssureStdModeAtShell with an addition of
EnterStdMode used when not in frame mode and no object is selected. It
makes focus on content, from Navigator goto content, work as expected
for all content types.
Change-Id: Id23ea8f603b7f5d90f1e23f1eb82db292c71c499
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/90487
Tested-by: Jenkins
Reviewed-by: Jim Raykowski <raykowj@gmail.com>
Diffstat (limited to 'sw/source/uibase/utlui/content.cxx')
-rw-r--r-- | sw/source/uibase/utlui/content.cxx | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 9dd4e661370c..6eceb15435eb 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4268,9 +4268,34 @@ void SwContentTree::EditEntry(const weld::TreeIter& rEntry, EditEntryMode nMode) } } +static void lcl_AssureStdModeAtShell(SwWrtShell* pWrtShell) +{ + // deselect any drawing or frame and leave editing mode + SdrView* pSdrView = pWrtShell->GetDrawView(); + if (pSdrView && pSdrView->IsTextEdit() ) + { + bool bLockView = pWrtShell->IsViewLocked(); + pWrtShell->LockView(true); + pWrtShell->EndTextEdit(); + pWrtShell->LockView(bLockView); + } + + if (pWrtShell->IsSelFrameMode() || pWrtShell->IsObjSelected()) + { + pWrtShell->UnSelectFrame(); + pWrtShell->LeaveSelFrameMode(); + pWrtShell->GetView().LeaveDrawCreate(); + pWrtShell->EnterStdMode(); + pWrtShell->DrawSelChanged(); + pWrtShell->GetView().StopShellTimer(); + } + else + pWrtShell->EnterStdMode(); +} + void SwContentTree::GotoContent(const SwContent* pCnt) { - m_pActiveShell->EnterStdMode(); + lcl_AssureStdModeAtShell(m_pActiveShell); bool bSel = false; switch(pCnt->GetParent()->GetType()) @@ -4327,7 +4352,6 @@ void SwContentTree::GotoContent(const SwContent* pCnt) } break; case ContentTypeId::POSTIT: - m_pActiveShell->GetView().GetPostItMgr()->AssureStdModeAtShell(); m_pActiveShell->GotoFormatField(*static_cast<const SwPostItContent*>(pCnt)->GetPostIt()); break; case ContentTypeId::DRAWOBJECT: |