diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 08:05:58 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2008-10-01 08:05:58 +0000 |
commit | 4ca5c503bc36f0300bb3f3ec1577ed41df098ab2 (patch) | |
tree | 0e6a4a4fddafd0cafd18601f5345e371c7fe1f99 /stoc | |
parent | c490a9f0684dd5cc7efd897afbf70e2f73444f72 (diff) |
CWS-TOOLING: integrate CWS jsc311
Diffstat (limited to 'stoc')
-rw-r--r-- | stoc/source/security/permissions.cxx | 9 | ||||
-rw-r--r-- | stoc/source/security/permissions.h | 7 | ||||
-rw-r--r-- | stoc/test/excomp/excomp.cxx | 4 | ||||
-rw-r--r-- | stoc/test/excomp/excomp1.cxx | 10 | ||||
-rw-r--r-- | stoc/test/excomp/excomp2.cxx | 10 | ||||
-rw-r--r-- | stoc/test/javavm/testjavavm.cxx | 5 | ||||
-rw-r--r-- | stoc/test/makefile.mk | 7 | ||||
-rw-r--r-- | stoc/test/security/test_security.cxx | 23 | ||||
-rw-r--r-- | stoc/test/testregistry.cxx | 31 | ||||
-rw-r--r-- | stoc/test/testsmgr.cxx | 13 | ||||
-rw-r--r-- | stoc/test/testsmgr2.cxx | 3 |
11 files changed, 50 insertions, 72 deletions
diff --git a/stoc/source/security/permissions.cxx b/stoc/source/security/permissions.cxx index 5e08c190d079..2d8a655dade6 100644 --- a/stoc/source/security/permissions.cxx +++ b/stoc/source/security/permissions.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: permissions.cxx,v $ - * $Revision: 1.11 $ + * $Revision: 1.11.16.1 $ * * This file is part of OpenOffice.org. * @@ -544,6 +544,7 @@ PermissionCollection::PermissionCollection( } } } +#ifdef __DIAGNOSE //__________________________________________________________________________________________________ Sequence< OUString > PermissionCollection::toStrings() const SAL_THROW( () ) { @@ -556,6 +557,7 @@ Sequence< OUString > PermissionCollection::toStrings() const SAL_THROW( () ) return Sequence< OUString >( strings.empty() ? 0 : &strings[ 0 ], strings.size() ); } +#endif //__________________________________________________________________________________________________ inline static bool __implies( ::rtl::Reference< Permission > const & head, Permission const & demanded ) SAL_THROW( () ) @@ -567,11 +569,6 @@ inline static bool __implies( } return false; } -//__________________________________________________________________________________________________ -bool PermissionCollection::implies( Permission const & perm ) const SAL_THROW( () ) -{ - return __implies( m_head, perm ); -} #ifdef __DIAGNOSE //-------------------------------------------------------------------------------------------------- diff --git a/stoc/source/security/permissions.h b/stoc/source/security/permissions.h index c7d4ab5d4c79..c86f882b9e07 100644 --- a/stoc/source/security/permissions.h +++ b/stoc/source/security/permissions.h @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: permissions.h,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.16.1 $ * * This file is part of OpenOffice.org. * @@ -93,10 +93,9 @@ public: ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > const & permissions, PermissionCollection const & addition = PermissionCollection() ) SAL_THROW( (::com::sun::star::uno::RuntimeException) ); - +#ifdef __DIAGNOSE ::com::sun::star::uno::Sequence< ::rtl::OUString > toStrings() const SAL_THROW( () ); - - bool implies( Permission const & ) const SAL_THROW( () ); +#endif void checkPermission( ::com::sun::star::uno::Any const & perm ) const SAL_THROW( (::com::sun::star::uno::RuntimeException) ); }; diff --git a/stoc/test/excomp/excomp.cxx b/stoc/test/excomp/excomp.cxx index 3bb75f7d006d..894b451ee7cf 100644 --- a/stoc/test/excomp/excomp.cxx +++ b/stoc/test/excomp/excomp.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: excomp.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.16.1 $ * * This file is part of OpenOffice.org. * @@ -96,7 +96,7 @@ SAL_IMPLEMENT_MAIN() typelib_TypeDescription* pTypeDesc = NULL; OUString sType = OUString::createFromAscii("com.sun.star.text.XTextDocument"); typelib_typedescription_getByName( &pTypeDesc, sType.pData); - typelib_InterfaceTypeDescription* pInterDesc = (typelib_InterfaceTypeDescription*)pTypeDesc; +// typelib_InterfaceTypeDescription* pInterDesc = (typelib_InterfaceTypeDescription*)pTypeDesc; Reference< XInterface > xIFace = xSMgr->createInstance(OUString::createFromAscii("com.sun.star.registry.ImplementationRegistration")); Reference< XImplementationRegistration > xImpReg( xIFace, UNO_QUERY); diff --git a/stoc/test/excomp/excomp1.cxx b/stoc/test/excomp/excomp1.cxx index cf6ac99c4531..7d13036f4153 100644 --- a/stoc/test/excomp/excomp1.cxx +++ b/stoc/test/excomp/excomp1.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: excomp1.cxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.16.1 $ * * This file is part of OpenOffice.org. * @@ -157,13 +157,13 @@ extern "C" { //================================================================================================== void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) + const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) + void * /* pServiceManager */ , void * pRegistryKey ) { if (pRegistryKey) { @@ -174,7 +174,7 @@ sal_Bool SAL_CALL component_writeInfo( reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME1 "/UNO/SERVICES") ) ) ); - Sequence< OUString > & rSNL = + const Sequence< OUString > & rSNL = ::excomp_impl::ExampleComponent1Impl::getSupportedServiceNames_Static(); const OUString * pArray = rSNL.getConstArray(); for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) @@ -191,7 +191,7 @@ sal_Bool SAL_CALL component_writeInfo( } //================================================================================================== void * SAL_CALL component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) + const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { void * pRet = 0; diff --git a/stoc/test/excomp/excomp2.cxx b/stoc/test/excomp/excomp2.cxx index 406e036d0da0..5afade088088 100644 --- a/stoc/test/excomp/excomp2.cxx +++ b/stoc/test/excomp/excomp2.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: excomp2.cxx,v $ - * $Revision: 1.5 $ + * $Revision: 1.5.16.1 $ * * This file is part of OpenOffice.org. * @@ -228,13 +228,13 @@ extern "C" { //================================================================================================== void SAL_CALL component_getImplementationEnvironment( - const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv ) + const sal_Char ** ppEnvTypeName, uno_Environment ** /* ppEnv */ ) { *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME; } //================================================================================================== sal_Bool SAL_CALL component_writeInfo( - void * pServiceManager, void * pRegistryKey ) + void * /* pServiceManager */, void * pRegistryKey ) { if (pRegistryKey) { @@ -245,7 +245,7 @@ sal_Bool SAL_CALL component_writeInfo( reinterpret_cast< XRegistryKey * >( pRegistryKey )->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM("/" IMPLNAME2 "/UNO/SERVICES") ) ) ); - Sequence< OUString > & rSNL = + const Sequence< OUString > & rSNL = ::excomp2_impl::ExampleComponent2Impl::getSupportedServiceNames_Static(); const OUString * pArray = rSNL.getConstArray(); for ( sal_Int32 nPos = rSNL.getLength(); nPos--; ) @@ -262,7 +262,7 @@ sal_Bool SAL_CALL component_writeInfo( } //================================================================================================== void * SAL_CALL component_getFactory( - const sal_Char * pImplName, void * pServiceManager, void * pRegistryKey ) + const sal_Char * pImplName, void * pServiceManager, void * /* pRegistryKey */ ) { void * pRet = 0; diff --git a/stoc/test/javavm/testjavavm.cxx b/stoc/test/javavm/testjavavm.cxx index c8c7091d45e6..4ccf31deb675 100644 --- a/stoc/test/javavm/testjavavm.cxx +++ b/stoc/test/javavm/testjavavm.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: testjavavm.cxx,v $ - * $Revision: 1.9 $ + * $Revision: 1.9.16.1 $ * * This file is part of OpenOffice.org. * @@ -144,7 +144,8 @@ sal_Bool testJavaVM(const Reference< XMultiServiceFactory > & xMgr ) jmethodID id = p_env->GetStaticMethodID( cls, "getInt", "()I"); if( id) { - jint _i= p_env->CallStaticIntMethod(cls, id); +// jint _i= p_env->CallStaticIntMethod(cls, id); + p_env->CallStaticIntMethod(cls, id); } if( p_env->ExceptionOccurred()){ diff --git a/stoc/test/makefile.mk b/stoc/test/makefile.mk index d5334dee2a48..e8c60aac711b 100644 --- a/stoc/test/makefile.mk +++ b/stoc/test/makefile.mk @@ -8,7 +8,7 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.29 $ +# $Revision: 1.29.6.2 $ # # This file is part of OpenOffice.org. # @@ -86,6 +86,7 @@ APP2STDLIBS= \ $(CPPULIB) \ $(CPPUHELPERLIB) \ $(SALHELPERLIB) \ + $(REGLIB) \ $(SALLIB) # --- Application 3 - testsmgr main ------------------------------------ @@ -95,6 +96,7 @@ APP3STDLIBS= \ $(CPPULIB) \ $(CPPUHELPERLIB) \ $(SALHELPERLIB) \ + $(REGLIB) \ $(SALLIB) .IF "$(GUI)"=="UNX" || "$(GUI)"=="OS2" @@ -199,6 +201,9 @@ TESTPROXYFAC:=com.sun.star.reflection.XProxyFactory TESTSECURITY:=com.sun.star.security.AllPermission;com.sun.star.security.XPolicy;com.sun.star.security.XAccessController;com.sun.star.io.FilePermission;com.sun.star.connection.SocketPermission;com.sun.star.uno.XCurrentContext $(BIN)$/test1.rdb: $(SHL1TARGETN) +.IF "$(GUI)"=="UNX" + cp $(SHL1TARGETN) $(BIN) +.ENDIF cd $(BIN) && regcomp -register -r test1.rdb -c $(SHL1TARGET) $(BIN)$/test2.rdb: diff --git a/stoc/test/security/test_security.cxx b/stoc/test/security/test_security.cxx index 39bdcc2e8a84..ff1d757b22e5 100644 --- a/stoc/test/security/test_security.cxx +++ b/stoc/test/security/test_security.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: test_security.cxx,v $ - * $Revision: 1.8 $ + * $Revision: 1.8.16.1 $ * * This file is part of OpenOffice.org. * @@ -69,7 +69,8 @@ static OUString localhost( OUString const & addition ) SAL_THROW( () ) SocketAddr addr; SocketAddr::resolveHostname( OUSTR("localhost"), addr ); ::oslSocketResult rc = ::osl_getDottedInetAddrOfSocketAddr( addr.getHandle(), &ip.pData ); - OSL_ENSURE( ::osl_Socket_E_None == rc, "### cannot resolve localhost!" ); + if (::osl_Socket_Ok != rc) + fprintf(stdout, "### cannot resolve localhost!" ); } OUStringBuffer buf( 48 ); buf.append( ip ); @@ -190,7 +191,7 @@ Any user_CurrentContext::getValueByName( OUString const & name ) /* grant { -permission com.sun.star.io.FilePermission "file:///usr/bin/*", "read"; +permission com.sun.star.io.FilePermission "file:///usr/bin/ *", "read"; permission com.sun.star.io.FilePermission "file:///tmp/-", "read,write"; permission com.sun.star.io.FilePermission "file:///etc/profile", "read"; @@ -248,7 +249,7 @@ grant user "dbo" { permission com.sun.star.io.FilePermission "file:///home/dbo/-", "read,write"; permission com.sun.star.io.FilePermission "-", "read,write"; -permission com.sun.star.io.FilePermission "file:///usr/local/dbo/*", "read"; +permission com.sun.star.io.FilePermission "file:///usr/local/dbo/ *", "read"; permission com.sun.star.security.RuntimePermission "DBO"; @@ -423,13 +424,13 @@ Any Action::run() } //================================================================================================== -static void restr_file_permissions( AccessControl & ac ) -{ - // running in dbo's domain - /* permission com.sun.star.io.FilePermission "file:///home/dbo/-", ",,read , write "; */ - CHECK( ac.checkFilePermission( OUSTR("file:///home/dbo/bla"), OUSTR("read,write,execute") ), true ); - CHECK( ac.checkFilePermission( OUSTR("file:///home/dbo/bla"), OUSTR("read,write") ), false ); -} +// static void restr_file_permissions( AccessControl & ac ) +// { +// // running in dbo's domain +// /* permission com.sun.star.io.FilePermission "file:///home/dbo/-", ",,read , write "; */ +// CHECK( ac.checkFilePermission( OUSTR("file:///home/dbo/bla"), OUSTR("read,write,execute") ), true ); +// CHECK( ac.checkFilePermission( OUSTR("file:///home/dbo/bla"), OUSTR("read,write") ), false ); +// } //================================================================================================== static void all_dbo_permissions( AccessControl & ac, Any const & ) { diff --git a/stoc/test/testregistry.cxx b/stoc/test/testregistry.cxx index 978f3618fdab..d04e6facf71d 100644 --- a/stoc/test/testregistry.cxx +++ b/stoc/test/testregistry.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: testregistry.cxx,v $ - * $Revision: 1.21 $ + * $Revision: 1.21.16.2 $ * * This file is part of OpenOffice.org. * @@ -105,6 +105,7 @@ static void mergeKeys( xDestKey->closeKey(); } + OString userRegEnv("STAR_USER_REGISTRY="); OUString getExePath() @@ -121,16 +122,7 @@ OUString getExePath() void setStarUserRegistry() { - RegistryLoader* pLoader = new RegistryLoader(); - - if (!pLoader->isLoaded()) - { - delete pLoader; - return; - } - - Registry *myRegistry = new Registry(*pLoader); - delete pLoader; + Registry *myRegistry = new Registry(); RegistryKey rootKey, rKey, rKey2; @@ -150,16 +142,7 @@ void setStarUserRegistry() void setLinkInDefaultRegistry(const OUString& linkName, const OUString& linkTarget) { - RegistryLoader* pLoader = new RegistryLoader(); - - if (!pLoader->isLoaded()) - { - delete pLoader; - return; - } - - Registry *myRegistry = new Registry(*pLoader); - delete pLoader; + Registry *myRegistry = new Registry(); RegistryKey rootKey; @@ -687,9 +670,9 @@ void test_DefaultRegistry( SAL_IMPLEMENT_MAIN() { - setStarUserRegistry(); - setLinkInDefaultRegistry(OUString::createFromAscii("/Test/DefaultLink"), - OUString::createFromAscii("/Test/FifthKey/MyFirstLink")); +// setStarUserRegistry(); + setLinkInDefaultRegistry(OUString::createFromAscii("/Test/DefaultLink"), + OUString::createFromAscii("/Test/FifthKey/MyFirstLink")); OUString reg1( RTL_CONSTASCII_USTRINGPARAM("testreg1.rdb") ); OUString reg2( RTL_CONSTASCII_USTRINGPARAM("testreg2.rdb") ); diff --git a/stoc/test/testsmgr.cxx b/stoc/test/testsmgr.cxx index 7d7467f9c963..add5da03a59d 100644 --- a/stoc/test/testsmgr.cxx +++ b/stoc/test/testsmgr.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: testsmgr.cxx,v $ - * $Revision: 1.13 $ + * $Revision: 1.13.16.1 $ * * This file is part of OpenOffice.org. * @@ -77,16 +77,7 @@ OUString getExePath() void setStarUserRegistry() { - RegistryLoader* pLoader = new RegistryLoader(); - - if (!pLoader->isLoaded()) - { - delete pLoader; - return; - } - - Registry *myRegistry = new Registry(*pLoader); - delete pLoader; + Registry *myRegistry = new Registry(); RegistryKey rootKey, rKey, rKey2; diff --git a/stoc/test/testsmgr2.cxx b/stoc/test/testsmgr2.cxx index b5f639bab46a..81f8f1043e27 100644 --- a/stoc/test/testsmgr2.cxx +++ b/stoc/test/testsmgr2.cxx @@ -7,7 +7,7 @@ * OpenOffice.org - a multi-platform office productivity suite * * $RCSfile: testsmgr2.cxx,v $ - * $Revision: 1.7 $ + * $Revision: 1.7.16.1 $ * * This file is part of OpenOffice.org. * @@ -42,6 +42,7 @@ #include <com/sun/star/lang/XInitialization.hpp> #include <com/sun/star/lang/DisposedException.hpp> #include <com/sun/star/lang/XComponent.hpp> +#include <com/sun/star/uno/XComponentContext.hpp> using namespace ::rtl; using namespace ::cppu; |