summaryrefslogtreecommitdiff
path: root/shell/inc
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2017-04-10 22:21:57 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2017-04-11 15:38:40 +0200
commit8d60397310935d5d6d848314bd1faacb586d886b (patch)
tree2c79869903431232c174321bc4651793f2d41d60 /shell/inc
parentcdf8819e60c8c5c0302a73a9a9dbe586a8446123 (diff)
tdf#103058: allow optional registration for MS ProgIDs
To allow in-place replacement of OWSSUPP.dll, we need to be able to handle the same ProgIDs that it handles, namely: SharePoint.OpenDocuments and its versions. This allows to use the SharePoint integration capabilities of LO without the need to reconfigure SharePoint server's DOCICON.xml (the system would start the component with same name as MS Office uses). But this cannot be the default mode, since if MS Office is installed on the same system, we would hijack the registration, that could be undesirable. So, this commit adds an option to use regsvr32 [/u] /i:Substitute_OWSSUPP path o\spsupp.dll to also [un]register SharePoint.OpenDocuments in addition to normal LOSPSupport.OpenDocuments. Reviewed-on: https://gerrit.libreoffice.org/36389 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> (Cherry-picked from commit 88829fd914105a0837ee41d3f00f9178228c19cf) Change-Id: Icc284f9aa8f97ecf04594dd55b99bc1e3d20740d Reviewed-on: https://gerrit.libreoffice.org/36411 Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com> Tested-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell/inc')
-rw-r--r--shell/inc/spsupp/COMOpenDocuments.hpp1
-rw-r--r--shell/inc/spsupp/COMRefCounted.hpp7
-rw-r--r--shell/inc/spsupp/registrar.hpp21
3 files changed, 21 insertions, 8 deletions
diff --git a/shell/inc/spsupp/COMOpenDocuments.hpp b/shell/inc/spsupp/COMOpenDocuments.hpp
index 1b2a52999ead..35df90073628 100644
--- a/shell/inc/spsupp/COMOpenDocuments.hpp
+++ b/shell/inc/spsupp/COMOpenDocuments.hpp
@@ -206,7 +206,6 @@ private:
static long m_nObjCount;
static ITypeInfo* m_pTypeInfo;
- static wchar_t m_szLOPath[MAX_PATH];
COMObjectSafety m_aObjectSafety;
};
diff --git a/shell/inc/spsupp/COMRefCounted.hpp b/shell/inc/spsupp/COMRefCounted.hpp
index 1a60ed372300..d9b9ab87455d 100644
--- a/shell/inc/spsupp/COMRefCounted.hpp
+++ b/shell/inc/spsupp/COMRefCounted.hpp
@@ -11,6 +11,7 @@
#define _COMREFCOUNTED_HPP_
#include "objbase.h"
+#include "assert.h"
template <class Interface>
class COMRefCounted : public Interface
@@ -28,9 +29,13 @@ public:
ULONG STDMETHODCALLTYPE Release() override
{
+ assert(m_nRef > 0);
if (::InterlockedDecrement(&m_nRef) == 0)
+ {
delete this;
- return (m_nRef > 0) ? static_cast<ULONG>(m_nRef) : 0;
+ return 0;
+ }
+ return static_cast<ULONG>(m_nRef);
}
private:
diff --git a/shell/inc/spsupp/registrar.hpp b/shell/inc/spsupp/registrar.hpp
index 00b230e5c624..003fe59f24fa 100644
--- a/shell/inc/spsupp/registrar.hpp
+++ b/shell/inc/spsupp/registrar.hpp
@@ -12,14 +12,23 @@
#include "windows.h"
-namespace Registrar {
- HRESULT RegisterObject(REFIID riidCLSID,
- REFIID riidTypeLib,
+class Registrar {
+public:
+ explicit Registrar(REFIID riidCLSID);
+ HRESULT RegisterObject(REFIID riidTypeLib,
const wchar_t* sProgram,
const wchar_t* sComponent,
- const wchar_t* Path);
- HRESULT UnRegisterObject(REFIID riidCLSID, const wchar_t* LibId, const wchar_t* ClassId);
-}
+ int nVersion,
+ const wchar_t* Path,
+ bool bSetDefault);
+ HRESULT UnRegisterObject(const wchar_t* sProgram, const wchar_t* sComponent, int nVersion);
+ HRESULT RegisterProgID(const wchar_t* sProgram, const wchar_t* sComponent, int nVersion, bool bSetDefault);
+ HRESULT UnRegisterProgID(const wchar_t* sProgram, const wchar_t* sComponent, int nVersion);
+private:
+ static const size_t nGUIDlen = 40;
+ wchar_t m_sCLSID[nGUIDlen];
+ HRESULT m_ConstructionResult;
+};
#endif