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-09-04 10:52:00 +0200
commit0dba806b93905d05a6d068374e97850adaca7afb (patch)
tree5818cb77a8eeb9759ed22f0aeee43bcbd7b8f235 /desktop
parentecda8127d8c3c3676a5af6e3d6b3dce243366898 (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>
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 6f68fe32a6fc..989be226e91a 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -2280,6 +2280,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);
@@ -2293,7 +2295,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)