diff options
Diffstat (limited to 'extensions/source')
36 files changed, 376 insertions, 335 deletions
diff --git a/extensions/source/abpilot/abpresid.hrc b/extensions/source/abpilot/abpresid.hrc index 9ca5ccdea925..6b7a7d467d2b 100644 --- a/extensions/source/abpilot/abpresid.hrc +++ b/extensions/source/abpilot/abpresid.hrc @@ -31,9 +31,7 @@ #ifndef EXTENSIONS_ABPRESID_HRC #define EXTENSIONS_ABPRESID_HRC -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "abpilot.hrc" //======================================================================== // basics diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index c28d28481884..50e9fb0326ae 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -31,12 +31,8 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" #include "abspilot.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif -#ifndef EXTENSIONS_ABPRESID_HRC +#include "abpilot.hrc" #include "abpresid.hrc" -#endif #include "componentmodule.hxx" #include <tools/debug.hxx> #include <svtools/localresaccess.hxx> diff --git a/extensions/source/activex/main/SOActiveX.cpp b/extensions/source/activex/main/SOActiveX.cpp index 9811cd3f7c19..52833ae17587 100644 --- a/extensions/source/activex/main/SOActiveX.cpp +++ b/extensions/source/activex/main/SOActiveX.cpp @@ -1025,6 +1025,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di ) hr = CreateFrameOldWay( mOffWin, di.prcBounds->right - di.prcBounds->left, di.prcBounds->bottom - di.prcBounds->top ); + if( !SUCCEEDED( hr ) ) { // if the frame can not be opened do not try any more @@ -1038,6 +1039,7 @@ HRESULT CSOActiveX::OnDrawAdvanced( ATL_DRAWINFO& di ) { hr = LoadURLToFrame(); mbLoad = FALSE; + if( !SUCCEEDED( hr ) ) { // if the document can not be opened do not try any more diff --git a/extensions/source/activex/main/SOComWindowPeer.h b/extensions/source/activex/main/SOComWindowPeer.h index 27c6f4037baa..55be8cafcbb0 100644 --- a/extensions/source/activex/main/SOComWindowPeer.h +++ b/extensions/source/activex/main/SOComWindowPeer.h @@ -55,7 +55,7 @@ DECLARE_REGISTRY_RESOURCEID(IDR_SOCOMWINDOWPEER) /* [in] */ short /*s*/, /* [retval][out] */ long __RPC_FAR *ret) { - *ret = (long) m_hwnd; + *ret = HandleToLong( m_hwnd ); return S_OK; } diff --git a/extensions/source/activex/main/makefile.mk b/extensions/source/activex/main/makefile.mk index 64dcbe34a2e1..6ecd7f909484 100644 --- a/extensions/source/activex/main/makefile.mk +++ b/extensions/source/activex/main/makefile.mk @@ -1,7 +1,7 @@ #************************************************************************* # # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# +# # Copyright 2008 by Sun Microsystems, Inc. # # OpenOffice.org - a multi-platform office productivity suite @@ -49,6 +49,10 @@ LIBTARGET=NO USE_DEFFILE=YES UWINAPILIB= +.IF "$(BUILD_X64)"!="" +USE_DEFFILE_X64=TRUE +.ENDIF + INCPRE+=$(foreach,i,$(ATL_INCLUDE) -I$(i)) \ -I$(MISC) \ @@ -58,9 +62,6 @@ INCPRE+=$(foreach,i,$(ATL_INCLUDE) -I$(i)) \ .IF "$(PRODUCT)"!="" RC+=-DPRODUCT .ENDIF -.IF "$(USE_STLP_DEBUG)"!="" -CDEFS+=-D_DEBUG -.ENDIF # "$(USE_STLP_DEBUG)"!="" RCFILES=\ $(TARGET).rc @@ -86,13 +87,9 @@ SHL1STDLIBS=\ .IF "$(COM)"!="GCC" .IF "$(CCNUMVER)" > "001300000000" -.IF "$(USE_STLP_DEBUG)" != "" - SHL1STDLIBS+= $(ATL_LIB)$/atlsd.lib -.ELSE SHL1STDLIBS+= $(ATL_LIB)$/atls.lib .ENDIF .ENDIF -.ENDIF # $(KERNEL32LIB) \ @@ -110,9 +107,51 @@ SHL1RES=$(RES)$/$(TARGET).res .ENDIF +.IF "$(BUILD_X64)"!="" +# -------------------- x64 ----------------------- + +CDEFS_X64+:=$(foreach,i,$(CDEFS) $(subst,-D_X86_=1, $i)) +LIBTARGET_X64=NO +USE_DEFFILE_X64=YES +UWINAPILIB_X64= + +SLOFILES_X64= \ + $(SLO_X64)$/so_activex.obj \ + $(SLO_X64)$/SOActiveX.obj \ + $(SLO_X64)$/SOComWindowPeer.obj \ + $(SLO_X64)$/SODispatchInterceptor.obj \ + $(SLO_X64)$/SOActionsApproval.obj \ + $(SLO_X64)$/StdAfx2.obj + +SHL1TARGET_X64=$(TARGET) + +SHL1STDLIBS_X64+=\ + $(UUIDLIB_X64) \ + $(ADVAPI32LIB_X64) \ + $(OLE32LIB_X64) \ + $(OLEAUT32LIB_X64) \ + $(GDI32LIB_X64) \ + $(URLMONLIB_X64) \ + $(SHLWAPILIB_X64) \ + $(KERNEL32LIB_X64) \ + $(USER32LIB_X64) \ + $(MSVCRT_X64) \ + $(MSVCPRT_X64) \ + $(OLDNAMESLIB_X64) + +SHL1OBJS_X64=$(SLOFILES_X64) +SHL1DEF_X64=$(TARGET).def + +SHL1STDLIBS_X64+= $(ATL_LIB)$/amd64$/atls.lib + +.ENDIF # "$(BUILD_X64)"!="" + # --- Targets ---------------------------------- +.INCLUDE : set_wntx64.mk +VERSIONOBJ_X64= .INCLUDE : target.mk +.INCLUDE : tg_wntx64.mk $(MISC)$/envsettings.h : makefile.mk -$(RM) $@ diff --git a/extensions/source/activex/main/so_activex.cpp b/extensions/source/activex/main/so_activex.cpp index 057406a0f1f2..7db1c67e1585 100644 --- a/extensions/source/activex/main/so_activex.cpp +++ b/extensions/source/activex/main/so_activex.cpp @@ -24,6 +24,30 @@ BEGIN_OBJECT_MAP(ObjectMap) OBJECT_ENTRY(CLSID_SOActiveX, CSOActiveX) END_OBJECT_MAP() + +#define X64_LIB_NAME "so_activex_x64.dll" +#define X32_LIB_NAME "so_activex.dll" + +// 06.11.2009 tkr: to provide windows xp as build systems for mingw we need to define KEY_WOW64_64KEY +// in mingw 3.13 KEY_WOW64_64KEY isn't available < Win2003 systems. +// Also defined in setup_native\source\win32\customactions\reg64\reg64.cxx,source\win32\customactions\shellextensions\shellextensions.cxx and +// extensions\source\activex\main\so_activex.cpp +#ifndef KEY_WOW64_64KEY + #define KEY_WOW64_64KEY (0x0100) +#endif + +const REGSAM n64KeyAccess = KEY_ALL_ACCESS | KEY_WOW64_64KEY; +const REGSAM n32KeyAccess = KEY_ALL_ACCESS; + +#ifdef _AMD64_ +const BOOL bX64 = TRUE; +#else +const BOOL bX64 = FALSE; +#endif + +// 10.11.2009 tkr: MinGW doesn't know anything about RegDeleteKeyExA if WINVER < 0x0502. +WINADVAPI LONG WINAPI RegDeleteKeyExA(HKEY,LPCSTR,REGSAM,DWORD); + ///////////////////////////////////////////////////////////////////////////// // DLL Entry Point @@ -131,20 +155,21 @@ const char* aLocalPrefix = "Software\\Classes\\"; BOOL createKey( HKEY hkey, const char* aKeyToCreate, + REGSAM nKeyAccess, const char* aValue = NULL, const char* aChildName = NULL, const char* aChildValue = NULL ) { HKEY hkey1; - return ( ERROR_SUCCESS == RegCreateKey( hkey, aKeyToCreate, &hkey1 ) - && ( !aValue || ERROR_SUCCESS == RegSetValueEx( hkey1, + return ( ERROR_SUCCESS == RegCreateKeyExA( hkey, aKeyToCreate, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && ( !aValue || ERROR_SUCCESS == RegSetValueExA( hkey1, "", 0, REG_SZ, (const BYTE*)aValue, strlen( aValue ) ) ) - && ( !aChildName || ERROR_SUCCESS == RegSetValueEx( hkey1, + && ( !aChildName || ERROR_SUCCESS == RegSetValueExA( hkey1, aChildName, 0, REG_SZ, @@ -154,8 +179,8 @@ BOOL createKey( HKEY hkey, } -STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ); -STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiveXPath ) +STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ); +STDAPI DllRegisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess, const char* pProgramPath, const char* pLibName ) { BOOL aResult = FALSE; @@ -164,89 +189,86 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv HKEY hkey2 = NULL; HKEY hkey3 = NULL; HKEY hkey4 = NULL; - char aSubKey[513]; + char aSubKey[513]; int ind; const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; - char pActiveXPath101[1024]; - char pPrCatalogPath[1019]; + char pActiveXPath[1124]; + char pActiveXPath101[1124]; // In case SO7 is installed for this user he can have local registry entries that will prevent him from // using SO8 ActiveX control. The fix is just to clean up the local entries related to ActiveX control. // Unfortunately it can be done only for the user who installs the office. if ( bForAllUsers ) - DllUnregisterServerNative( nMode, sal_False ); + DllUnregisterServerNative( nMode, sal_False, sal_False ); #ifdef MY_DEBUG - MessageBoxA(NULL, pActiveXPath, "Library Path, ( from library )", MB_OK | MB_ICONINFORMATION); + MessageBoxA(NULL, pProgramPath, "Library Path, ( from library )", MB_OK | MB_ICONINFORMATION); #endif - if ( pActiveXPath ) + if ( pProgramPath && strlen( pProgramPath ) < 1024 ) { - sprintf( pActiveXPath101, "%s, 101", pActiveXPath ); - - int nPrCatLength = strlen( pActiveXPath ) - sizeof( "so_activex.dll" ) + 1; - strncpy( pPrCatalogPath, pActiveXPath, nPrCatLength ); - pPrCatalogPath[ nPrCatLength ] = 0; + sprintf( pActiveXPath, "%s\\%s", pProgramPath, pLibName ); + sprintf( pActiveXPath101, "%s\\%s, 101", pProgramPath, pLibName ); { - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); aResult = - ( ERROR_SUCCESS == RegCreateKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey ) - && ERROR_SUCCESS == RegSetValueEx( hkey, "", 0, REG_SZ, (const BYTE*)"SOActiveX Class", 17 ) - && createKey( hkey, "Control" ) - && createKey( hkey, "EnableFullPage" ) - && createKey( hkey, "InprocServer32", pActiveXPath, "ThreadingModel", "Apartment" ) - && createKey( hkey, "MiscStatus", "0" ) - && createKey( hkey, "MiscStatus\\1", "131473" ) - && createKey( hkey, "ProgID", "so_activex.SOActiveX.1" ) - && createKey( hkey, "Programmable" ) - && createKey( hkey, "ToolboxBitmap32", pActiveXPath101 ) - && createKey( hkey, "TypeLib", aTypeLib ) - && createKey( hkey, "Version", "1.0" ) - && createKey( hkey, "VersionIndependentProgID", "so_activex.SOActiveX" ) + ( ERROR_SUCCESS == RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey , NULL ) + && ERROR_SUCCESS == RegSetValueExA( hkey, "", 0, REG_SZ, (const BYTE*)"SOActiveX Class", 17 ) + && createKey( hkey, "Control", nKeyAccess ) + && createKey( hkey, "EnableFullPage", nKeyAccess ) + && createKey( hkey, "InprocServer32", nKeyAccess, pActiveXPath, "ThreadingModel", "Apartment" ) + && createKey( hkey, "MiscStatus", nKeyAccess, "0" ) + && createKey( hkey, "MiscStatus\\1", nKeyAccess, "131473" ) + && createKey( hkey, "ProgID", nKeyAccess, "so_activex.SOActiveX.1" ) + && createKey( hkey, "Programmable", nKeyAccess ) + && createKey( hkey, "ToolboxBitmap32", nKeyAccess, pActiveXPath101 ) + && createKey( hkey, "TypeLib", nKeyAccess, aTypeLib ) + && createKey( hkey, "Version", nKeyAccess, "1.0" ) + && createKey( hkey, "VersionIndependentProgID", nKeyAccess, "so_activex.SOActiveX" ) && ERROR_SUCCESS == RegCloseKey( hkey ) - && ERROR_SUCCESS == RegCreateKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aPrefix, &hkey ) - && createKey( hkey, "so_activex.SOActiveX", "SOActiveX Class" ) - && ERROR_SUCCESS == RegCreateKey( hkey, "so_activex.SOActiveX", &hkey1 ) - && createKey( hkey1, "CLSID", aClassID ) - && createKey( hkey1, "CurVer", "so_activex.SOActiveX.1" ) + && ERROR_SUCCESS == RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aPrefix, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey , NULL ) + && createKey( hkey, "so_activex.SOActiveX", nKeyAccess, "SOActiveX Class" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "so_activex.SOActiveX", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && createKey( hkey1, "CLSID", nKeyAccess, aClassID ) + && createKey( hkey1, "CurVer", nKeyAccess, "so_activex.SOActiveX.1" ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) - && createKey( hkey, "so_activex.SOActiveX.1", "SOActiveX Class" ) - && ERROR_SUCCESS == RegCreateKey( hkey, "so_activex.SOActiveX.1", &hkey1 ) - && createKey( hkey1, "CLSID", aClassID ) + && createKey( hkey, "so_activex.SOActiveX.1", nKeyAccess, "SOActiveX Class" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "so_activex.SOActiveX.1", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && createKey( hkey1, "CLSID", nKeyAccess, aClassID ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) - && ERROR_SUCCESS == RegCreateKey( hkey, "TypeLib", &hkey1 ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aTypeLib, &hkey2 ) - && createKey( hkey2, "1.0", "wrap_activex 1.0 Type Library" ) - && ERROR_SUCCESS == RegCreateKey( hkey2, "1.0", &hkey3 ) - && ERROR_SUCCESS == RegCreateKey( hkey3, "0", &hkey4 ) - && createKey( hkey4, "win32", pActiveXPath ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "TypeLib", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aTypeLib, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "1.0", nKeyAccess, "wrap_activex 1.0 Type Library" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey2, "1.0", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey3 , NULL ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey3, "0", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey4 , NULL ) + && createKey( hkey4, "win32", nKeyAccess, pActiveXPath ) && ERROR_SUCCESS == RegCloseKey( hkey4 ) - && createKey( hkey3, "FLAGS", "0" ) - && createKey( hkey3, "HELPDIR", pPrCatalogPath ) + && createKey( hkey3, "FLAGS", nKeyAccess, "0" ) + && createKey( hkey3, "HELPDIR", nKeyAccess, pProgramPath ) && ERROR_SUCCESS == RegCloseKey( hkey3 ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) - && ERROR_SUCCESS == RegCreateKey( hkey, "Interface", &hkey1 ) - && createKey( hkey1, aInterIDWinPeer, "ISOComWindowPeer" ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDWinPeer, &hkey2 ) - && createKey( hkey2, "ProxyStubClsid", aProxyStubWinPeer ) - && createKey( hkey2, "ProxyStubClsid32", aProxyStubWinPeer ) - && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey, "Interface", 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) + && createKey( hkey1, aInterIDWinPeer, nKeyAccess, "ISOComWindowPeer" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aInterIDWinPeer, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "ProxyStubClsid", nKeyAccess, aProxyStubWinPeer ) + && createKey( hkey2, "ProxyStubClsid32", nKeyAccess, aProxyStubWinPeer ) + && createKey( hkey2, "TypeLib", nKeyAccess, aTypeLib, "Version", "1.0" ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) - && createKey( hkey1, aInterIDActApprove, "ISOActionsApproval" ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDActApprove, &hkey2 ) - && createKey( hkey2, "ProxyStubClsid", aProxyStubActApprove ) - && createKey( hkey2, "ProxyStubClsid32", aProxyStubActApprove ) - && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" ) + && createKey( hkey1, aInterIDActApprove, nKeyAccess, "ISOActionsApproval" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aInterIDActApprove, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "ProxyStubClsid", nKeyAccess, aProxyStubActApprove ) + && createKey( hkey2, "ProxyStubClsid32", nKeyAccess, aProxyStubActApprove ) + && createKey( hkey2, "TypeLib", nKeyAccess, aTypeLib, "Version", "1.0" ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) - && createKey( hkey1, aInterIDDispInt, "ISODispatchInterceptor" ) - && ERROR_SUCCESS == RegCreateKey( hkey1, aInterIDDispInt, &hkey2 ) - && createKey( hkey2, "ProxyStubClsid", aProxyStubDispInt ) - && createKey( hkey2, "ProxyStubClsid32", aProxyStubDispInt ) - && createKey( hkey2, "TypeLib", aTypeLib, "Version", "1.0" ) + && createKey( hkey1, aInterIDDispInt, nKeyAccess, "ISODispatchInterceptor" ) + && ERROR_SUCCESS == RegCreateKeyExA( hkey1, aInterIDDispInt, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey2 , NULL ) + && createKey( hkey2, "ProxyStubClsid", nKeyAccess, aProxyStubDispInt ) + && createKey( hkey2, "ProxyStubClsid32", nKeyAccess, aProxyStubDispInt ) + && createKey( hkey2, "TypeLib", nKeyAccess, aTypeLib, "Version", "1.0" ) && ERROR_SUCCESS == RegCloseKey( hkey2 ) && ERROR_SUCCESS == RegCloseKey( hkey1 ) && ERROR_SUCCESS == RegCloseKey( hkey ) ); @@ -259,11 +281,11 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv { if( nForModes[ind] & nMode ) { - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) -// || ERROR_SUCCESS != RegSetValueEx(hkey, "Extension", 0, REG_SZ, -// (const BYTE *)aFileExt[ind], strlen( aFileExt[ind] ) ) - || ERROR_SUCCESS != RegSetValueEx(hkey, "CLSID", 0, REG_SZ, + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) +// || ERROR_SUCCESS != RegSetValueExA(hkey, "Extension", 0, REG_SZ, +// (const BYTE *)aFileExt[ind], strlen( aFileExt[ind] ) ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "CLSID", 0, REG_SZ, (const BYTE *)aClassID, strlen(aClassID)) ) aResult = FALSE; @@ -271,9 +293,9 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv RegCloseKey(hkey),hkey= NULL; /* - wsprintf( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) - || ERROR_SUCCESS != RegSetValueEx(hkey, "Content Type", 0, REG_SZ, + wsprintfA( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "Content Type", 0, REG_SZ, (const BYTE *)aMimeType[ind], strlen( aMimeType[ind] ) ) ) aResult = FALSE; if( hkey ) @@ -282,13 +304,13 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv } } - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); - if ( aResult && ERROR_SUCCESS == RegOpenKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + if ( aResult && ERROR_SUCCESS == RegOpenKeyExA(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, nKeyAccess, &hkey) ) { for( ind = 0; ind < SUPPORTED_EXT_NUM; ind++ ) { - wsprintf( aSubKey, "EnableFullPage\\%s", aFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey( hkey, aSubKey, &hkey1 ) ) + wsprintfA( aSubKey, "EnableFullPage\\%s", aFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( hkey, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) ) aResult = FALSE; if ( hkey1 ) @@ -304,30 +326,62 @@ STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, const char* pActiv return aResult; } +STDAPI DllRegisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit, const char* pProgramPath ) +{ + HRESULT hr = S_OK; + if ( bFor64Bit ) + hr = DllRegisterServerNative_Impl( nMode, bForAllUsers, n64KeyAccess, pProgramPath, X64_LIB_NAME ); + + if ( SUCCEEDED( hr ) ) + hr = DllRegisterServerNative_Impl( nMode, bForAllUsers, n32KeyAccess, pProgramPath, X32_LIB_NAME ); + + return hr; +} + + ///////////////////////////////////////////////////////////////////////////// // DllUnregisterServer - Removes entries from the system registry +HRESULT DeleteKeyTree( HKEY hkey, const char* pPath, REGSAM nKeyAccess ) +{ + HKEY hkey1 = NULL; + + char pSubKeyName[256]; + // first delete the subkeys + while( ERROR_SUCCESS == RegOpenKeyExA( hkey, pPath, 0, nKeyAccess, &hkey1) + && ERROR_SUCCESS == RegEnumKeyA( hkey1, 0, pSubKeyName, 256 ) + && ERROR_SUCCESS == DeleteKeyTree( hkey1, pSubKeyName, nKeyAccess ) ) + { + RegCloseKey( hkey1 ),hkey1= NULL; + } -STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ) + if ( hkey1 ) + RegCloseKey( hkey1 ),hkey1= NULL; + + // delete the key itself + return RegDeleteKeyExA( hkey, pPath, nKeyAccess & ( KEY_WOW64_64KEY | KEY_WOW64_32KEY ), 0 ); +} + +STDAPI DllUnregisterServerNative_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) { HKEY hkey = NULL; BOOL fErr = FALSE; - char aSubKey[513]; - const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; + char aSubKey[513]; + const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; - for( int ind = 0; ind < SUPPORTED_EXT_NUM; ind++ ) + for( int ind = 0; ind < SUPPORTED_EXT_NUM; ind++ ) { if( nForModes[ind] & nMode ) { DWORD nSubKeys = 0, nValues = 0; - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { - if ( ERROR_SUCCESS != RegDeleteValue( hkey, "CLSID" ) ) + if ( ERROR_SUCCESS != RegDeleteValue( hkey, "CLSID" ) ) fErr = TRUE; - if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, NULL, NULL, NULL, + if ( ERROR_SUCCESS != RegQueryInfoKey( hkey, NULL, NULL, NULL, &nSubKeys, NULL, NULL, &nValues, NULL, NULL, NULL, NULL ) ) { @@ -338,12 +392,12 @@ STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } - wsprintf( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%s%s", aPrefix, aFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { @@ -358,43 +412,53 @@ STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } } } - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%sso_activex.SOActiveX", aPrefix ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%sso_activex.SOActiveX", aPrefix ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%sso_activex.SOActiveX.1", aPrefix ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%sso_activex.SOActiveX.1", aPrefix ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\TypeLib\\%s", aPrefix, aTypeLib ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\TypeLib\\%s", aPrefix, aTypeLib ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDWinPeer ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDWinPeer ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDDispInt ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDDispInt ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; - wsprintf( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDActApprove ); - if( ERROR_SUCCESS != SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ) ) + wsprintfA( aSubKey, "%s\\Interface\\%s", aPrefix, aInterIDActApprove ); + if( ERROR_SUCCESS != DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ) ) fErr = TRUE; return !fErr; } +STDAPI DllUnregisterServerNative( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ) +{ + HRESULT hr = DllUnregisterServerNative_Impl( nMode, bForAllUsers, n32KeyAccess ); + if ( SUCCEEDED( hr ) && bFor64Bit ) + hr = DllUnregisterServerNative_Impl( nMode, bForAllUsers, n64KeyAccess ); + + return hr; +} + + ///////////////////////////////////////////////////////////////////////////// // DllRegisterServerDoc - Adds entries to the system registry @@ -409,41 +473,41 @@ const char* aMSMimeType[] = { "application/msword", "application/mspowerpoint" }; const int nForMSModes[] = { 1, 1, 2, 2, 4, 4, 4 }; -STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ); -STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers ) +STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ); +STDAPI DllRegisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) { BOOL aResult = TRUE; HKEY hkey = NULL; HKEY hkey1 = NULL; - char aSubKey[513]; + char aSubKey[513]; int ind; - const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; + const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; // In case SO7 is installed for this user he can have local registry entries that will prevent him from // using SO8 ActiveX control. The fix is just to clean up the local entries related to ActiveX control. // Unfortunately it can be done only for the user who installs the office. if ( bForAllUsers ) - DllUnregisterServerDoc( nMode, sal_False ); + DllUnregisterServerDoc( nMode, sal_False, sal_False ); for( ind = 0; ind < SUPPORTED_MSEXT_NUM && aResult; ind++ ) { if( nForMSModes[ind] & nMode ) { - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) - || ERROR_SUCCESS != RegSetValueEx(hkey, "Extension", 0, REG_SZ, + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "Extension", 0, REG_SZ, (const BYTE *)aMSFileExt[ind], strlen( aMSFileExt[ind] ) ) - || ERROR_SUCCESS != RegSetValueEx(hkey, "CLSID", 0, REG_SZ, + || ERROR_SUCCESS != RegSetValueExA(hkey, "CLSID", 0, REG_SZ, (const BYTE *)aClassID, strlen(aClassID)) ) aResult = FALSE; if( hkey ) RegCloseKey(hkey),hkey= NULL; - wsprintf( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) - || ERROR_SUCCESS != RegSetValueEx(hkey, "Content Type", 0, REG_SZ, + wsprintfA( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) + || ERROR_SUCCESS != RegSetValueExA(hkey, "Content Type", 0, REG_SZ, (const BYTE *)aMSMimeType[ind], strlen( aMSMimeType[ind] ) ) ) aResult = FALSE; @@ -452,16 +516,16 @@ STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers ) } } - wsprintf( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); - if ( aResult && ERROR_SUCCESS == RegCreateKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey ) - && createKey( hkey, "EnableFullPage" ) ) + wsprintfA( aSubKey, "%sCLSID\\%s", aPrefix, aClassID ); + if ( aResult && ERROR_SUCCESS == RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey , NULL ) + && createKey( hkey, "EnableFullPage", nKeyAccess ) ) { for( ind = 0; ind < SUPPORTED_MSEXT_NUM; ind++ ) { if( nForMSModes[ind] & nMode ) { - wsprintf( aSubKey, "EnableFullPage\\%s", aMSFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey( hkey, aSubKey, &hkey1 ) ) + wsprintfA( aSubKey, "EnableFullPage\\%s", aMSFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( hkey, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey1 , NULL ) ) aResult = FALSE; if ( hkey1 ) @@ -478,17 +542,28 @@ STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers ) return aResult; } +STDAPI DllRegisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ) +{ + HRESULT hr = S_OK; + if ( bFor64Bit ) + hr = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n64KeyAccess ); + + if ( SUCCEEDED( hr ) ) + hr = DllRegisterServerDoc_Impl( nMode, bForAllUsers, n32KeyAccess ); + + return hr; +} ///////////////////////////////////////////////////////////////////////////// // DllUnregisterServerDoc - Removes entries from the system registry -STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) +STDAPI DllUnregisterServerDoc_Impl( int nMode, BOOL bForAllUsers, REGSAM nKeyAccess ) { HKEY hkey = NULL; BOOL fErr = FALSE; - char aSubKey[513]; - const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; + char aSubKey[513]; + const char* aPrefix = aLocalPrefix; // bForAllUsers ? "" : aLocalPrefix; for( int ind = 0; ind < SUPPORTED_MSEXT_NUM; ind++ ) { @@ -496,8 +571,8 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) { DWORD nSubKeys = 0, nValues = 0; - wsprintf( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%sMIME\\DataBase\\Content Type\\%s", aPrefix, aMSMimeType[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { @@ -518,12 +593,12 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } - wsprintf( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); - if ( ERROR_SUCCESS != RegCreateKey(bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, &hkey) ) + wsprintfA( aSubKey, "%s%s", aPrefix, aMSFileExt[ind] ); + if ( ERROR_SUCCESS != RegCreateKeyExA( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, 0, NULL, REG_OPTION_NON_VOLATILE, nKeyAccess, NULL, &hkey, NULL ) ) fErr = TRUE; else { @@ -541,7 +616,7 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) { RegCloseKey( hkey ), hkey = NULL; if ( !nSubKeys && !nValues ) - SHDeleteKey( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey ); + DeleteKeyTree( bForAllUsers ? HKEY_LOCAL_MACHINE : HKEY_CURRENT_USER, aSubKey, nKeyAccess ); } } } @@ -550,33 +625,59 @@ STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers ) return !fErr; } +STDAPI DllUnregisterServerDoc( int nMode, BOOL bForAllUsers, BOOL bFor64Bit ) +{ + HRESULT hr = S_OK; + if ( bFor64Bit ) + hr = DllUnregisterServerDoc_Impl( nMode, bForAllUsers, n64KeyAccess ); + + if ( SUCCEEDED( hr ) ) + hr = DllUnregisterServerDoc_Impl( nMode, bForAllUsers, n32KeyAccess ); + + return hr; +} + +///////////////////////////////////////////////////////////////////////////// +// DllRegisterServer - regsvr32 entry point + STDAPI DllRegisterServer( void ) { - char pActiveXPath[1019]; + char pProgramPath[1024]; HRESULT aResult = E_FAIL; - HMODULE aCurModule = GetModuleHandleA( "so_activex.dll" ); - if( aCurModule && GetModuleFileNameA( aCurModule, pActiveXPath, 1019 ) ) + HMODULE aCurModule = GetModuleHandleA( bX64 ? X64_LIB_NAME : X32_LIB_NAME ); + DWORD nLen = 0; + DWORD nLibNameLen = strlen( bX64 ? X64_LIB_NAME : X32_LIB_NAME ); + + if( aCurModule ) { - aResult = DllRegisterServerNative( 31, TRUE, pActiveXPath ); - if( SUCCEEDED( aResult ) ) - aResult = DllRegisterServerDoc( 31, TRUE ); - else + nLen = GetModuleFileNameA( aCurModule, pProgramPath, 1024 ); + if ( nLen && nLen > nLibNameLen + 1 ) { - aResult = DllRegisterServerNative( 31, FALSE, pActiveXPath ); + pProgramPath[ nLen - nLibNameLen - 1 ] = 0; + aResult = DllRegisterServerNative( 31, TRUE, bX64, pProgramPath ); if( SUCCEEDED( aResult ) ) - aResult = DllRegisterServerDoc( 31, FALSE ); + aResult = DllRegisterServerDoc( 31, TRUE, bX64 ); + else + { + aResult = DllRegisterServerNative( 31, FALSE, bX64, pProgramPath ); + if( SUCCEEDED( aResult ) ) + aResult = DllRegisterServerDoc( 31, FALSE, bX64 ); + } } } return aResult; } +///////////////////////////////////////////////////////////////////////////// +// DllUnregisterServer - regsvr32 entry point + STDAPI DllUnregisterServer( void ) { - DllUnregisterServerDoc( 63, FALSE ); - DllUnregisterServerNative( 63, FALSE ); - DllUnregisterServerDoc( 63, TRUE ); - return DllUnregisterServerNative( 63, TRUE ); + DllUnregisterServerDoc( 63, FALSE, bX64 ); + DllUnregisterServerNative( 63, FALSE, bX64 ); + DllUnregisterServerDoc( 63, TRUE, bX64 ); + return DllUnregisterServerNative( 63, TRUE, bX64 ); } diff --git a/extensions/source/bibliography/bib.hrc b/extensions/source/bibliography/bib.hrc index fad6da48c020..c30bd0846875 100644 --- a/extensions/source/bibliography/bib.hrc +++ b/extensions/source/bibliography/bib.hrc @@ -30,7 +30,7 @@ #ifndef BIB_HRC #define BIB_HRC -#include <extensio.hrc> +#include "bibliography.hrc" #ifndef RID_BIB_START #define RID_BIB_START RID_EXTENSIONS_START diff --git a/extensions/source/bibliography/bibbeam.cxx b/extensions/source/bibliography/bibbeam.cxx index 77d9858f028d..464a45ca3e76 100644 --- a/extensions/source/bibliography/bibbeam.cxx +++ b/extensions/source/bibliography/bibbeam.cxx @@ -32,17 +32,13 @@ #include "precompiled_extensions.hxx" #include <osl/mutex.hxx> #include <tools/urlobj.hxx> -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <comphelper/processfactory.hxx> #include <com/sun/star/awt/PosSize.hpp> #include <com/sun/star/frame/XDispatch.hpp> #include <com/sun/star/util/XURLTransformer.hpp> -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "bibliography.hrc" #include <vcl/lstbox.hxx> #include <vcl/edit.hxx> #include <tools/debug.hxx> diff --git a/extensions/source/bibliography/datman.cxx b/extensions/source/bibliography/datman.cxx index 5a901447865f..1d322a9b383f 100644 --- a/extensions/source/bibliography/datman.cxx +++ b/extensions/source/bibliography/datman.cxx @@ -80,20 +80,14 @@ #include "bibview.hxx" // #100312# --------- #include "bibbeam.hxx" -#ifndef _BIB_FMPROP_HRC #include "bibprop.hrc" -#endif #include "toolbar.hxx" #include "toolbar.hrc" #include "bibconfig.hxx" #include "bibbeam.hxx" -#ifndef BIB_HRC #include "bib.hrc" -#endif #include "datman.hrc" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "bibliography.hrc" #include <connectivity/dbtools.hxx> using namespace ::com::sun::star; diff --git a/extensions/source/bibliography/framectr.cxx b/extensions/source/bibliography/framectr.cxx index 6f9826153fc8..5dc410db4c59 100644 --- a/extensions/source/bibliography/framectr.cxx +++ b/extensions/source/bibliography/framectr.cxx @@ -42,18 +42,12 @@ #include "framectr.hxx" #include "datman.hxx" #include "bibresid.hxx" -#ifndef BIB_HRC #include "bib.hrc" -#endif -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include "bibconfig.hxx" #include <cppuhelper/implbase1.hxx> // helper for implementations #include <vcl/svapp.hxx> -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include <extensio.hrc> -#endif +#include "bibliography.hrc" #include <comphelper/processfactory.hxx> #include <com/sun/star/form/XConfirmDeleteListener.hpp> #include <com/sun/star/form/XFormController.hpp> diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx index 293c3af7b186..62efe9127641 100644 --- a/extensions/source/bibliography/general.cxx +++ b/extensions/source/bibliography/general.cxx @@ -40,28 +40,18 @@ #include <com/sun/star/sdbcx/XColumnsSupplier.hpp> #include <com/sun/star/form/ListSourceType.hpp> #include <com/sun/star/awt/XWindow.hpp> -#ifndef _TOOLKIT_UNOHLP_HXX #include <toolkit/helper/vclunohelper.hxx> -#endif #include <cppuhelper/implbase1.hxx> // helper for implementations #include "general.hxx" #include "sections.hrc" #include "bibresid.hxx" #include "datman.hxx" #include "bibconfig.hxx" -#ifndef _BIB_FMPROP_HRC #include "bibprop.hrc" -#endif -#ifndef BIB_HRC #include "bib.hrc" -#endif #include "bibmod.hxx" -#ifndef BIBTOOLS_HXX #include "bibtools.hxx" -#endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "bibliography.hrc" #include <tools/debug.hxx> #include <vcl/mnemonic.hxx> #include <vcl/svapp.hxx> @@ -69,9 +59,7 @@ #include <vcl/mnemonic.hxx> #include <algorithm> #include <functional> -#ifndef _VECTOR_ #include <vector> -#endif using namespace ::com::sun::star; using namespace ::com::sun::star::uno; diff --git a/extensions/source/bibliography/hidother.src b/extensions/source/bibliography/hidother.src index b0dbac415a31..82111c538094 100644 --- a/extensions/source/bibliography/hidother.src +++ b/extensions/source/bibliography/hidother.src @@ -27,8 +27,8 @@ * for a copy of the LGPLv3 License. * ************************************************************************/ -#include "..\..\inc\extensio.hrc" // HID_FUNC_XXX -//#include "hidother.hrc" + +#include "bibliography.hrc" hidspecial HID_BIB_IDENTIFIER_POS { HelpID = HID_BIB_IDENTIFIER_POS ; }; hidspecial HID_BIB_AUTHORITYTYPE_POS { HelpID = HID_BIB_AUTHORITYTYPE_POS ; }; diff --git a/extensions/source/bibliography/menu.src b/extensions/source/bibliography/menu.src index d06cce2e4361..468fbf5837db 100644 --- a/extensions/source/bibliography/menu.src +++ b/extensions/source/bibliography/menu.src @@ -36,7 +36,7 @@ #ifndef _GLOBALACC_SRC #include <svx/globlac.hrc> #endif -#include <extensio.hrc> +#include "bibliography.hrc" #include "bib.hrc" diff --git a/extensions/source/bibliography/sections.src b/extensions/source/bibliography/sections.src index b6fd032d5f4e..ea9d5f3412e3 100644 --- a/extensions/source/bibliography/sections.src +++ b/extensions/source/bibliography/sections.src @@ -30,7 +30,7 @@ //#pragma CHARSET_ANSI #include "sections.hrc" -#include "extensio.hrc" +#include "bibliography.hrc" #define FT_POS 12 #define FTSIZE_LEFT 88 diff --git a/extensions/source/bibliography/toolbar.src b/extensions/source/bibliography/toolbar.src index 49154b69a3c0..a291a11e25bd 100644 --- a/extensions/source/bibliography/toolbar.src +++ b/extensions/source/bibliography/toolbar.src @@ -28,7 +28,7 @@ * ************************************************************************/ #include <svx/svxids.hrc> -#include "extensio.hrc" +#include "bibliography.hrc" #include "toolbar.hrc" #define MASKCOLOR MaskColor = Color { Red = 0xFFFF; Green = 0x0000; Blue = 0xFFFF; }; diff --git a/extensions/source/dbpilots/dbpresid.hrc b/extensions/source/dbpilots/dbpresid.hrc index ab2efbe89921..c54463704f44 100644 --- a/extensions/source/dbpilots/dbpresid.hrc +++ b/extensions/source/dbpilots/dbpresid.hrc @@ -31,9 +31,7 @@ #ifndef _EXTENSIONS_DBP_DBPRESID_HRC_ #define _EXTENSIONS_DBP_DBPRESID_HRC_ -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" //======================================================================== // basics diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx index ad09e2d7122c..c3d50e6c112d 100644 --- a/extensions/source/dbpilots/gridwizard.cxx +++ b/extensions/source/dbpilots/gridwizard.cxx @@ -39,9 +39,7 @@ #include <com/sun/star/container/XNameContainer.hpp> #include <tools/debug.hxx> #include "dbptools.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" #define GW_STATE_DATASOURCE_SELECTION 0 #define GW_STATE_FIELDSELECTION 1 diff --git a/extensions/source/dbpilots/groupboxwiz.cxx b/extensions/source/dbpilots/groupboxwiz.cxx index 8b82db094b31..2f6c87783811 100644 --- a/extensions/source/dbpilots/groupboxwiz.cxx +++ b/extensions/source/dbpilots/groupboxwiz.cxx @@ -36,9 +36,7 @@ #include <vcl/svapp.hxx> #include <vcl/msgbox.hxx> #include "optiongrouplayouter.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" //#define GBW_STATE_DATASELECTION 0 diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index f86b284b72fd..8afc76a0beea 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -40,9 +40,7 @@ #include <tools/debug.hxx> #include <vcl/msgbox.hxx> #include <connectivity/dbtools.hxx> -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "dbpilots.hrc" #include <comphelper/extract.hxx> //......................................................................... diff --git a/extensions/source/propctrlr/browserview.cxx b/extensions/source/propctrlr/browserview.cxx index 9e9780574328..f73d4f10d77a 100644 --- a/extensions/source/propctrlr/browserview.cxx +++ b/extensions/source/propctrlr/browserview.cxx @@ -32,9 +32,7 @@ #include "precompiled_extensions.hxx" #include "browserview.hxx" #include "propertyeditor.hxx" -#ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" -#endif +#include "propctrlr.hrc" #include <tools/debug.hxx> #include <memory> diff --git a/extensions/source/propctrlr/composeduiupdate.cxx b/extensions/source/propctrlr/composeduiupdate.cxx index ac5802129e28..cb4e02e6fb90 100644 --- a/extensions/source/propctrlr/composeduiupdate.cxx +++ b/extensions/source/propctrlr/composeduiupdate.cxx @@ -779,13 +779,6 @@ namespace pcr ); } - //---------------------------------------------------------------- - void SAL_CALL ComposedPropertyUIUpdate::fire() - { - impl_checkDisposed(); - impl_fireAll_throw(); - } - //-------------------------------------------------------------------- void ComposedPropertyUIUpdate::impl_fireAll_throw() { diff --git a/extensions/source/propctrlr/composeduiupdate.hxx b/extensions/source/propctrlr/composeduiupdate.hxx index 8f5ead84ecf1..ddccb8475040 100644 --- a/extensions/source/propctrlr/composeduiupdate.hxx +++ b/extensions/source/propctrlr/composeduiupdate.hxx @@ -119,26 +119,6 @@ namespace pcr ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XObjectInspectorUI > getUIForPropertyHandler( const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyHandler >& _rxHandler ); - /** fires the collected UI changes to our delegator UI - - All operations for any elements are forwarded: - <ul><li>If an element has been hidden at least once, it's also hidden at the delegator UI.</li> - <li>If an element has been shown at least once, and never been hidden, it's also - shown at the delegator UI.</li> - <li>If an element has never been shown or hidden, it's also not touched at the delegator UI.</li> - <li>The same holds if you replace "hidden" in the last three items with "disabled", - and "shown" with "enabled".</li> - <li>If an element should have been rebuilt (->XObjectInspectorUI::rebuiltPropertyUI) - at least once, it's rebuilt at the delegator UI, too.<br/> - After that, the request to rebuild the UI for this property is cleared, so subsequent - calls to ->fire will not trigger an new rebuilt request. - </ul> - - @throws ::com::sun::star::lang::DisposedException - if ->dispose has been called previously - */ - void SAL_CALL fire(); - /** Suspends automatic firing of UI changes normally, as soon as any of the property handlers does a request for an @@ -182,7 +162,21 @@ namespace pcr /// throws an exception if the component is already disposed void impl_checkDisposed() const; - /** fires all accumulated changes + /** fires the collected UI changes to our delegator UI + + All operations for any elements are forwarded: + <ul><li>If an element has been hidden at least once, it's also hidden at the delegator UI.</li> + <li>If an element has been shown at least once, and never been hidden, it's also + shown at the delegator UI.</li> + <li>If an element has never been shown or hidden, it's also not touched at the delegator UI.</li> + <li>The same holds if you replace "hidden" in the last three items with "disabled", + and "shown" with "enabled".</li> + <li>If an element should have been rebuilt (->XObjectInspectorUI::rebuiltPropertyUI) + at least once, it's rebuilt at the delegator UI, too.<br/> + After that, the request to rebuild the UI for this property is cleared, so subsequent + calls to ->fire will not trigger an new rebuilt request. + </ul> + @precond instance is not disposed */ diff --git a/extensions/source/propctrlr/defaultforminspection.cxx b/extensions/source/propctrlr/defaultforminspection.cxx index aed1d120bb09..dcc8c3e78508 100644 --- a/extensions/source/propctrlr/defaultforminspection.cxx +++ b/extensions/source/propctrlr/defaultforminspection.cxx @@ -41,9 +41,7 @@ #ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_ #include "modulepcr.hxx" #endif -#ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" -#endif +#include "propctrlr.hrc" #include "formmetadata.hxx" /** === begin UNO includes === **/ diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index b200d37cb83b..7511c1dfa1e4 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -33,9 +33,7 @@ #include "eformspropertyhandler.hxx" #include "formstrings.hxx" #include "formmetadata.hxx" -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #include "formbrowsertools.hxx" #include "eformshelper.hxx" #include "handlerhelper.hxx" diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 05d0984349b4..197a1cfb41f9 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -32,7 +32,7 @@ #include "precompiled_extensions.hxx" #include "eventhandler.hxx" -#include "extensio.hrc" +#include "propctrlr.hrc" #include "formbrowsertools.hxx" #include "formresid.hrc" #include "formstrings.hxx" diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index e28eb2e89224..f21e70a20f47 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -32,7 +32,7 @@ #include "precompiled_extensions.hxx" #include "controltype.hxx" -#include "extensio.hrc" +#include "propctrlr.hrc" #include "fontdialog.hxx" #include "formcomponenthandler.hxx" #include "formlinkdialog.hxx" diff --git a/extensions/source/propctrlr/formcontroller.cxx b/extensions/source/propctrlr/formcontroller.cxx index d37a67d39daf..96234358a886 100644 --- a/extensions/source/propctrlr/formcontroller.cxx +++ b/extensions/source/propctrlr/formcontroller.cxx @@ -35,7 +35,7 @@ #include "formstrings.hxx" #include "defaultforminspection.hxx" #ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" +#include "propctrlr.hrc" #endif /** === begin UNO includes === **/ diff --git a/extensions/source/propctrlr/formhelpid.hrc b/extensions/source/propctrlr/formhelpid.hrc deleted file mode 100644 index 529c3b30d97b..000000000000 --- a/extensions/source/propctrlr/formhelpid.hrc +++ /dev/null @@ -1,55 +0,0 @@ -/************************************************************************* - * - * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * - * Copyright 2008 by Sun Microsystems, Inc. - * - * OpenOffice.org - a multi-platform office productivity suite - * - * $RCSfile: formhelpid.hrc,v $ - * $Revision: 1.17 $ - * - * This file is part of OpenOffice.org. - * - * OpenOffice.org is free software: you can redistribute it and/or modify - * it under the terms of the GNU Lesser General Public License version 3 - * only, as published by the Free Software Foundation. - * - * OpenOffice.org is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License version 3 for more details - * (a copy is included in the LICENSE file that accompanied this code). - * - * You should have received a copy of the GNU Lesser General Public License - * version 3 along with OpenOffice.org. If not, see - * <http://www.openoffice.org/license.html> - * for a copy of the LGPLv3 License. - * - ************************************************************************/ - -#ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#define _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ - -#ifndef _SOLAR_HRC -#include <svtools/solar.hrc> -#endif - -// TODO: create a new help id range in <svtools/solar.hrc> -// at the moment, the help ids are ripped from svx/inc/fmhelper.hrc -// (the old property browser was implemented in svx) - -#define HID_PROPCONTROLLER_START HID_FORMS_START + 400 - -// FREE -// FREE -// FREE -// FREE -// FREE -#define HID_FM_PROPDLG_TABCTR (HID_PROPCONTROLLER_START + 5) -#define HID_FM_PROPDLG_TAB_GENERAL (HID_PROPCONTROLLER_START + 6) -#define HID_FM_PROPDLG_TAB_DATA (HID_PROPCONTROLLER_START + 7) -#define HID_FM_PROPDLG_TAB_EVT (HID_PROPCONTROLLER_START + 8) - -#endif // _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ - diff --git a/extensions/source/propctrlr/formlinkdialog.src b/extensions/source/propctrlr/formlinkdialog.src index 5132e9886338..c86ee2a6f1bd 100644 --- a/extensions/source/propctrlr/formlinkdialog.src +++ b/extensions/source/propctrlr/formlinkdialog.src @@ -31,9 +31,7 @@ #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #ifndef EXTENSIONS_SOURCE_PROPCTRLR_FORMLINKDIALOG_HRC #include "formlinkdialog.hrc" #endif diff --git a/extensions/source/propctrlr/formmetadata.cxx b/extensions/source/propctrlr/formmetadata.cxx index cdfefa314c55..0fba16859fdc 100644 --- a/extensions/source/propctrlr/formmetadata.cxx +++ b/extensions/source/propctrlr/formmetadata.cxx @@ -32,15 +32,13 @@ #include "precompiled_extensions.hxx" #include "formmetadata.hxx" #ifndef _EXTENSIONS_FORMCTRLR_FORMHELPID_HRC_ -#include "formhelpid.hrc" +#include "propctrlr.hrc" #endif #include "formstrings.hxx" #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #include <svtools/localresaccess.hxx> #include <tools/debug.hxx> #include <cppuhelper/extract.hxx> diff --git a/extensions/source/propctrlr/listselectiondlg.src b/extensions/source/propctrlr/listselectiondlg.src index d334b956dc1e..6a994ce83be8 100644 --- a/extensions/source/propctrlr/listselectiondlg.src +++ b/extensions/source/propctrlr/listselectiondlg.src @@ -31,9 +31,7 @@ #ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #ifndef EXTENSIONS_SOURCE_PROPCTRLR_LISTSELECTIONDLG_HRC #include "listselectiondlg.hrc" #endif diff --git a/extensions/source/propctrlr/taborder.src b/extensions/source/propctrlr/taborder.src index 168d5f7d3bcb..681176cb314e 100644 --- a/extensions/source/propctrlr/taborder.src +++ b/extensions/source/propctrlr/taborder.src @@ -34,9 +34,7 @@ #ifndef EXTENSIONS_SOURCE_PROPCTRLR_TABORDER_HRC #include "taborder.hrc" #endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" ModalDialog RID_DLG_TABORDER { diff --git a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx index 8b60b63ec95a..9555caaac6d3 100644 --- a/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx +++ b/extensions/source/propctrlr/xsdvalidationpropertyhandler.cxx @@ -34,18 +34,10 @@ #include "formstrings.hxx" #include "formmetadata.hxx" #include "xsddatatypes.hxx" -#ifndef _EXTENSIONS_PROPCTRLR_MODULEPRC_HXX_ #include "modulepcr.hxx" -#endif -#ifndef _EXTENSIONS_FORMCTRLR_PROPRESID_HRC_ #include "formresid.hrc" -#endif -#ifndef _EXTENSIONS_PROPCTRLR_FORMLOCALID_HRC_ #include "formlocalid.hrc" -#endif -#ifndef EXTENSIONS_INC_EXTENSIO_HRC -#include "extensio.hrc" -#endif +#include "propctrlr.hrc" #include "newdatatype.hxx" #include "xsdvalidationhelper.hxx" #include "pcrcommon.hxx" diff --git a/extensions/source/update/check/updatecheck.cxx b/extensions/source/update/check/updatecheck.cxx index 23d4da29a41f..7ca5e97239d1 100644 --- a/extensions/source/update/check/updatecheck.cxx +++ b/extensions/source/update/check/updatecheck.cxx @@ -264,7 +264,7 @@ protected: virtual void SAL_CALL onTerminated(); /* Wrapper around checkForUpdates */ - bool runCheck(); + bool runCheck( bool & rbExtensionsChecked ); private: @@ -453,7 +453,7 @@ UpdateCheckThread::cancel() //------------------------------------------------------------------------------ bool -UpdateCheckThread::runCheck() +UpdateCheckThread::runCheck( bool & rbExtensionsChecked ) { bool ret = false; UpdateState eUIState = UPDATESTATE_NO_UPDATE_AVAIL; @@ -474,12 +474,14 @@ UpdateCheckThread::runCheck() // and when there was no office update found if ( ( eUIState != UPDATESTATE_UPDATE_AVAIL ) && ( eUIState != UPDATESTATE_UPDATE_NO_DOWNLOAD ) && - !aController->isDialogShowing() ) + !aController->isDialogShowing() && + !rbExtensionsChecked ) { bool bHasExtensionUpdates = checkForExtensionUpdates( m_xContext ); aController->setHasExtensionUpdates( bHasExtensionUpdates ); if ( bHasExtensionUpdates ) aController->setUIState( UPDATESTATE_EXT_UPD_AVAIL ); + rbExtensionsChecked = true; } // joining with this thread is safe again @@ -500,6 +502,11 @@ UpdateCheckThread::onTerminated() void SAL_CALL UpdateCheckThread::run() { + bool bExtensionsChecked = false; + TimeValue systime; + TimeValue nExtCheckTime; + osl_getSystemTime( &nExtCheckTime ); + osl::Condition::Result aResult = osl::Condition::result_timeout; TimeValue tv = { 10, 0 }; @@ -547,7 +554,6 @@ UpdateCheckThread::run() if( ! checkNow ) { - TimeValue systime; osl_getSystemTime(&systime); // Go back to sleep until time has elapsed @@ -563,19 +569,28 @@ UpdateCheckThread::run() static sal_uInt8 n = 0; - if( ! hasInternetConnection() || ! runCheck() ) + if( ! hasInternetConnection() || ! runCheck( bExtensionsChecked ) ) { - // Increase next by 1, 5, 15, 60, .. minutes - static const sal_Int16 nRetryInterval[] = { 60, 300, 900, 3600 }; + // the extension update check should be independent from the office update check + // + osl_getSystemTime( &systime ); + if ( nExtCheckTime.Seconds + offset < systime.Seconds ) + bExtensionsChecked = false; - if( n < sizeof(nRetryInterval) / sizeof(sal_Int16) ) + // Increase next by 15, 60, .. minutes + static const sal_Int32 nRetryInterval[] = { 900, 3600, 14400, 86400 }; + + if( n < sizeof(nRetryInterval) / sizeof(sal_Int32) ) ++n; tv.Seconds = nRetryInterval[n-1]; aResult = m_aCondition.wait(&tv); } else // reset retry counter + { n = 0; + bExtensionsChecked = false; + } } } @@ -591,8 +606,10 @@ UpdateCheckThread::run() void SAL_CALL ManualUpdateCheckThread::run() { + bool bExtensionsChecked = false; + try { - runCheck(); + runCheck( bExtensionsChecked ); m_aCondition.reset(); } catch(const uno::Exception& e) { @@ -1528,6 +1545,8 @@ void UpdateCheck::showExtensionDialog() rtl::Reference<UpdateHandler> UpdateCheck::getUpdateHandler() { + osl::MutexGuard aGuard(m_aMutex); + if( ! m_aUpdateHandler.is() ) m_aUpdateHandler = new UpdateHandler(m_xContext, this); diff --git a/extensions/source/update/check/updatehdl.cxx b/extensions/source/update/check/updatehdl.cxx index 19ca5588c09c..ad1debd91beb 100644 --- a/extensions/source/update/check/updatehdl.cxx +++ b/extensions/source/update/check/updatehdl.cxx @@ -31,7 +31,7 @@ #include "precompiled_extensions.hxx" #include "updatehdl.hxx" -#include "extensio.hrc" +#include "update.hrc" #include "osl/diagnose.h" #include "osl/thread.hxx" @@ -200,6 +200,10 @@ void UpdateHandler::setVisible( bool bVisible ) if ( !mxUpdDlg.is() ) createDialog(); + // this should never happen, but if it happens we better return here + if ( !mxUpdDlg.is() ) + return; + updateState( meCurState ); uno::Reference< awt::XWindow > xWindow( mxUpdDlg, uno::UNO_QUERY ); @@ -1032,6 +1036,12 @@ void UpdateHandler::showControls( short nControls ) //-------------------------------------------------------------------- void UpdateHandler::createDialog() { + if ( !mxContext.is() ) + { + OSL_ASSERT( false ); + return; + } + uno::Reference< lang::XMultiComponentFactory > xServiceManager( mxContext->getServiceManager() ); if( xServiceManager.is() ) diff --git a/extensions/source/update/feed/updatefeed.cxx b/extensions/source/update/feed/updatefeed.cxx index e7ca93eacc18..bed6bed85bc3 100644 --- a/extensions/source/update/feed/updatefeed.cxx +++ b/extensions/source/update/feed/updatefeed.cxx @@ -114,14 +114,16 @@ public: throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { sal_Int32 n = m_xStream->readBytes(aData, nBytesToRead); - OSL_TRACE( aData.get()->elements ); + if ( n ) + OSL_TRACE( "Read [%d] bytes: %s\n", n, aData.get()->elements ); return n; }; virtual sal_Int32 SAL_CALL readSomeBytes(uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead) throw (io::NotConnectedException, io::BufferSizeExceededException, io::IOException, uno::RuntimeException) { sal_Int32 n = m_xStream->readSomeBytes(aData, nMaxBytesToRead); - OSL_TRACE( aData.get()->elements ); + if ( n ) + OSL_TRACE( "Read [%d] bytes: %s\n", n, aData.get()->elements ); return n; }; virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) |