diff options
author | Tor Lillqvist <tml@collabora.com> | 2020-06-02 12:46:51 +0300 |
---|---|---|
committer | Tor Lillqvist <tml@collabora.com> | 2020-06-09 17:24:17 +0200 |
commit | a22cba07a470385dcb930c56c90cba81b317773e (patch) | |
tree | fb198486ab849c2c5f99f4bc5aeb56177de53d73 /sw | |
parent | dadba793c107cbf2ccadfbd7b41b6187ff06d4b8 (diff) |
tdf#128502: Try to support multiple documents in LibreOfficeKit-using process
The LibreOfficeKit-specific code typically has assumed that all the
"views" (SfxViewShell instances) are for the same document, because
all LibreOfficeKit-based application processes (including the "kit"
processes in Online and the iOS app) so far have only had one document
open at a time.
It is now possible to pass several document file names on the command
line to gtktiledviewer and that is an easy way to demonstrate how
badly it still works even with this patch.
Introduce a unique numeric document id that is increased in the
LibLODocument_Impl constructor. Add APIs to access that. When
iterating over views, try to skip views that are not of the document
visible in the "current" view, if we know what the "current" view is.
Also add a couple of FIXMEs at places where it is a bit unclear (to
me) whether it is correct to iterate over all views, or whether only
views for the "current" document are what we would want.
Change-Id: Id5ebb92a115723cdeb23907163d5b5f282016252
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/95353
Tested-by: Jenkins
Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/docredln.cxx | 3 | ||||
-rw-r--r-- | sw/source/core/text/txtcache.cxx | 2 |
2 files changed, 4 insertions, 1 deletions
diff --git a/sw/source/core/doc/docredln.cxx b/sw/source/core/doc/docredln.cxx index 552f92e70087..4a8b9791b97d 100644 --- a/sw/source/core/doc/docredln.cxx +++ b/sw/source/core/doc/docredln.cxx @@ -411,7 +411,8 @@ void SwRedlineTable::LOKRedlineNotification(RedlineNotification nType, SwRangeRe SfxViewShell* pViewShell = SfxViewShell::GetFirst(); while (pViewShell) { - pViewShell->libreOfficeKitViewCallback(nType == RedlineNotification::Modify ? LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED : LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED, aPayload.c_str()); + if (pView && pView->GetDocId() == pViewShell->GetDocId()) + pViewShell->libreOfficeKitViewCallback(nType == RedlineNotification::Modify ? LOK_CALLBACK_REDLINE_TABLE_ENTRY_MODIFIED : LOK_CALLBACK_REDLINE_TABLE_SIZE_CHANGED, aPayload.c_str()); pViewShell = SfxViewShell::GetNext(*pViewShell); } } diff --git a/sw/source/core/text/txtcache.cxx b/sw/source/core/text/txtcache.cxx index 17eedcc17626..2c8866c7f09a 100644 --- a/sw/source/core/text/txtcache.cxx +++ b/sw/source/core/text/txtcache.cxx @@ -170,6 +170,8 @@ SwSaveSetLRUOfst::SwSaveSetLRUOfst() pView != nullptr; pView = SfxViewShell::GetNext(*pView, true, checkSfxViewShell<SwView>)) { + // Apparently we are not interested here what document pView is for, but only in the + // total number of shells in the process? ++nVisibleShells; } |