desktop/source/lib/init.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
New commits: commit 0dba806b93905d05a6d068374e97850adaca7afb Author: Tor Lillqvist <t...@collabora.com> AuthorDate: Thu Sep 3 22:28:29 2020 +0300 Commit: Tor Lillqvist <t...@collabora.com> CommitDate: Fri Sep 4 10:52:00 2020 +0200 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 <jenkinscollaboraoff...@gmail.com> Reviewed-by: Tor Lillqvist <t...@collabora.com> 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) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits