sw/source/uibase/utlui/content.cxx | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-)
New commits: commit d5e786d78d2f72a39f02746d6e0faa04da72c60a Author: Jim Raykowski <[email protected]> AuthorDate: Fri Mar 13 23:24:47 2020 -0800 Commit: Xisco Fauli <[email protected]> CommitDate: Mon Nov 30 11:14:34 2020 +0100 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 <[email protected]> (cherry picked from commit f7e2f5bca938aa916830e07895d2da6820282055) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106818 Reviewed-by: Xisco Fauli <[email protected]> diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 2ac47cd7efb7..641ee44bc6d3 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -4269,9 +4269,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()) @@ -4328,7 +4353,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: _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
