summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSzymon Kłos <szymon.klos@collabora.com>2022-04-20 10:33:03 +0200
committerPranam Lashkari <lpranam@collabora.com>2022-04-25 11:41:28 +0200
commit1d14333d82a694723ed5c63707d94dddfb67f93d (patch)
tree81e613850a027e1817e5b70b9d3357de0bfd8568
parentlok: reset ui mode state when switch to notebookbar cancelled (diff)
downloadcore-1d14333d82a694723ed5c63707d94dddfb67f93d.tar.gz
core-1d14333d82a694723ed5c63707d94dddfb67f93d.zip
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 <jenkinscollaboraoffice@gmail.com> Reviewed-by: Pranam Lashkari <lpranam@collabora.com>
-rw-r--r--desktop/source/lib/init.cxx17
1 files changed, 16 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 58236658c08a..35bee204a24e 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -3628,6 +3628,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
@@ -3637,9 +3638,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 = pViewShell->GetViewShellId().get();
+ nLastNonEditorView = nViewId;
doc_setView(pThis, nViewId);
break;
}
@@ -3647,6 +3654,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)
{