desktop/source/lib/init.cxx | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
New commits: commit 930c3f45b2714d1d21d1b061e9f3fa23b239b1e7 Author: Szymon Kłos <szymon.k...@collabora.com> AuthorDate: Wed Apr 20 10:33:03 2022 +0200 Commit: Szymon Kłos <szymon.k...@collabora.com> CommitDate: Tue Apr 26 10:28:27 2022 +0200 lok: don't render active textbox on all slides when we render tiles for slide previews we use viewid = 0 (first session) so when first session edits any textbox and in other session we request slide previews (eg. after new slide was added) then we received tile with additional text from the first session this is caused by: commit bee4ff508a456a1552aacdf6fc838b8b7cffb9ec desktop lok: avoid unnecessary setPart() in paintPartTile() If possible, switch views, not parts, that way started Impress text edits don't end as a side-effect. but later there was a fix which doesn't trigger closing of texbox editing when switching parts: commit ce7bf351972bbfd64ca99e8d2fb4c5f77591c9e0 impress: don't exit textbox editing when new slide was added so we don't need that in all cases... to fix issue described above: still switch views instead of parts when possible - but avoid views where editing is active Change-Id: Ib6e66a85b9ca68d6e67e3d9cb17060aa42b85220 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133202 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoff...@gmail.com> Reviewed-by: Pranam Lashkari <lpra...@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133376 Reviewed-by: Szymon Kłos <szymon.k...@collabora.com> diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx index f3396a3f4bc7..f1becd67d215 100644 --- a/desktop/source/lib/init.cxx +++ b/desktop/source/lib/init.cxx @@ -3461,6 +3461,7 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, int nOrigPart = 0; const bool isText = (doc_getDocumentType(pThis) == LOK_DOCTYPE_TEXT); int nViewId = nOrigViewId; + int nLastNonEditorView = nViewId; if (!isText) { // Check if just switching to another view is enough, that has @@ -3470,9 +3471,15 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while (pViewShell) { - if (pViewShell->getPart() == nPart) + bool bIsInEdit = pViewShell->GetDrawView() && + pViewShell->GetDrawView()->GetTextEditOutliner(); + if (!bIsInEdit) + nLastNonEditorView = pViewShell->GetViewShellId().get(); + + if (pViewShell->getPart() == nPart && !bIsInEdit) { nViewId = static_cast<sal_Int32>(pViewShell->GetViewShellId()); + nLastNonEditorView = nViewId; doc_setView(pThis, nViewId); break; } @@ -3480,6 +3487,14 @@ static void doc_paintPartTile(LibreOfficeKitDocument* pThis, } } + // if not found view with correct part - at least avoid rendering active textbox + SfxViewShell* pCurrentViewShell = SfxViewShell::Current(); + if (pCurrentViewShell && pCurrentViewShell->GetDrawView() && + pCurrentViewShell->GetDrawView()->GetTextEditOutliner()) + { + doc_setView(pThis, nLastNonEditorView); + } + nOrigPart = doc_getPart(pThis); if (nPart != nOrigPart) {