summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorTor Lillqvist <tml@collabora.com>2020-09-03 22:28:29 +0300
committerTor Lillqvist <tml@collabora.com>2020-11-21 23:21:57 +0100
commita65141b2b46ad8150bafca4629b0ef924978a201 (patch)
tree602a288d5d2bfdf078855100deb88505e0a3b690 /desktop
parentcf09258fc3287b6299d07799dce22d9b9fd1ebb7 (diff)
Must now call the lovely SfxViewShell::SetCurrentDocId()
Fixes fallout from 4fd2679a7a2b0494da84f344ab97b835edf73377. Otherwise the SfxViewShell doesn't know the id of its document, and counting the number of views of a document in SfxLokHelper::getViewsCount() fails. Change-Id: I16ba209463281aae4ab9fdfd4ee1cd6b98205774 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102025 Tested-by: Jenkins CollaboraOffice <jenkinscollaboraoffice@gmail.com> Reviewed-by: Tor Lillqvist <tml@collabora.com> Reviewed-on: https://gerrit.libreoffice.org/c/core/+/106254 Tested-by: Jenkins
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/lib/init.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index 9bcfff524bbf..cf8503bf136d 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2278,6 +2278,8 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
aFilterOptions[3].Value <<= nUpdateDoc;
*/
+ const int nThisDocumentId = nDocumentIdCounter++;
+ SfxViewShell::SetCurrentDocId(ViewShellDocId(nThisDocumentId));
uno::Reference<lang::XComponent> xComponent = xComponentLoader->loadComponentFromURL(
aURL, "_blank", 0,
aFilterOptions);
@@ -2291,7 +2293,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
return nullptr;
}
- LibLODocument_Impl* pDocument = new LibLODocument_Impl(xComponent, nDocumentIdCounter++);
+ LibLODocument_Impl* pDocument = new LibLODocument_Impl(xComponent, nThisDocumentId);
// After loading the document, its initial view is the "current" view.
if (pLib->mpCallback)