diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2017-04-10 22:21:57 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2017-04-11 09:46:58 +0200 |
commit | 88829fd914105a0837ee41d3f00f9178228c19cf (patch) | |
tree | 78ecc9781fd09cb18f3adfd890f6491947be1e0d /shell/inc | |
parent | 5fb961ad0b5938434777751c9d5c599f7400ab36 (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\to\spsupp.dll
to also [un]register SharePoint.OpenDocuments in addition to normal
LOSPSupport.OpenDocuments.
Change-Id: Icc284f9aa8f97ecf04594dd55b99bc1e3d20740d
Reviewed-on: https://gerrit.libreoffice.org/36389
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'shell/inc')
-rw-r--r-- | shell/inc/spsupp/COMOpenDocuments.hpp | 1 | ||||
-rw-r--r-- | shell/inc/spsupp/COMRefCounted.hpp | 7 | ||||
-rw-r--r-- | shell/inc/spsupp/registrar.hpp | 21 |
3 files changed, 21 insertions, 8 deletions
diff --git a/shell/inc/spsupp/COMOpenDocuments.hpp b/shell/inc/spsupp/COMOpenDocuments.hpp index a0f733e16f6d..e6c1f22c59e4 100644 --- a/shell/inc/spsupp/COMOpenDocuments.hpp +++ b/shell/inc/spsupp/COMOpenDocuments.hpp @@ -213,7 +213,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 230f6c8da517..9647db2fb0aa 100644 --- a/shell/inc/spsupp/COMRefCounted.hpp +++ b/shell/inc/spsupp/COMRefCounted.hpp @@ -11,6 +11,7 @@ #define INCLUDED_SHELL_INC_SPSUPP_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 ed41c4d04003..21f0c22d9688 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 |