summaryrefslogtreecommitdiff
path: root/shell/source
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2019-05-14 09:52:20 +0200
committerMike Kaganski <mike.kaganski@collabora.com>2019-05-14 10:46:44 +0200
commit430c352139b96c7f26b95d730dc19123869520ee (patch)
tree6eaf75dc7d97060b20e8027adadffc90f4142be0 /shell/source
parent19573d94074a3ce296bacf35a21242ff8b75cad4 (diff)
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: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell/source')
-rw-r--r--shell/source/win32/spsupp/COMOpenDocuments.cxx19
1 files changed, 16 insertions, 3 deletions
diff --git a/shell/source/win32/spsupp/COMOpenDocuments.cxx b/shell/source/win32/spsupp/COMOpenDocuments.cxx
index 68940e016147..319cd8c1751a 100644
--- a/shell/source/win32/spsupp/COMOpenDocuments.cxx
+++ b/shell/source/win32/spsupp/COMOpenDocuments.cxx
@@ -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