summaryrefslogtreecommitdiff
path: root/starmath/source
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-06-02 12:46:51 +0300
committerTor Lillqvist <tml@collabora.com>2020-06-25 10:31:38 +0200
commitb0da52d19ed40dd0871f208eb7387ec1d8252de4 (patch)
treed324523d655b9adad9b9d43cfab524f07b234c1a /starmath/source
parentf583d42c48c2ac5a800d29e764df77f7904c432b (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: I6e2d85e61a6743ca110500bf48b3d80b2027dfb1 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/97085 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com>
Diffstat (limited to 'starmath/source')
-rw-r--r--starmath/source/smmod.cxx3
1 files changed, 3 insertions, 0 deletions
diff --git a/starmath/source/smmod.cxx b/starmath/source/smmod.cxx
index 32cd5550d9e5..93f27da82eef 100644
--- a/starmath/source/smmod.cxx
+++ b/starmath/source/smmod.cxx
@@ -139,6 +139,9 @@ void SmModule::ApplyColorConfigValues( const svtools::ColorConfig &rColorCfg )
SfxViewShell* pViewShell = SfxViewShell::GetFirst();
while (pViewShell)
{
+ // FIXME: What if pViewShell is for a different document,
+ // but OTOH Math is presumably never used through
+ // LibreOfficeKit, so maybe an irrelevant concern?
if (dynamic_cast<const SmViewShell *>(pViewShell) != nullptr)
{
SmViewShell *pSmView = static_cast<SmViewShell *>(pViewShell);