Kaydet (Commit) 430c3521 authored tarafından Mike Kaganski's avatar Mike Kaganski

Implement OpenDocuments::PromptedOnLastOpen

This prevents SharePoint from trying to download documents in browser
after they were already opened by LibreOffice SharePoint integration
ActiveX control.

The implementation just returns true, to avoid instant refresh of the
site in browser. TODO: fine-tune when understood when and why it makes
sense to return false.

Change-Id: I1ceae82db16ca8e418850fafd8c171ee6a2e039b
Reviewed-on: https://gerrit.libreoffice.org/72266
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
üst 19573d94
......@@ -320,10 +320,23 @@ STDMETHODIMP COMOpenDocuments::CreateNewDocument2(
// refreshes itself the next time it receives focus. One refresh can occur after the new document
// is saved to the server
STDMETHODIMP COMOpenDocuments::PromptedOnLastOpen(
VARIANT_BOOL* /*pbResult*/) // true if the security dialog box that appears when a document is opened has already appeared; otherwise false
VARIANT_BOOL* pbResult) // true if the security dialog box that appears when a document is opened has already appeared; otherwise false
{
// TODO
return E_NOTIMPL;
// This method is used by SharePoint e.g. after calling ViewDocument3. Needs to be implemented,
// otherwise IE would show download bar ("Do you want to open Foo.xls?"), as if opening with
// LibreOffice failed, even if actually it succeeded.
if (!pbResult)
return E_POINTER;
// Returning true makes SharePoint library to refresh only when focused next time; false makes
// it refresh instantly. The JavaScript code involved is this:
// var fRefreshOnNextFocus=stsOpen.PromptedOnLastOpen();
// if (fRefreshOnNextFocus)
// window.onfocus=RefreshOnNextFocus;
// else
// SetWindowRefreshOnFocus();
// It seems to be no reason to require immediate refresh, so just return true.
*pbResult = VARIANT_TRUE;
return S_OK;
}
// IOWSNewDocument3 methods
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment