diff options
Diffstat (limited to 'extensions/source')
45 files changed, 460 insertions, 163 deletions
diff --git a/extensions/source/abpilot/makefile.mk b/extensions/source/abpilot/makefile.mk index 85a19ade9996..8830b9144409 100644 --- a/extensions/source/abpilot/makefile.mk +++ b/extensions/source/abpilot/makefile.mk @@ -94,6 +94,7 @@ SHL1STDLIBS= \ $(COMPHELPERLIB) \ $(TKLIB) \ $(UNOTOOLSLIB) \ + $(SVXCORELIB) \ $(SVXLIB) SHL1LIBS= $(SLB)$/$(TARGET).lib diff --git a/extensions/source/abpilot/typeselectionpage.cxx b/extensions/source/abpilot/typeselectionpage.cxx index f7cfafe39c10..c34aceb418a3 100644 --- a/extensions/source/abpilot/typeselectionpage.cxx +++ b/extensions/source/abpilot/typeselectionpage.cxx @@ -116,6 +116,7 @@ namespace abp bool bFirstVisible = true; Link aTypeSelectionHandler = LINK(this, TypeSelectionPage, OnTypeSelected ); + const Size aSpacing( LogicToPixel( Size( 0, 3 ), MAP_APPFONT ) ); for ( ::std::vector< ButtonItem >::const_iterator loop = m_aAllTypes.begin(); loop != m_aAllTypes.end(); ++loop ) { @@ -125,7 +126,7 @@ namespace abp else { aItem.m_pItem->SetPosPixel( aTopLeft ); - aTopLeft.Y() += aItemSize.Height(); + aTopLeft.Y() += aItemSize.Height() + aSpacing.Height(); aItem.m_pItem->SetClickHdl( aTypeSelectionHandler ); aItem.m_pItem->Show(); diff --git a/extensions/source/activex/main/SOActiveX.h b/extensions/source/activex/main/SOActiveX.h index f7017d582be9..2bf33f96b4e9 100644 --- a/extensions/source/activex/main/SOActiveX.h +++ b/extensions/source/activex/main/SOActiveX.h @@ -163,7 +163,7 @@ public: HRESULT GetUrlStruct( OLECHAR* sUrl, CComPtr<IDispatch>& pdispUrl ); HRESULT Cleanup(); HRESULT TerminateOffice(); - HRESULT CSOActiveX::GetURL( const OLECHAR* url, + HRESULT GetURL( const OLECHAR* url, const OLECHAR* target ); void CallbackCreateXInputStream( CBindStatusCallback<CSOActiveX>* pbsc, BYTE* pBytes, DWORD dwSize ); diff --git a/extensions/source/config/ldap/ldapaccess.cxx b/extensions/source/config/ldap/ldapaccess.cxx index 7c4a690cd16f..a850a441c5fe 100644 --- a/extensions/source/config/ldap/ldapaccess.cxx +++ b/extensions/source/config/ldap/ldapaccess.cxx @@ -40,14 +40,30 @@ namespace extensions { namespace config { namespace ldap { - +oslModule LdapConnection::s_Ldap_Module = NULL; +t_ldap_unbind_s LdapConnection::s_p_unbind_s = NULL; +t_ldap_simple_bind_s LdapConnection::s_p_simple_bind_s = NULL; +t_ldap_set_option LdapConnection::s_p_set_option = NULL; +t_ldap_err2string LdapConnection::s_p_err2string = NULL; +t_ldap_init LdapConnection::s_p_init = NULL; +t_ldap_msgfree LdapConnection::s_p_msgfree = NULL; +t_ldap_get_dn LdapConnection::s_p_get_dn = NULL; +t_ldap_first_entry LdapConnection::s_p_first_entry = NULL; +t_ldap_search_s LdapConnection::s_p_search_s = NULL; +t_ldap_value_free LdapConnection::s_p_value_free = NULL; +t_ldap_get_values LdapConnection::s_p_get_values = NULL; +t_ldap_memfree LdapConnection::s_p_memfree = NULL; //------------------------------------------------------------------------------ typedef int LdapErrCode; //------------------------------------------------------------------------------ struct LdapMessageHolder { LdapMessageHolder() : msg(0) {} - ~LdapMessageHolder() { if (msg) ldap_msgfree(msg); } + ~LdapMessageHolder() + { + if (msg) + (*LdapConnection::s_p_msgfree)(msg); + } LDAPMessage * msg; @@ -66,7 +82,7 @@ void LdapConnection::disconnect() { if (mConnection != NULL) { - ldap_unbind_s(mConnection) ; + (*s_p_unbind_s)(mConnection) ; mConnection = NULL; } } @@ -85,11 +101,11 @@ static void checkLdapReturnCode(const sal_Char *aOperation, { message.appendAscii(aOperation).appendAscii(": ") ; } - message.appendAscii(ldap_err2string(aRetCode)).appendAscii(" (") ; + message.appendAscii((*LdapConnection::s_p_err2string)(aRetCode)).appendAscii(" (") ; sal_Char *stub = NULL ; #ifndef LDAP_OPT_SIZELIMIT // for use with OpenLDAP - ldap_get_lderrno(aConnection, NULL, &stub) ; + (*s_p_get_lderrno)(aConnection, NULL, &stub) ; #endif if (stub != NULL) { @@ -99,7 +115,7 @@ static void checkLdapReturnCode(const sal_Char *aOperation, // string itself. At any rate freeing it seems to // cause some undue problems at least on Windows. // This call is thus disabled for the moment. - //ldap_memfree(stub) ; + //(*s_p_memfree)(stub) ; } else { message.appendAscii(kNoSpecificMessage) ; } message.appendAscii(")") ; @@ -126,20 +142,20 @@ void LdapConnection::connectSimple() initConnection() ; // Set Protocol V3 int version = LDAP_VERSION3; - ldap_set_option(mConnection, + (*s_p_set_option)(mConnection, LDAP_OPT_PROTOCOL_VERSION, &version); #ifdef LDAP_X_OPT_CONNECT_TIMEOUT // OpenLDAP doesn't support this and the func /* timeout is specified in milliseconds -> 4 seconds*/ int timeout = 4000; - ldap_set_option( mConnection, + (*s_p_set_option)( mConnection, LDAP_X_OPT_CONNECT_TIMEOUT, &timeout ); #endif // Do the bind - LdapErrCode retCode = ldap_simple_bind_s(mConnection, + LdapErrCode retCode = (*s_p_simple_bind_s)(mConnection, mLdapDefinition.mAnonUser , mLdapDefinition.mAnonCredentials) ; @@ -160,7 +176,7 @@ void LdapConnection::initConnection() if (mLdapDefinition.mPort == 0) mLdapDefinition.mPort = LDAP_PORT; - mConnection = ldap_init(mLdapDefinition.mServer, + mConnection = (*s_p_init)(mLdapDefinition.mServer, mLdapDefinition.mPort) ; if (mConnection == NULL) { @@ -186,7 +202,7 @@ void LdapConnection::initConnection() rtl::OString aUserDn =findUserDn( rtl::OUStringToOString(aUser, RTL_TEXTENCODING_ASCII_US)); LdapMessageHolder result; - LdapErrCode retCode = ldap_search_s(mConnection, + LdapErrCode retCode = (*s_p_search_s)(mConnection, aUserDn, LDAP_SCOPE_BASE, "(objectclass=*)", @@ -228,21 +244,21 @@ void LdapConnection::initConnection() sal_Char * attributes [2]; attributes[0]= const_cast<sal_Char *>(LDAP_NO_ATTRS); attributes[1]= NULL; - LdapErrCode retCode = ldap_search_s(mConnection, + LdapErrCode retCode = (*s_p_search_s)(mConnection, mLdapDefinition.mBaseDN, LDAP_SCOPE_SUBTREE, filter.makeStringAndClear(), attributes, 0, &result.msg) ; checkLdapReturnCode("FindUserDn", retCode,mConnection) ; rtl::OString userDn ; - LDAPMessage *entry = ldap_first_entry(mConnection, result.msg) ; + LDAPMessage *entry = (*s_p_first_entry)(mConnection, result.msg) ; if (entry != NULL) { - sal_Char *charsDn = ldap_get_dn(mConnection, entry) ; + sal_Char *charsDn = (*s_p_get_dn)(mConnection, entry) ; userDn = charsDn ; - ldap_memfree(charsDn) ; + (*s_p_memfree)(charsDn) ; } else { @@ -264,7 +280,7 @@ rtl::OString LdapConnection::getSingleAttribute( attributes [0] = aAttribute ; attributes [1] = 0 ; LdapMessageHolder result ; - LdapErrCode retCode = ldap_search_s(mConnection, + LdapErrCode retCode = (*s_p_search_s)(mConnection, aDn, LDAP_SCOPE_BASE, "(objectclass=*)", @@ -277,22 +293,57 @@ rtl::OString LdapConnection::getSingleAttribute( return value ; } checkLdapReturnCode("GetSingleAttribute", retCode, mConnection) ; - LDAPMessage *entry = ldap_first_entry(mConnection, result.msg) ; + LDAPMessage *entry = (*s_p_first_entry)(mConnection, result.msg) ; if (entry != NULL) { - sal_Char **values = ldap_get_values(mConnection, entry, + sal_Char **values = (*s_p_get_values)(mConnection, entry, aAttribute) ; if (values != NULL) { if (*values != NULL) { value = *values ; } - ldap_value_free(values) ; + (*s_p_value_free)(values) ; } } return value ; } +extern "C" { static void SAL_CALL thisModule() {} } +void LdapConnection::loadModule() +{ + if ( !s_Ldap_Module ) + { +#if defined(WIN) || defined(WNT) + const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("nsldap32v50.dll")); +#else +#ifdef WITH_OPENLDAP + const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap.so")); +#else + const ::rtl::OUString sModuleName(RTL_CONSTASCII_USTRINGPARAM("libldap50.so")); +#endif +#endif + + // load the dbtools library + s_Ldap_Module = osl_loadModuleRelative(&thisModule, sModuleName.pData, 0); + if ( s_Ldap_Module != NULL ) + { + s_p_unbind_s = (t_ldap_unbind_s)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_unbind_s").pData)); + s_p_simple_bind_s = (t_ldap_simple_bind_s)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_simple_bind_s").pData)); + s_p_set_option = (t_ldap_set_option)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_set_option").pData)); + s_p_err2string = (t_ldap_err2string)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_err2string").pData)); + s_p_init = (t_ldap_init)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_init").pData)); + s_p_msgfree = (t_ldap_msgfree)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_msgfree").pData)); + s_p_get_dn = (t_ldap_get_dn)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_get_dn").pData)); + s_p_first_entry = (t_ldap_first_entry)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_first_entry").pData)); + s_p_search_s = (t_ldap_search_s)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_search_s").pData)); + s_p_value_free = (t_ldap_value_free)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_value_free").pData)); + s_p_get_values = (t_ldap_get_values)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_get_values").pData)); + s_p_memfree = (t_ldap_memfree)(osl_getFunctionSymbol(s_Ldap_Module, ::rtl::OUString::createFromAscii("ldap_memfree").pData)); + } + } +} + //------------------------------------------------------------------------------ } } } // extensions.config.ldap diff --git a/extensions/source/config/ldap/ldapaccess.hxx b/extensions/source/config/ldap/ldapaccess.hxx index 9017162c0c5e..47022bb0d615 100644 --- a/extensions/source/config/ldap/ldapaccess.hxx +++ b/extensions/source/config/ldap/ldapaccess.hxx @@ -34,10 +34,9 @@ #include "wrapldapinclude.hxx" #include <com/sun/star/ldap/LdapGenericException.hpp> -#ifndef _COM_SUN_STAR_LDAP_LDAP_CONNECTIONEXCEPTION_HPP_ #include <com/sun/star/ldap/LdapConnectionException.hpp> -#endif // _COM_SUN_STAR_LDAP_LDAP_CONNECTIONEXCEPTION_HPP_ #include <com/sun/star/lang/IllegalArgumentException.hpp> +#include <osl/module.h> namespace extensions { namespace config { namespace ldap { @@ -50,6 +49,18 @@ namespace ldap = css::ldap ; struct LdapUserProfile; class LdapUserProfileMap; +typedef LDAP_API(int) (LDAP_CALL *t_ldap_unbind_s)( LDAP *ld ); +typedef LDAP_API(int) (LDAP_CALL *t_ldap_simple_bind_s)( LDAP *ld, const char *who, const char *passwd ); +typedef LDAP_API(int) (LDAP_CALL *t_ldap_set_option)( LDAP *ld, int option, const void *optdata ); +typedef LDAP_API(char *) (LDAP_CALL *t_ldap_err2string)( int err ); +typedef LDAP_API(LDAP *) (LDAP_CALL *t_ldap_init)( const char *defhost, int defport ); +typedef LDAP_API(int) (LDAP_CALL *t_ldap_msgfree)( LDAPMessage *lm ); +typedef LDAP_API(char *) (LDAP_CALL *t_ldap_get_dn)( LDAP *ld, LDAPMessage *entry ); +typedef LDAP_API(LDAPMessage *) (LDAP_CALL *t_ldap_first_entry)( LDAP *ld, LDAPMessage *chain ); +typedef LDAP_API(int) (LDAP_CALL *t_ldap_search_s)( LDAP *ld, const char *base, int scope, const char *filter, char **attrs, int attrsonly, LDAPMessage **res ); +typedef LDAP_API(void) (LDAP_CALL *t_ldap_value_free)( char **vals ); +typedef LDAP_API(char **) (LDAP_CALL *t_ldap_get_values)( LDAP *ld, LDAPMessage *entry, const char *target ); +typedef LDAP_API(void) (LDAP_CALL *t_ldap_memfree)( void *p ); //------------------------------------------------------------------------------ /** Struct containing the information on LDAP connection */ struct LdapDefinition @@ -75,6 +86,7 @@ struct LdapDefinition /** Class encapulating all LDAP functionality */ class LdapConnection { + friend struct LdapMessageHolder; public: /** Default constructor */ @@ -124,6 +136,12 @@ public: throw (lang::IllegalArgumentException, ldap::LdapConnectionException, ldap::LdapGenericException); + + void loadModule(); + + static t_ldap_err2string s_p_err2string; + static t_ldap_value_free s_p_value_free; + static t_ldap_get_values s_p_get_values; private: void initConnection() @@ -142,6 +160,19 @@ private: /** LDAP connection object */ LDAP* mConnection ; LdapDefinition mLdapDefinition; + + static oslModule s_Ldap_Module; + static t_ldap_unbind_s s_p_unbind_s; + static t_ldap_simple_bind_s s_p_simple_bind_s; + static t_ldap_set_option s_p_set_option; + static t_ldap_init s_p_init; + static t_ldap_msgfree s_p_msgfree; + static t_ldap_get_dn s_p_get_dn; + static t_ldap_first_entry s_p_first_entry; + static t_ldap_search_s s_p_search_s; + + static t_ldap_memfree s_p_memfree; + } ; //------------------------------------------------------------------------------ }} } diff --git a/extensions/source/config/ldap/ldapuserprof.cxx b/extensions/source/config/ldap/ldapuserprof.cxx index 7475af4e8fcf..3a031ddae211 100644 --- a/extensions/source/config/ldap/ldapuserprof.cxx +++ b/extensions/source/config/ldap/ldapuserprof.cxx @@ -31,7 +31,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_extensions.hxx" #include "ldapuserprof.hxx" - +#include "ldapaccess.hxx" namespace extensions { namespace config { namespace ldap { //============================================================================== @@ -127,14 +127,14 @@ void LdapUserProfileMap::ldapToUserProfile(LDAP *aConnection, for (sal_uInt32 j = 0 ; j < mMapping [i].mLdapAttributes.size() ; ++ j) { - values = ldap_get_values(aConnection, aEntry, + values = (*LdapConnection::s_p_get_values)(aConnection, aEntry, mMapping [i].mLdapAttributes [j]) ; if (values != NULL) { aProfile.mProfile[i].mValue = rtl::OStringToOUString( *values, RTL_TEXTENCODING_UTF8); - ldap_value_free(values); + (*LdapConnection::s_p_value_free)(values); break; } } diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx index 13cd3ff2070d..330834c5b414 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.cxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx @@ -112,27 +112,30 @@ LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContex OSL_ENSURE(!bReentrantCall, "configuration: Ldap Backend constructor called reentrantly - probably a registration error."); if (!bReentrantCall) - try { - bReentrantCall = true ; - if (! readLdapConfiguration(aDefinition) ) + try { - throw backend::BackendSetupException( - rtl::OUString::createFromAscii("LdapUserProfileBe- LDAP not configured"), - NULL, uno::Any()); + bReentrantCall = true ; + if (! readLdapConfiguration(aDefinition) ) + { + throw backend::BackendSetupException( + rtl::OUString::createFromAscii("LdapUserProfileBe- LDAP not configured"), + NULL, uno::Any()); + } + + bReentrantCall = false ; + } + catch (uno::Exception&) + { + bReentrantCall = false; + throw; } - - bReentrantCall = false ; - } - catch (uno::Exception&) - { - bReentrantCall = false; - throw; } } try { + mLdapSource->mConnection.loadModule(); mLdapSource->mConnection.connectSimple(aDefinition); //Set the UserDN mUserDN = mLdapSource->mConnection.findUserDn( diff --git a/extensions/source/config/ldap/makefile.mk b/extensions/source/config/ldap/makefile.mk index acd47ab9e281..5ff3da4d21de 100644 --- a/extensions/source/config/ldap/makefile.mk +++ b/extensions/source/config/ldap/makefile.mk @@ -82,7 +82,6 @@ SHL1DEF=$(MISC)$/$(SHL1TARGET).def SHL1LIBS=$(LIB1TARGET) SHL1IMPLIB=i$(SHL1TARGET) SHL1STDLIBS= \ - $(LDAPSDKLIB) \ $(CPPUHELPERLIB) \ $(CPPULIB) \ $(SALHELPERLIB) \ diff --git a/extensions/source/dbpilots/listcombowizard.cxx b/extensions/source/dbpilots/listcombowizard.cxx index 7b36f27626c4..f86b284b72fd 100644 --- a/extensions/source/dbpilots/listcombowizard.cxx +++ b/extensions/source/dbpilots/listcombowizard.cxx @@ -223,9 +223,6 @@ namespace dbp // the bound field getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("DataField"), makeAny(::rtl::OUString(getSettings().sLinkedFormField))); - - // by default, create a drop down control - getContext().xObjectModel->setPropertyValue(::rtl::OUString::createFromAscii("Dropdown"), ::cppu::bool2any(sal_True)); } catch(Exception&) { diff --git a/extensions/source/ole/oleobjw.hxx b/extensions/source/ole/oleobjw.hxx index 2addf2f037a7..255d66f46ea8 100644 --- a/extensions/source/ole/oleobjw.hxx +++ b/extensions/source/ole/oleobjw.hxx @@ -32,8 +32,10 @@ #define __OLEOBJW_HXX #include "ole2uno.hxx" +#ifdef _MSC_VER #pragma warning (push,1) #pragma warning (disable:4548) +#endif #include <tools/presys.h> #define _WIN32_WINNT 0x0400 @@ -46,7 +48,9 @@ #include <hash_map> #include <tools/postsys.h> +#ifdef _MSC_VER #pragma warning (pop) +#endif #include <cppuhelper/implbase3.hxx> #include <cppuhelper/implbase4.hxx> @@ -88,7 +92,7 @@ public: ~IUnknownWrapper_Impl(); //XInterface - Any SAL_CALL IUnknownWrapper_Impl::queryInterface(const Type& t) + Any SAL_CALL queryInterface(const Type& t) throw (RuntimeException); // XInvokation diff --git a/extensions/source/oooimprovecore/makefile.mk b/extensions/source/oooimprovecore/makefile.mk index 53de4e333994..b527f16bf44e 100644 --- a/extensions/source/oooimprovecore/makefile.mk +++ b/extensions/source/oooimprovecore/makefile.mk @@ -52,6 +52,9 @@ LIB1FILES= \ $(SLB)$/$(TARGET).lib \ SHL1TARGET=$(TARGET)$(DLLPOSTFIX) +.IF "$(GUI)"=="OS2" +SHL1TARGET=oooimpc$(DLLPOSTFIX) +.ENDIF SHL1STDLIBS= \ $(COMPHELPERLIB) \ @@ -62,6 +65,7 @@ SHL1STDLIBS= \ $(SVLLIB) \ $(SVTOOLLIB) \ $(SFXLIB) \ + $(SVXCORELIB) \ $(SVXLIB) \ $(TOOLSLIB) diff --git a/extensions/source/oooimprovement/config.cxx b/extensions/source/oooimprovement/config.cxx index daf1e81bc60d..bece7e089f1a 100644 --- a/extensions/source/oooimprovement/config.cxx +++ b/extensions/source/oooimprovement/config.cxx @@ -222,6 +222,7 @@ namespace oooimprovement return result; } +#ifdef FUTURE sal_Int32 Config::getFailedAttempts() const { sal_Int32 result = 0; @@ -231,6 +232,7 @@ namespace oooimprovement MyConfigurationHelper::E_READONLY) >>= result; return result; } +#endif sal_Int32 Config::getOfficeStartCounterdown() const { diff --git a/extensions/source/oooimprovement/config.hxx b/extensions/source/oooimprovement/config.hxx index ff032a6032a5..c5ea887fa76f 100644 --- a/extensions/source/oooimprovement/config.hxx +++ b/extensions/source/oooimprovement/config.hxx @@ -53,7 +53,9 @@ namespace oooimprovement ::rtl::OUString getSoapId() const; ::rtl::OUString getSoapUrl() const; sal_Int32 getReportCount() const; +#ifdef FUTURE sal_Int32 getFailedAttempts() const; +#endif sal_Int32 getOfficeStartCounterdown() const; sal_Int32 incrementEventCount(sal_Int32 by); sal_Int32 incrementReportCount(sal_Int32 by); diff --git a/extensions/source/oooimprovement/corecontroller.cxx b/extensions/source/oooimprovement/corecontroller.cxx index 34fc24e42302..3c9245d3faa9 100644 --- a/extensions/source/oooimprovement/corecontroller.cxx +++ b/extensions/source/oooimprovement/corecontroller.cxx @@ -33,7 +33,6 @@ #include "corecontroller.hxx" #include "config.hxx" - using ::rtl::OUString; using namespace ::com::sun::star::lang; using namespace ::com::sun::star::uno; @@ -41,14 +40,6 @@ using namespace ::com::sun::star::uno; namespace oooimprovement { - - CoreController::CoreController(const Reference<XComponentContext>& context) - : m_ServiceFactory(Reference<XMultiServiceFactory>( - context->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.lang.XMultiServiceFactory"), context), - UNO_QUERY)) - { } - CoreController::CoreController(const Reference<XMultiServiceFactory>& sf) : m_ServiceFactory(sf) { } @@ -96,9 +87,6 @@ namespace oooimprovement return aServiceNames; } - Reference<XInterface> SAL_CALL CoreController::Create(const Reference<XComponentContext>& context) - { return *(new CoreController(context)); } - Reference<XInterface> SAL_CALL CoreController::Create(const Reference<XMultiServiceFactory>& sm) { return *(new CoreController(sm)); } } diff --git a/extensions/source/oooimprovement/corecontroller.hxx b/extensions/source/oooimprovement/corecontroller.hxx index 3f1cadb82b69..4f62e9d026b6 100644 --- a/extensions/source/oooimprovement/corecontroller.hxx +++ b/extensions/source/oooimprovement/corecontroller.hxx @@ -54,8 +54,8 @@ namespace oooimprovement // css::lang::XServiceInfo - static version static ::rtl::OUString SAL_CALL getImplementationName_static(); static css::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames_static(); - static css::uno::Reference< css::uno::XInterface> SAL_CALL Create( - const css::uno::Reference<css::uno::XComponentContext>& context); + //static css::uno::Reference< css::uno::XInterface> SAL_CALL Create( + // const css::uno::Reference<css::uno::XComponentContext>& context); static css::uno::Reference< css::uno::XInterface> SAL_CALL Create( const css::uno::Reference< css::lang::XMultiServiceFactory>& sm); diff --git a/extensions/source/oooimprovement/errormail.cxx b/extensions/source/oooimprovement/errormail.cxx index fdfec120695f..38e863750220 100644 --- a/extensions/source/oooimprovement/errormail.cxx +++ b/extensions/source/oooimprovement/errormail.cxx @@ -37,7 +37,7 @@ #include <rtl/string.hxx> #include <rtl/strbuf.hxx> -#ifdef UNIX +#if defined(UNIX) || defined(OS2) #include <sys/utsname.h> #endif #ifdef WIN32 @@ -83,12 +83,14 @@ namespace { return "Win32"; #elif defined UNIX return "Unix"; + #elif defined OS2 + return "OS/2"; #else return "Unknown"; #endif }; -#ifdef UNIX +#if defined(UNIX) || defined(OS2) static const OString getLocale() { const char * locale = getenv( "LC_ALL" ); diff --git a/extensions/source/oooimprovement/invite_job.cxx b/extensions/source/oooimprovement/invite_job.cxx index 20efafcaa69a..bb1ce11d23fe 100644 --- a/extensions/source/oooimprovement/invite_job.cxx +++ b/extensions/source/oooimprovement/invite_job.cxx @@ -67,12 +67,12 @@ namespace namespace oooimprovement { - InviteJob::InviteJob(const Reference<XComponentContext>& context) - : m_ServiceFactory(Reference<XMultiServiceFactory>( - context->getServiceManager()->createInstanceWithContext( - OUString::createFromAscii("com.sun.star.lang.XMultiServiceFactory"), context), - UNO_QUERY)) - { } +// InviteJob::InviteJob(const Reference<XComponentContext>& context) +// : m_ServiceFactory(Reference<XMultiServiceFactory>( +// context->getServiceManager()->createInstanceWithContext( +// OUString::createFromAscii("com.sun.star.lang.XMultiServiceFactory"), context), +// UNO_QUERY)) +// { } InviteJob::InviteJob(const Reference<XMultiServiceFactory>& sf) : m_ServiceFactory(sf) @@ -128,8 +128,8 @@ namespace oooimprovement return aServiceNames; } - Reference<XInterface> InviteJob::Create(const Reference<XComponentContext>& context) - { return *(new InviteJob(context)); } +// Reference<XInterface> InviteJob::Create(const Reference<XComponentContext>& context) +// { return *(new InviteJob(context)); } Reference<XInterface> InviteJob::Create(const Reference<XMultiServiceFactory>& sm) { return *(new InviteJob(sm)); } diff --git a/extensions/source/oooimprovement/invite_job.hxx b/extensions/source/oooimprovement/invite_job.hxx index 17e5c2586003..8c1cd57f07a8 100644 --- a/extensions/source/oooimprovement/invite_job.hxx +++ b/extensions/source/oooimprovement/invite_job.hxx @@ -53,8 +53,8 @@ namespace oooimprovement // XServiceInfo - static version static ::rtl::OUString SAL_CALL getImplementationName_static(); static css::uno::Sequence< ::rtl::OUString> SAL_CALL getSupportedServiceNames_static(); - static css::uno::Reference< css::uno::XInterface> SAL_CALL Create( - const css::uno::Reference< css::uno::XComponentContext>& context); + //static css::uno::Reference< css::uno::XInterface> SAL_CALL Create( + // const css::uno::Reference< css::uno::XComponentContext>& context); static css::uno::Reference< css::uno::XInterface> SAL_CALL Create(const css::uno::Reference< css::lang::XMultiServiceFactory>& sm); diff --git a/extensions/source/oooimprovement/makefile.mk b/extensions/source/oooimprovement/makefile.mk index 41f91fc7b5ca..f9b508b13f2f 100644 --- a/extensions/source/oooimprovement/makefile.mk +++ b/extensions/source/oooimprovement/makefile.mk @@ -70,6 +70,10 @@ SHL1STDLIBS= \ $(UNOTOOLSLIB) \ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) +.IF "$(GUI)"=="OS2" +SHL1TARGET= oooimp$(DLLPOSTFIX) +.ENDIF + SHL1LIBS= $(SLB)$/$(TARGET).lib SHL1DEF= $(MISC)$/$(SHL1TARGET).def DEF1NAME= $(SHL1TARGET) diff --git a/extensions/source/oooimprovement/myconfigurationhelper.cxx b/extensions/source/oooimprovement/myconfigurationhelper.cxx index c6e68e92a064..e0f14c6ec445 100644 --- a/extensions/source/oooimprovement/myconfigurationhelper.cxx +++ b/extensions/source/oooimprovement/myconfigurationhelper.cxx @@ -149,33 +149,6 @@ namespace oooimprovement xProps->setPropertyValue(sKey, aValue); } - Reference<XInterface> MyConfigurationHelper::makeSureSetNodeExists( - const Reference<XInterface> xCFG, - const OUString& sRelPathToSet, - const OUString& sSetNode) - { - Reference<css::container::XHierarchicalNameAccess> xAccess(xCFG, UNO_QUERY_THROW); - Reference<css::container::XNameAccess> xSet; - xAccess->getByHierarchicalName(sRelPathToSet) >>= xSet; - if (!xSet.is()) - throw css::container::NoSuchElementException( - noSuchElement(sRelPathToSet), - Reference<XInterface>()); - - Reference<XInterface> xNode; - if (xSet->hasByName(sSetNode)) - xSet->getByName(sSetNode) >>= xNode; - else - { - Reference<XSingleServiceFactory> xNodeFactory(xSet, UNO_QUERY_THROW); - xNode = xNodeFactory->createInstance(); - Reference<css::container::XNameContainer> xSetReplace(xSet, UNO_QUERY_THROW); - xSetReplace->insertByName(sSetNode, makeAny(xNode)); - } - - return xNode; - } - Any MyConfigurationHelper::readDirectKey( const Reference<XMultiServiceFactory> xSMGR, const OUString& sPackage, diff --git a/extensions/source/oooimprovement/myconfigurationhelper.hxx b/extensions/source/oooimprovement/myconfigurationhelper.hxx index a5d0c749e81a..5c5cb38b6a68 100644 --- a/extensions/source/oooimprovement/myconfigurationhelper.hxx +++ b/extensions/source/oooimprovement/myconfigurationhelper.hxx @@ -163,40 +163,6 @@ namespace oooimprovement const css::uno::Any& aValue); //----------------------------------------------- - /** it checks if the specified set node exists ... or create an empty one - * otherwise. - * - * This method must be used in combination with openConfig(). - * The cached configuration access must be provided here ... and - * all operations are made relativ to this access point. - * - * Further this method must be used only with configuration set's. - * Atomic keys can't be "created" ... they "exists everytimes". - * - * @param xCFG - * the configuration root, where sRelPathToSet should be interpreted - * as relativ path. - * - * @param sRelPathToSet - * path relative to xCFG parameter. - * - * @param sSetNode - * the set node, which should be checked if its exists ... - * or which should be created with default values. - * - * @return A reference to the found (or new created) set node. - * Cant be NULL .. in such case an exception occure ! - * - * @throw css::uno::Any exceptions the underlying configuration can throw. - * E.g. css::uno::Exception if the provided configuration - * access does not allow writing for this set. - */ - static css::uno::Reference< css::uno::XInterface> makeSureSetNodeExists( - const css::uno::Reference< css::uno::XInterface> xCFG, - const ::rtl::OUString& sRelPathToSet, - const ::rtl::OUString& sSetNode); - - //----------------------------------------------- /** commit all changes made on the specified configuration access. * * This method must be used in combination with openConfig(). diff --git a/extensions/source/oooimprovement/soaprequest.cxx b/extensions/source/oooimprovement/soaprequest.cxx index d67ce911d204..045a02701fc6 100644 --- a/extensions/source/oooimprovement/soaprequest.cxx +++ b/extensions/source/oooimprovement/soaprequest.cxx @@ -33,6 +33,7 @@ #include "soaprequest.hxx" #include "errormail.hxx" +#include "config.hxx" #include <boost/shared_ptr.hpp> #include <com/sun/star/lang/XMultiComponentFactory.hpp> #include <com/sun/star/lang/XMultiServiceFactory.hpp> @@ -56,7 +57,7 @@ namespace { static unsigned long asUlong(sal_Int8 input) { - return *reinterpret_cast<unsigned char *>(&input) ; + return *reinterpret_cast<unsigned char *>(&input); }; static Sequence<sal_Int8> base64_encode(const Sequence<sal_Int8>& input) @@ -150,10 +151,18 @@ namespace "</SOAP-ENV:Envelope>\n"); static const OString SOAP_ITEM_END("]]></value></item>\n"); - static const OString getSoapSoapId(const OString& soap_id) + static const OString getSoapOfficeversion(const Reference<XMultiServiceFactory>& sf) { - OStringBuffer buf = - "<body xsi:type=\"xsd:string\">" + xmlEncode(soap_id) + "</body>\n"; + return ::rtl::OUStringToOString(oooimprovement::Config(sf).getCompleteProductname(), RTL_TEXTENCODING_ASCII_US); + }; + + static const OString getSoapSoapId(const Reference<XMultiServiceFactory>& sf, const OString& soap_id) + { + OStringBuffer buf; + buf.append("<body xsi:type=\"xsd:string\">"); + buf.append(xmlEncode(soap_id)).append("\n"); + buf.append(xmlEncode(getSoapOfficeversion(sf))).append("\n"); + buf.append("</body>\n"); return buf.makeStringAndClear(); }; @@ -180,7 +189,7 @@ namespace oooimprovement writeString(target, SOAP_START); writeString( target, - getSoapSoapId(rtl::OUStringToOString(m_SoapId, RTL_TEXTENCODING_ASCII_US))); + getSoapSoapId(m_ServiceFactory, rtl::OUStringToOString(m_SoapId, RTL_TEXTENCODING_ASCII_US))); writeString(target, SOAP_ITEMS_START); writeString(target, getSoapItemStart("reportmail.xml")); writeString(target, Errormail(m_ServiceFactory).getXml()); diff --git a/extensions/source/plugin/aqua/macmgr.cxx b/extensions/source/plugin/aqua/macmgr.cxx index 26df705a1d97..65a56f03f7ad 100644 --- a/extensions/source/plugin/aqua/macmgr.cxx +++ b/extensions/source/plugin/aqua/macmgr.cxx @@ -400,12 +400,56 @@ static int parseMimeResource( CFBundleRef i_xBundle, return nAdded; } +// check some known bad plugins to avoid crashes +static bool checkBlackList( CFBundleRef i_xBundle ) +{ + rtl::OUString aBundleName; + CFTypeRef bundlename = CFBundleGetValueForInfoDictionaryKey( i_xBundle, CFSTR("CFBundleName")); + if( bundlename && CFGetTypeID(bundlename) == CFStringGetTypeID() ) + aBundleName = getString( static_cast<CFStringRef>(bundlename) ); + + rtl::OUString aBundleVersion; + CFTypeRef bundleversion = CFBundleGetValueForInfoDictionaryKey( i_xBundle, CFSTR("CFBundleVersion")); + if( bundleversion && CFGetTypeID(bundleversion) == CFStringGetTypeID() ) + aBundleVersion = getString( static_cast<CFStringRef>(bundleversion) ); + + bool bReject = false; + // #i102735# VLC plugin prior to 1.0 tends to crash + if( aBundleName.equalsAscii( "VLC Plug-in" ) ) + { + sal_Int32 nIndex = 0; + rtl::OUString aMajor( aBundleVersion.getToken( 0, '.', nIndex ) ); + if( aMajor.toInt32() < 1 ) + { + bReject = true; + } + } + // #i103674# Garmin Communicator Plugin crashes + else if( aBundleName.equalsAscii( "Garmin Communicator Plugin" ) ) + { + bReject = true; + } + + #if OSL_DEBUG_LEVEL > 1 + if( bReject ) + fprintf( stderr, "rejecting plugin \"%s\" version %s\n", + rtl::OUStringToOString( aBundleName, RTL_TEXTENCODING_UTF8 ).getStr(), + rtl::OUStringToOString( aBundleVersion, RTL_TEXTENCODING_UTF8 ).getStr() + ); + #endif + + return bReject; +} + static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescription* >& io_rDescriptions ) { int nDescriptions = 0; if( ! i_xBundle ) return nDescriptions; + if( checkBlackList( i_xBundle ) ) + return 0; + rtl::OUString aPlugURL; CFURLRef xURL = CFBundleCopyBundleURL( i_xBundle ); aPlugURL = getString( xURL ); @@ -424,7 +468,8 @@ static int getPluginDescriptions( CFBundleRef i_xBundle , list< PluginDescriptio fprintf( stderr, "URL: %s\nname: %s\ndescription: %s\n", rtl::OUStringToOString( aPlugURL, RTL_TEXTENCODING_UTF8 ).getStr(), rtl::OUStringToOString( aPlugName, RTL_TEXTENCODING_UTF8 ).getStr(), - rtl::OUStringToOString( aPlugDescription, RTL_TEXTENCODING_UTF8 ).getStr() ); + rtl::OUStringToOString( aPlugDescription, RTL_TEXTENCODING_UTF8 ).getStr() + ); #endif @@ -535,7 +580,7 @@ static rtl::OUString FindFolderURL( FSVolumeRefNum vRefNum, OSType folderType ) return aRet; } -Sequence<PluginDescription> XPluginManager_Impl::getPluginDescriptions() throw() +Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw() { static Sequence<PluginDescription> aDescriptions; static BOOL bHavePlugins = FALSE; diff --git a/extensions/source/plugin/aqua/makefile.mk b/extensions/source/plugin/aqua/makefile.mk index b68ee9f73f93..9cbe83809d11 100644 --- a/extensions/source/plugin/aqua/makefile.mk +++ b/extensions/source/plugin/aqua/makefile.mk @@ -55,7 +55,6 @@ CDEFS+=-DOJI .ENDIF .IF "$(GUIBASE)"=="aqua" -OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions CFLAGSCXX+=$(OBJCXXFLAGS) .ENDIF # "$(GUIBASE)"=="aqua" diff --git a/extensions/source/plugin/base/makefile.mk b/extensions/source/plugin/base/makefile.mk index f25f8fb47679..1e0a39b663e6 100644 --- a/extensions/source/plugin/base/makefile.mk +++ b/extensions/source/plugin/base/makefile.mk @@ -51,7 +51,6 @@ CDEFS+=-DDISABLE_XAW .IF "$(WITH_MOZILLA)" != "NO" .IF "$(GUIBASE)"=="aqua" -OBJCXXFLAGS=-x objective-c++ -fobjc-exceptions CFLAGSCXX+=$(OBJCXXFLAGS) .ENDIF # "$(GUIBASE)"=="aqua" diff --git a/extensions/source/plugin/base/manager.cxx b/extensions/source/plugin/base/manager.cxx index 92fca1211caa..bb5422c69a51 100644 --- a/extensions/source/plugin/base/manager.cxx +++ b/extensions/source/plugin/base/manager.cxx @@ -35,19 +35,19 @@ #include <cstdarg> #endif -#include <plugin/impl.hxx> +#include "plugin/impl.hxx" -#ifndef _OSL_MUTEX_HXX -#include <osl/mutex.hxx> -#endif -#include <svtools/pathoptions.hxx> -#include <com/sun/star/container/XEnumerationAccess.hpp> -#include <com/sun/star/container/XNameAccess.hpp> -#include <com/sun/star/container/XEnumeration.hpp> -#include <com/sun/star/container/XElementAccess.hpp> -#include <com/sun/star/container/XIndexAccess.hpp> -#include <com/sun/star/loader/XImplementationLoader.hpp> -#include <com/sun/star/loader/CannotActivateFactoryException.hpp> +#include "osl/mutex.hxx" +#include "svtools/pathoptions.hxx" +#include "vcl/configsettings.hxx" + +#include "com/sun/star/container/XEnumerationAccess.hpp" +#include "com/sun/star/container/XNameAccess.hpp" +#include "com/sun/star/container/XEnumeration.hpp" +#include "com/sun/star/container/XElementAccess.hpp" +#include "com/sun/star/container/XIndexAccess.hpp" +#include "com/sun/star/loader/XImplementationLoader.hpp" +#include "com/sun/star/loader/CannotActivateFactoryException.hpp" PluginManager* PluginManager::pManager = NULL; @@ -165,6 +165,20 @@ XPlugin_Impl* XPluginManager_Impl::getPluginImplementation( const Reference< ::c return NULL; } +Sequence<com::sun::star::plugin::PluginDescription> XPluginManager_Impl::getPluginDescriptions() throw() +{ + Sequence<com::sun::star::plugin::PluginDescription> aRet; + + vcl::SettingsConfigItem* pCfg = vcl::SettingsConfigItem::get(); + rtl::OUString aVal( pCfg->getValue( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "BrowserPlugins" ) ), + rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "Disabled" ) ) ) ); + if( ! aVal.toBoolean() ) + { + aRet = impl_getPluginDescriptions(); + } + return aRet; +} + Reference< ::com::sun::star::plugin::XPlugin > XPluginManager_Impl::createPlugin( const Reference< ::com::sun::star::plugin::XPluginContext >& acontext, INT16 mode, const Sequence< ::rtl::OUString >& argn, const Sequence< ::rtl::OUString >& argv, const ::com::sun::star::plugin::PluginDescription& plugintype) throw( RuntimeException,::com::sun::star::plugin::PluginException ) { diff --git a/extensions/source/plugin/inc/plugin/impl.hxx b/extensions/source/plugin/inc/plugin/impl.hxx index 28524770521c..e9adee5088dd 100644 --- a/extensions/source/plugin/inc/plugin/impl.hxx +++ b/extensions/source/plugin/inc/plugin/impl.hxx @@ -293,6 +293,9 @@ public: virtual Reference< com::sun::star::plugin::XPluginContext > SAL_CALL createPluginContext() throw(); // has to be implemented per system + virtual Sequence< com::sun::star::plugin::PluginDescription > SAL_CALL impl_getPluginDescriptions(void) throw(); + // calls system specific impl_getPluginDescriptions + // checks whether plugins are disabled virtual Sequence< com::sun::star::plugin::PluginDescription > SAL_CALL getPluginDescriptions(void) throw(); virtual Reference< com::sun::star::plugin::XPlugin > SAL_CALL createPlugin( const Reference< com::sun::star::plugin::XPluginContext > & acontext, sal_Int16 mode, const Sequence< rtl::OUString >& argn, const Sequence< rtl::OUString >& argv, const com::sun::star::plugin::PluginDescription& plugintype) throw( RuntimeException,::com::sun::star::plugin::PluginException ); diff --git a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx index 5f0e639e1c7e..862075d92c28 100644 --- a/extensions/source/plugin/inc/plugin/unx/plugcon.hxx +++ b/extensions/source/plugin/inc/plugin/unx/plugcon.hxx @@ -67,7 +67,9 @@ extern "C" { # endif #endif #include <X11/Xatom.h> -#define XP_UNIX +#ifndef XP_UNIX +# define XP_UNIX +#endif #define MOZ_X11 #include <stdio.h> #ifdef SYSTEM_MOZILLA @@ -102,7 +104,7 @@ extern "C" { extern "C" { #include <npsdk/npupp.h> } -#include <npapi.h> +#include <npsdk/npapi.h> #if NP_VERSION_MINOR < 17 // compatibility hack: compile with older NPN api header, but define diff --git a/extensions/source/plugin/unx/unxmgr.cxx b/extensions/source/plugin/unx/unxmgr.cxx index ff17d1e24324..1f1d291daf8d 100644 --- a/extensions/source/plugin/unx/unxmgr.cxx +++ b/extensions/source/plugin/unx/unxmgr.cxx @@ -226,7 +226,7 @@ static void CheckPluginRegistryFiles( const rtl::OString& rPath, list< PluginDes closedir( pDIR ); } -Sequence<PluginDescription> XPluginManager_Impl::getPluginDescriptions() throw() +Sequence<PluginDescription> XPluginManager_Impl::impl_getPluginDescriptions() throw() { static Sequence<PluginDescription> aDescriptions; static BOOL bHavePlugins = FALSE; diff --git a/extensions/source/plugin/util/makefile.mk b/extensions/source/plugin/util/makefile.mk index 657992ec1b33..dfba6a755201 100644 --- a/extensions/source/plugin/util/makefile.mk +++ b/extensions/source/plugin/util/makefile.mk @@ -96,8 +96,8 @@ SHL1STDLIBS+= \ $(CPPULIB) \ $(SALLIB) -.IF "$(OS)"=="MACOSX" && "$(GUIBASE)"=="unx" -SHL1STDLIBS+= -lX11 +.IF "$(GUIBASE)"=="unx" +SHL1STDLIBS+=$(X11LINK_DYNAMIC) .ENDIF SHL1STDLIBS+=$(SHL1OWNLIBS) diff --git a/extensions/source/plugin/win/winmgr.cxx b/extensions/source/plugin/win/winmgr.cxx index 6a63ad8b5402..caf7a38a5458 100644 --- a/extensions/source/plugin/win/winmgr.cxx +++ b/extensions/source/plugin/win/winmgr.cxx @@ -325,7 +325,7 @@ static void add_SO_Plugins( PluginLocationMap & rPlugins ) } //__________________________________________________________________________________________________ -Sequence< PluginDescription > XPluginManager_Impl::getPluginDescriptions(void) throw() +Sequence< PluginDescription > XPluginManager_Impl::impl_getPluginDescriptions(void) throw() { Guard< Mutex > aGuard( Mutex::getGlobalMutex() ); static Sequence<PluginDescription > s_aDescriptions( 0 ); diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx index 23008fc9a1de..bd60181f1d0e 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -1244,14 +1244,74 @@ namespace pcr } //------------------------------------------------------------------ + long OBrowserListBox::PreNotify( NotifyEvent& _rNEvt ) + { + switch ( _rNEvt.GetType() ) + { + case EVENT_KEYINPUT: + { + const KeyEvent* pKeyEvent = _rNEvt.GetKeyEvent(); + if ( ( pKeyEvent->GetKeyCode().GetModifier() != 0 ) + || ( ( pKeyEvent->GetKeyCode().GetCode() != KEY_PAGEUP ) + && ( pKeyEvent->GetKeyCode().GetCode() != KEY_PAGEDOWN ) + ) + ) + break; + + long nScrollOffset = 0; + if ( m_aVScroll.IsVisible() ) + { + if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEUP ) + nScrollOffset = -m_aVScroll.GetPageSize(); + else if ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEDOWN ) + nScrollOffset = m_aVScroll.GetPageSize(); + } + + if ( nScrollOffset ) + { + long nNewThumbPos = m_aVScroll.GetThumbPos() + nScrollOffset; + nNewThumbPos = ::std::max( nNewThumbPos, m_aVScroll.GetRangeMin() ); + nNewThumbPos = ::std::min( nNewThumbPos, m_aVScroll.GetRangeMax() ); + m_aVScroll.DoScroll( nNewThumbPos ); + nNewThumbPos = m_aVScroll.GetThumbPos(); + + sal_uInt16 nFocusControlPos = 0; + sal_uInt16 nActiveControlPos = impl_getControlPos( m_xActiveControl ); + if ( nActiveControlPos < nNewThumbPos ) + nFocusControlPos = (sal_uInt16)nNewThumbPos; + else if ( nActiveControlPos >= nNewThumbPos + CalcVisibleLines() ) + nFocusControlPos = (sal_uInt16)nNewThumbPos + CalcVisibleLines() - 1; + if ( nFocusControlPos ) + { + if ( nFocusControlPos < m_aOrderedLines.size() ) + { + m_aOrderedLines[ nFocusControlPos ]->second.pLine->GrabFocus(); + } + else + OSL_ENSURE( false, "OBrowserListBox::PreNotify: internal error, invalid focus control position!" ); + } + } + + return 1L; + // handled this. In particular, we also consume PageUp/Down events if we do not use them for scrolling, + // otherwise they would be used to scroll the document view, which does not sound like it is desired by + // the user. + } + } + return Control::PreNotify( _rNEvt ); + } + + //------------------------------------------------------------------ long OBrowserListBox::Notify( NotifyEvent& _rNEvt ) { - if ( EVENT_COMMAND == _rNEvt.GetType() ) + switch ( _rNEvt.GetType() ) + { + case EVENT_COMMAND: { const CommandEvent* pCommand = _rNEvt.GetCommandEvent(); if ( ( COMMAND_WHEEL == pCommand->GetCommand() ) - || ( COMMAND_STARTAUTOSCROLL == pCommand->GetCommand() ) - || ( COMMAND_AUTOSCROLL == pCommand->GetCommand() ) + || ( COMMAND_STARTAUTOSCROLL == pCommand->GetCommand() ) + || ( COMMAND_AUTOSCROLL == pCommand->GetCommand() ) ) { // interested in scroll events if we have a scrollbar @@ -1261,6 +1321,9 @@ namespace pcr } } } + break; + } + return Control::Notify( _rNEvt ); } diff --git a/extensions/source/propctrlr/browserlistbox.hxx b/extensions/source/propctrlr/browserlistbox.hxx index a89e1dc83c39..46ae1f94aaa8 100644 --- a/extensions/source/propctrlr/browserlistbox.hxx +++ b/extensions/source/propctrlr/browserlistbox.hxx @@ -149,6 +149,7 @@ namespace pcr void EnableUpdate(); void DisableUpdate(); long Notify( NotifyEvent& _rNEvt ); + long PreNotify( NotifyEvent& _rNEvt ); void SetListener( IPropertyLineListener* _pListener ); void SetObserver( IPropertyControlObserver* _pObserver ); diff --git a/extensions/source/propctrlr/eformspropertyhandler.cxx b/extensions/source/propctrlr/eformspropertyhandler.cxx index d0ac0de3857a..b200d37cb83b 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.cxx +++ b/extensions/source/propctrlr/eformspropertyhandler.cxx @@ -412,6 +412,18 @@ namespace pcr } //-------------------------------------------------------------------- + Sequence< ::rtl::OUString > SAL_CALL EFormsPropertyHandler::getSupersededProperties( ) throw (RuntimeException) + { + ::osl::MutexGuard aGuard( m_aMutex ); + if ( !m_pHelper.get() ) + return Sequence< ::rtl::OUString >(); + + Sequence< ::rtl::OUString > aReturn( 1 ); + aReturn[ 0 ] = PROPERTY_INPUT_REQUIRED; + return aReturn; + } + + //-------------------------------------------------------------------- LineDescriptor SAL_CALL EFormsPropertyHandler::describePropertyLine( const ::rtl::OUString& _rPropertyName, const Reference< XPropertyControlFactory >& _rxControlFactory ) throw (UnknownPropertyException, NullPointerException, RuntimeException) diff --git a/extensions/source/propctrlr/eformspropertyhandler.hxx b/extensions/source/propctrlr/eformspropertyhandler.hxx index 700cf43431cf..55c464d77076 100644 --- a/extensions/source/propctrlr/eformspropertyhandler.hxx +++ b/extensions/source/propctrlr/eformspropertyhandler.hxx @@ -77,6 +77,8 @@ namespace pcr virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Any& _rValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getActuatingProperties( ) throw (::com::sun::star::uno::RuntimeException); + virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > + SAL_CALL getSupersededProperties( ) throw (::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::inspection::LineDescriptor SAL_CALL describePropertyLine( const ::rtl::OUString& _rPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::inspection::XPropertyControlFactory >& _rxControlFactory ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::NullPointerException, ::com::sun::star::uno::RuntimeException); virtual ::com::sun::star::inspection::InteractiveSelectionResult diff --git a/extensions/source/propctrlr/eventhandler.cxx b/extensions/source/propctrlr/eventhandler.cxx index 4d7c09563b5d..05d0984349b4 100644 --- a/extensions/source/propctrlr/eventhandler.cxx +++ b/extensions/source/propctrlr/eventhandler.cxx @@ -53,6 +53,7 @@ #include <com/sun/star/container/XIndexAccess.hpp> #include <com/sun/star/container/XNameContainer.hpp> #include <com/sun/star/container/XNameReplace.hpp> +#include <com/sun/star/form/FormComponentType.hpp> #include <com/sun/star/form/XForm.hpp> #include <com/sun/star/form/XFormController.hpp> #include <com/sun/star/inspection/PropertyControlType.hpp> @@ -146,6 +147,7 @@ namespace pcr /** === end UNO using === **/ namespace PropertyControlType = ::com::sun::star::inspection::PropertyControlType; namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute; + namespace FormComponentType = ::com::sun::star::form::FormComponentType; //==================================================================== //= EventDescription @@ -538,6 +540,7 @@ namespace pcr ,m_aPropertyListeners( m_aMutex ) ,m_bEventsMapInitialized( false ) ,m_bIsDialogElement( false ) + ,m_nGridColumnType( -1 ) { DBG_CTOR( EventHandler, NULL ); } @@ -602,6 +605,7 @@ namespace pcr m_aEvents.swap( aEmpty ); m_bIsDialogElement = false; + m_nGridColumnType = -1; try { Reference< XPropertySetInfo > xPSI( m_xComponent->getPropertySetInfo() ); @@ -610,6 +614,15 @@ namespace pcr && xPSI->hasPropertyByName( PROPERTY_HEIGHT ) && xPSI->hasPropertyByName( PROPERTY_POSITIONX ) && xPSI->hasPropertyByName( PROPERTY_POSITIONY ); + + Reference< XChild > xAsChild( _rxIntrospectee, UNO_QUERY ); + if ( xAsChild.is() && !Reference< XForm >( _rxIntrospectee, UNO_QUERY ).is() ) + { + if ( FormComponentType::GRIDCONTROL == classifyComponent( xAsChild->getParent() ) ) + { + m_nGridColumnType = classifyComponent( _rxIntrospectee ); + } + } } catch( const Exception& ) { @@ -827,12 +840,15 @@ namespace pcr const ::rtl::OUString* pMethods = aMethods.getConstArray(); sal_uInt32 methodCount = aMethods.getLength(); - for (sal_uInt32 method = 0 ; method < methodCount ; method++,++pMethods ) + for (sal_uInt32 method = 0 ; method < methodCount ; ++method, ++pMethods ) { EventDescription aEvent; if ( !lcl_getEventDescriptionForMethod( *pMethods, aEvent ) ) continue; + if ( !impl_filterMethod_nothrow( aEvent ) ) + continue; + const_cast< EventHandler* >( this )->m_aEvents.insert( EventMap::value_type( lcl_getEventPropertyName( sListenerClassName, *pMethods ), aEvent ) ); } @@ -1272,6 +1288,29 @@ namespace pcr } } + //-------------------------------------------------------------------- + bool EventHandler::impl_filterMethod_nothrow( const EventDescription& _rEvent ) const + { + // some (control-triggered) events do not make sense for certain grid control columns. However, + // our mechnism to retrieve control-triggered events does not know about this, so we do some + // late filtering here. + switch ( m_nGridColumnType ) + { + case FormComponentType::COMBOBOX: + if ( UID_BRWEVT_ACTIONPERFORMED == _rEvent.nUniqueBrowseId ) + return false; + break; + case FormComponentType::LISTBOX: + if ( ( UID_BRWEVT_CHANGED == _rEvent.nUniqueBrowseId ) + || ( UID_BRWEVT_ACTIONPERFORMED == _rEvent.nUniqueBrowseId ) + ) + return false; + break; + } + + return true; + } + //........................................................................ } // namespace pcr //........................................................................ diff --git a/extensions/source/propctrlr/eventhandler.hxx b/extensions/source/propctrlr/eventhandler.hxx index a68fe100afb4..dcb70f8fd2b3 100644 --- a/extensions/source/propctrlr/eventhandler.hxx +++ b/extensions/source/propctrlr/eventhandler.hxx @@ -107,6 +107,8 @@ namespace pcr /// is our introspectee a dialog element? bool m_bIsDialogElement; // TODO: move different handling into different derived classes? + /// (FormComponent) type of the grid column being inspected, or -1 if we're not inspecting a grid column + sal_Int16 m_nGridColumnType; public: // XServiceInfo - static versions @@ -248,6 +250,12 @@ namespace pcr ::com::sun::star::uno::Reference< ::com::sun::star::frame::XFrame > impl_getContextFrame_nothrow() const; + /** approves or denies a certain method to be included in the UI + @return + <TRUE/> if and only if the given method is allowed. + */ + bool impl_filterMethod_nothrow( const EventDescription& _rEvent ) const; + private: EventHandler(); // never implemented EventHandler( const EventHandler& ); // never implemented diff --git a/extensions/source/propctrlr/formbrowsertools.cxx b/extensions/source/propctrlr/formbrowsertools.cxx index 898a618f53a0..ccce47a7346d 100644 --- a/extensions/source/propctrlr/formbrowsertools.cxx +++ b/extensions/source/propctrlr/formbrowsertools.cxx @@ -53,6 +53,7 @@ namespace pcr using namespace ::com::sun::star::lang; using namespace ::com::sun::star::beans; + //------------------------------------------------------------------------ ::rtl::OUString GetUIHeadlineName(sal_Int16 nClassId, const Any& aUnoObj) { PcrClient aResourceAccess; @@ -130,6 +131,20 @@ namespace pcr return sClassName; } + //------------------------------------------------------------------------ + sal_Int16 classifyComponent( const Reference< XInterface >& _rxComponent ) + { + Reference< XPropertySet > xComponentProps( _rxComponent, UNO_QUERY_THROW ); + Reference< XPropertySetInfo > xPSI( xComponentProps->getPropertySetInfo(), UNO_SET_THROW ); + + sal_Int16 nControlType( FormComponentType::CONTROL ); + if ( xPSI->hasPropertyByName( PROPERTY_CLASSID ) ) + { + OSL_VERIFY( xComponentProps->getPropertyValue( PROPERTY_CLASSID ) >>= nControlType ); + } + return nControlType; + } + //............................................................................ } // namespace pcr //............................................................................ diff --git a/extensions/source/propctrlr/formbrowsertools.hxx b/extensions/source/propctrlr/formbrowsertools.hxx index 6fb0c732ea1f..760aa9cb6d42 100644 --- a/extensions/source/propctrlr/formbrowsertools.hxx +++ b/extensions/source/propctrlr/formbrowsertools.hxx @@ -44,6 +44,7 @@ namespace pcr //............................................................................ ::rtl::OUString GetUIHeadlineName(sal_Int16 _nClassId, const ::com::sun::star::uno::Any& _rUnoObject); + sal_Int16 classifyComponent( const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >& _rxComponent ); //======================================================================== struct FindPropertyByHandle : public ::std::unary_function< ::com::sun::star::beans::Property, bool > diff --git a/extensions/source/propctrlr/makefile.mk b/extensions/source/propctrlr/makefile.mk index c043850e3c73..9b9ffe47aa15 100644 --- a/extensions/source/propctrlr/makefile.mk +++ b/extensions/source/propctrlr/makefile.mk @@ -120,6 +120,7 @@ SHL1TARGET= $(TARGET)$(DLLPOSTFIX) SHL1VERSIONMAP= $(TARGET).map SHL1STDLIBS= \ + $(SVXCORELIB) \ $(SVXLIB) \ $(SFXLIB) \ $(SVTOOLLIB)\ diff --git a/extensions/source/propctrlr/propcontroller.cxx b/extensions/source/propctrlr/propcontroller.cxx index c4dff2512a29..ac9ae434cad6 100644 --- a/extensions/source/propctrlr/propcontroller.cxx +++ b/extensions/source/propctrlr/propcontroller.cxx @@ -114,6 +114,7 @@ namespace pcr ,m_bContainerFocusListening( false ) ,m_bSuspendingPropertyHandlers( false ) ,m_bConstructed( false ) + ,m_bBindingIntrospectee( false ) { DBG_CTOR(OPropertyBrowserController,NULL); } @@ -300,7 +301,13 @@ namespace pcr // it in order to inspect another object. throw VetoException(); } + if ( m_bBindingIntrospectee ) + throw VetoException(); + + m_bBindingIntrospectee = true; impl_rebindToInspectee_nothrow( InterfaceArray( _rObjects.getConstArray(), _rObjects.getConstArray() + _rObjects.getLength() ) ); + m_bBindingIntrospectee = false; + } //-------------------------------------------------------------------- diff --git a/extensions/source/propctrlr/propcontroller.hxx b/extensions/source/propctrlr/propcontroller.hxx index 3254294e4777..bfa55053338b 100644 --- a/extensions/source/propctrlr/propcontroller.hxx +++ b/extensions/source/propctrlr/propcontroller.hxx @@ -168,6 +168,7 @@ namespace pcr bool m_bContainerFocusListening; bool m_bSuspendingPropertyHandlers; bool m_bConstructed; + bool m_bBindingIntrospectee; protected: DECLARE_XINTERFACE() diff --git a/extensions/source/propctrlr/standardcontrol.hxx b/extensions/source/propctrlr/standardcontrol.hxx index ebe5b7c4ed48..d87865c0405c 100644 --- a/extensions/source/propctrlr/standardcontrol.hxx +++ b/extensions/source/propctrlr/standardcontrol.hxx @@ -69,6 +69,7 @@ namespace pcr { protected: typedef ControlWindow< LISTBOX_WINDOW > ListBoxType; + public: ListLikeControlWithModifyHandler( Window* _pParent, WinBits _nStyle ) :ListBoxType( _pParent, _nStyle ) @@ -76,8 +77,35 @@ namespace pcr } void SetModifyHdl( const Link& _rLink ) { ListBoxType::SetSelectHdl( _rLink ); } + + protected: + long PreNotify( NotifyEvent& _rNEvt ); }; + //------------------------------------------------------------------------ + template< class LISTBOX_WINDOW > + long ListLikeControlWithModifyHandler< LISTBOX_WINDOW >::PreNotify( NotifyEvent& _rNEvt ) + { + if ( _rNEvt.GetType() == EVENT_KEYINPUT ) + { + const ::KeyEvent* pKeyEvent = _rNEvt.GetKeyEvent(); + if ( ( pKeyEvent->GetKeyCode().GetModifier() == 0 ) + && ( ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEUP ) + || ( pKeyEvent->GetKeyCode().GetCode() == KEY_PAGEDOWN ) + ) + ) + { + if ( !ListBoxType::IsInDropDown() ) + { + // don't give the base class a chance to consume the event, in the property browser, it is + // intended to scroll the complete property page + return ListBoxType::GetParent()->PreNotify( _rNEvt ); + } + } + } + return ListBoxType::PreNotify( _rNEvt ); + } + //======================================================================== //= OTimeControl //======================================================================== diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx index c0374bbb3ce5..de2e7f272350 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -224,6 +224,19 @@ void SaneDlg::InitFields() maReslBox.SetMin( (long)pDouble[0] ); maReslBox.SetMax( (long)pDouble[1] ); maReslBox.InsertValue( (long)pDouble[0] ); + // mh@openoffice.org: issue 68557: Can only select 75 and 2400 dpi in Scanner dialogue + // scanner allows random setting of dpi resolution, a slider might be useful + // support that + // workaround: offer at least some more standard dpi resolution between + // min and max value + int bGot300 = 0; + for ( int nRes = (long) pDouble[0] * 2; nRes < (long) pDouble[1]; nRes = nRes * 2 ) + { + if ( !bGot300 && nRes > 300 ) { + nRes = 300; bGot300 = 1; + } + maReslBox.InsertValue(nRes); + } maReslBox.InsertValue( (long)pDouble[1] ); } if( pDouble ) diff --git a/extensions/source/scanner/scanunx.cxx b/extensions/source/scanner/scanunx.cxx index 2e0d470b3241..0b1d1e68f9f3 100644 --- a/extensions/source/scanner/scanunx.cxx +++ b/extensions/source/scanner/scanunx.cxx @@ -197,7 +197,14 @@ void ScannerThread::run() void ScannerManager::DestroyData() { - // unused + // was unused, now because of i99835: "Scanning interface not SANE API compliant" + // delete all SaneHolder to get Sane Dtor called + int i; + for ( i = allSanes.Count(); i > 0; i-- ) + { + SaneHolder *pSaneHolder = allSanes.GetObject(i-1); + if ( pSaneHolder ) delete pSaneHolder; + } } // ----------------------------------------------------------------------------- |