diff options
Diffstat (limited to 'desktop/source/deployment/registry')
42 files changed, 477 insertions, 477 deletions
diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx index 7de93a00cd86..09f06638ecde 100644 --- a/desktop/source/deployment/registry/component/dp_compbackenddb.cxx +++ b/desktop/source/deployment/registry/component/dp_compbackenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -87,7 +87,7 @@ void ComponentBackendDb::addEntry(::rtl::OUString const & url, Data const & data writeSimpleElement(OUSTR("java-type-library"), OUString::valueOf((sal_Bool) data.javaTypeLibrary), componentNode); - + writeSimpleList( data.implementationNames, OUSTR("implementation-names"), @@ -101,7 +101,7 @@ void ComponentBackendDb::addEntry(::rtl::OUString const & url, Data const & data OUSTR("key"), OUSTR("value"), componentNode); - + save(); } catch(css::uno::Exception &) @@ -124,7 +124,7 @@ ComponentBackendDb::Data ComponentBackendDb::getEntry(::rtl::OUString const & ur bool bJava = readSimpleElement(OUSTR("java-type-library"), aNode) .equals(OUSTR("true")) ? true : false; retData.javaTypeLibrary = bJava; - + retData.implementationNames = readList( aNode, diff --git a/desktop/source/deployment/registry/component/dp_compbackenddb.hxx b/desktop/source/deployment/registry/component/dp_compbackenddb.hxx index 2e0e39eea29c..8af1ad639622 100644 --- a/desktop/source/deployment/registry/component/dp_compbackenddb.hxx +++ b/desktop/source/deployment/registry/component/dp_compbackenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ namespace component { /* The XML file stores the extensions which are currently registered. They will be removed when they are revoked. The format looks like this: - + <?xml version="1.0"?> <component-backend-db xmlns="http://openoffice.org/extensionmanager/component-registry/2010"> <component url="vnd.sun.star.expand:$UNO_USER_PACKAGES_CACHE/uno_packages/5CD5.tmp_/leaves1.oxt/extensionoptions.jar"> @@ -81,7 +81,7 @@ namespace component { </component-backend-db> */ class ComponentBackendDb: public dp_registry::backend::BackendDb -{ +{ protected: virtual ::rtl::OUString getDbNSName(); virtual ::rtl::OUString getNSPrefix(); diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx index 535e261f7b1b..b1e22d35c0a0 100644 --- a/desktop/source/deployment/registry/component/dp_component.cxx +++ b/desktop/source/deployment/registry/component/dp_component.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -91,7 +91,7 @@ typedef ::std::vector< ::std::pair<OUString, OUString> > t_stringpairvec; if (arg.matchAsciiL("-env:", 5)) ret.push_back(arg); } - return ret; + return ret; } bool jarManifestHeaderPresent( @@ -123,17 +123,17 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend const OUString m_loader; ComponentBackendDb::Data m_registeredComponentsDb; - + enum reg { REG_UNINIT, REG_VOID, REG_REGISTERED, REG_NOT_REGISTERED, REG_MAYBE_REGISTERED } m_registered; - + Reference<loader::XImplementationLoader> getComponentInfo( t_stringlist * pImplNames, t_stringpairvec * pSingletons, Reference<XComponentContext> const & xContext ); - + virtual void SAL_CALL disposing(); - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -145,13 +145,13 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend bool startup, ::rtl::Reference<AbortChannel> const & abortChannel, Reference<XCommandEnvironment> const & xCmdEnv ); - + const Reference<registry::XSimpleRegistry> getRDB() const; - + //Provides the read-only registry (e.g. not the one based on the duplicated //rdb files const Reference<registry::XSimpleRegistry> getRDB_RO() const; - + public: ComponentPackageImpl( ::rtl::Reference<PackageRegistryBackend> const & myBackend, @@ -161,16 +161,16 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend OUString const & identifier); }; friend class ComponentPackageImpl; - + class TypelibraryPackageImpl : public ::dp_registry::backend::Package { BackendImpl * getMyBackend() const; - + const bool m_jarFile; Reference<container::XHierarchicalNameAccess> m_xTDprov; - + virtual void SAL_CALL disposing(); - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -182,7 +182,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend bool startup, ::rtl::Reference<AbortChannel> const & abortChannel, Reference<XCommandEnvironment> const & xCmdEnv ); - + public: TypelibraryPackageImpl( ::rtl::Reference<PackageRegistryBackend> const & myBackend, @@ -192,36 +192,36 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend OUString const & identifier); }; friend class TypelibraryPackageImpl; - + t_stringlist m_jar_typelibs; t_stringlist m_rdb_typelibs; t_stringlist & getTypelibs( bool jar ) { return jar ? m_jar_typelibs : m_rdb_typelibs; } - + bool m_unorc_inited; bool m_unorc_modified; bool bSwitchedRdbFiles; - + typedef ::std::hash_map< OUString, Reference<XInterface>, ::rtl::OUStringHash > t_string2object; t_string2object m_backendObjects; - + // PackageRegistryBackend virtual Reference<deployment::XPackage> bindPackage_( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv ); - + virtual void SAL_CALL disposing(); - + const Reference<deployment::XPackageTypeInfo> m_xDynComponentTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xJavaComponentTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xPythonComponentTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xRDBTypelibTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xJavaTypelibTypeInfo; Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos; - + OUString m_commonRDB; OUString m_nativeRDB; @@ -236,37 +236,37 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend ComponentBackendDb::Data readDataFromDb(OUString const & url); - //These rdbs are for writing new service entries. The rdb files are copies + //These rdbs are for writing new service entries. The rdb files are copies //which are created when services are added or removed. Reference<registry::XSimpleRegistry> m_xCommonRDB; Reference<registry::XSimpleRegistry> m_xNativeRDB; //These rdbs are created on the read-only rdbs which are already used - //by UNO since the startup of the current session. + //by UNO since the startup of the current session. Reference<registry::XSimpleRegistry> m_xCommonRDB_RO; Reference<registry::XSimpleRegistry> m_xNativeRDB_RO; - + void unorc_verify_init( Reference<XCommandEnvironment> const & xCmdEnv ); void unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ); - + Reference<XInterface> getObject( OUString const & id ); Reference<XInterface> insertObject( OUString const & id, Reference<XInterface> const & xObject ); void releaseObject( OUString const & id ); - + bool addToUnoRc( bool jarFile, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); bool removeFromUnoRc( bool jarFile, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); bool hasInUnoRc( bool jarFile, OUString const & url ); - - + + public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -342,12 +342,12 @@ BackendImpl * BackendImpl::ComponentPackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //Throws a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<ComponentPackageImpl *>(this))); } return pBackend; @@ -382,7 +382,7 @@ void BackendImpl::disposing() m_xCommonRDB.clear(); } unorc_flush( Reference<XCommandEnvironment>() ); - + PackageRegistryBackend::disposing(); } catch (RuntimeException &) { @@ -479,7 +479,7 @@ void BackendImpl::initServiceRdbFiles_RO() const Reference<XCommandEnvironment> xCmdEnv; // common rdb for java, native rdb for shared lib components - if (m_commonRDB_RO.getLength() > 0) + if (m_commonRDB_RO.getLength() > 0) { m_xCommonRDB_RO.set( m_xComponentContext->getServiceManager() @@ -488,10 +488,10 @@ void BackendImpl::initServiceRdbFiles_RO() m_xComponentContext), UNO_QUERY_THROW); m_xCommonRDB_RO->open( makeURL(expandUnoRcUrl(getCachePath()), m_commonRDB_RO), - sal_True, //read-only + sal_True, //read-only sal_True); // create data source if necessary } - if (m_nativeRDB_RO.getLength() > 0) + if (m_nativeRDB_RO.getLength() > 0) { m_xNativeRDB_RO.set( m_xComponentContext->getServiceManager() @@ -500,7 +500,7 @@ void BackendImpl::initServiceRdbFiles_RO() m_xComponentContext), UNO_QUERY_THROW); m_xNativeRDB_RO->open( makeURL(expandUnoRcUrl(getCachePath()), m_nativeRDB_RO), - sal_True, //read-only + sal_True, //read-only sal_True); // create data source if necessary } } @@ -561,9 +561,9 @@ BackendImpl::BackendImpl( m_typeInfos[ 2 ] = m_xPythonComponentTypeInfo; m_typeInfos[ 3 ] = m_xRDBTypelibTypeInfo; m_typeInfos[ 4 ] = m_xJavaTypelibTypeInfo; - + const Reference<XCommandEnvironment> xCmdEnv; - + if (transientMode()) { // in-mem rdbs: @@ -677,7 +677,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( StrCannotDetectMediaType::get() + url, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); } - + String type, subType; INetContentTypeParameterList params; if (INetContentTypes::parse( mediaType, type, subType, ¶ms )) @@ -691,11 +691,11 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( name = ucbContent.getPropertyValue( StrTitle::get() ).get<OUString>(); } - + if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.uno-component")) { // xxx todo: probe and evaluate component xml description - + INetContentTypeParameter const * param = params.find( ByteString("platform") ); if (param == 0 || platform_fits( param->m_sValue )) { @@ -777,7 +777,7 @@ void BackendImpl::unorc_verify_init( sal_Int32 index = sizeof ("UNO_JAVA_CLASSPATH=") - 1; do { OUString token( line.getToken( 0, ' ', index ).trim() ); - if (token.getLength() > 0) + if (token.getLength() > 0) { if (create_ucb_content( 0, expandUnoRcTerm(token), xCmdEnv, @@ -798,7 +798,7 @@ void BackendImpl::unorc_verify_init( sal_Int32 index = sizeof ("UNO_TYPES=") - 1; do { OUString token( line.getToken( 0, ' ', index ).trim() ); - if (token.getLength() > 0) + if (token.getLength() > 0) { if (token[ 0 ] == '?') token = token.copy( 1 ); @@ -823,7 +823,7 @@ void BackendImpl::unorc_verify_init( OSL_ASSERT( sep > 0 ); m_commonRDB_RO = line.copy( start, sep - start ); } - + // native rc: if (create_ucb_content( &ucb_content, @@ -848,7 +848,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) return; if (!m_unorc_inited || !m_unorc_modified) return; - + ::rtl::OStringBuffer buf; buf.append(RTL_CONSTASCII_STRINGPARAM("ORIGIN=")); @@ -856,7 +856,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) ::rtl::OString osOrigin = ::rtl::OUStringToOString(sOrigin, RTL_TEXTENCODING_UTF8); buf.append(osOrigin); buf.append(LF); - + if (! m_jar_typelibs.empty()) { t_stringlist::const_iterator iPos( m_jar_typelibs.begin() ); @@ -892,7 +892,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) } // If we duplicated the common or native rdb then we must use those urls - //otherwise we use those of the original files. That is, m_commonRDB_RO and + //otherwise we use those of the original files. That is, m_commonRDB_RO and //m_nativeRDB_RO; OUString sCommonRDB(m_commonRDB.getLength() > 0 ? m_commonRDB : m_commonRDB_RO); OUString sNativeRDB(m_nativeRDB.getLength() > 0 ? m_nativeRDB : m_nativeRDB_RO); @@ -907,7 +907,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) buf.append( RTL_CONSTASCII_STRINGPARAM( " ${$ORIGIN/${_OS}_${_ARCH}rc:UNO_SERVICES}") ); buf.append(LF); - + // write native rc: ::rtl::OStringBuffer buf2; buf2.append(RTL_CONSTASCII_STRINGPARAM("ORIGIN=")); @@ -917,7 +917,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) buf2.append( ::rtl::OUStringToOString( sNativeRDB, RTL_TEXTENCODING_ASCII_US ) ); buf2.append(LF); - + const Reference<io::XInputStream> xData( ::xmlscript::createInputStream( ::rtl::ByteSequence( @@ -929,7 +929,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) ucb_content.writeStream( xData, true /* replace existing */ ); } } - + // write unorc: const Reference<io::XInputStream> xData( ::xmlscript::createInputStream( @@ -939,7 +939,7 @@ void BackendImpl::unorc_flush( Reference<XCommandEnvironment> const & xCmdEnv ) ::ucbhelper::Content ucb_content( makeURL( getCachePath(), OUSTR("unorc") ), xCmdEnv ); ucb_content.writeStream( xData, true /* replace existing */ ); - + m_unorc_modified = false; } @@ -980,7 +980,7 @@ bool BackendImpl::removeFromUnoRc( //______________________________________________________________________________ bool BackendImpl::hasInUnoRc( bool jarFile, OUString const & url_ ) -{ +{ const OUString rcterm( dp_misc::makeRcTerm(url_) ); const ::osl::MutexGuard guard( getMutex() ); t_stringlist const & rSet = getTypelibs(jarFile); @@ -1040,7 +1040,7 @@ Reference<XComponentContext> raise_uno_process( buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(";urp;uno.ComponentContext") ); const OUString connectStr( buf.makeStringAndClear() ); - + // raise core UNO process to register/run a component, // javavm service uses unorc next to executable to retrieve deployed // jar typelibs @@ -1058,7 +1058,7 @@ Reference<XComponentContext> raise_uno_process( //now add the bootstrap variables which were supplied on the command line ::std::vector<OUString> bootvars = getCmdBootstrapVariables(); args.insert(args.end(), bootvars.begin(), bootvars.end()); - + oslProcess hProcess = raiseProcess( url, comphelper::containerToSequence(args) ); try { @@ -1087,18 +1087,18 @@ BackendImpl::ComponentPackageImpl::getComponentInfo( m_loader, xContext ), UNO_QUERY ); if (! xLoader.is()) return Reference<loader::XImplementationLoader>(); - + // HACK: highly dependent on stoc/source/servicemanager // and stoc/source/implreg implementation which rely on the same // services.rdb format! - + const Reference<registry::XSimpleRegistry> xMemReg( xContext->getServiceManager()->createInstanceWithContext( OUSTR("com.sun.star.registry.SimpleRegistry"), xContext ), UNO_QUERY_THROW ); xMemReg->open( OUString() /* in mem */, false, true ); xLoader->writeRegistryInfo( xMemReg->getRootKey(), OUString(), getURL() ); - + const Sequence< Reference<registry::XRegistryKey> > keys( xMemReg->getRootKey()->openKeys() ); for ( sal_Int32 pos = keys.getLength(); pos--; ) @@ -1106,7 +1106,7 @@ BackendImpl::ComponentPackageImpl::getComponentInfo( Reference<registry::XRegistryKey> const & xImplKey = keys[ pos ]; const OUString implName( xImplKey->getKeyName().copy( 1 /*leading slash*/ ) ); - + // check for singletons: const Reference<registry::XRegistryKey> xSingletonKey( xImplKey->openKey( OUSTR("UNO/SINGLETONS") ) ); @@ -1131,7 +1131,7 @@ BackendImpl::ComponentPackageImpl::getComponentInfo( pImplNames->push_back( implName ); } } - + return xLoader; } @@ -1162,12 +1162,12 @@ BackendImpl::ComponentPackageImpl::isRegistered_( sal_Int32 pos = implNames.getLength(); for ( ; pos--; ) { - checkAborted( abortChannel ); + checkAborted( abortChannel ); const OUString key( pImplNames[ pos ] + OUSTR("/UNO/LOCATION") ); const Reference<registry::XRegistryKey> xKey( xRootKey->openKey(key) ); - if (xKey.is() && xKey->isValid()) + if (xKey.is() && xKey->isValid()) { const OUString location( xKey->getAsciiValue() ); if (location.equalsIgnoreAsciiCase( getURL() )) @@ -1179,7 +1179,7 @@ BackendImpl::ComponentPackageImpl::isRegistered_( //try to match only the file name OUString thisUrl(getURL()); OUString thisFileName(thisUrl.copy(thisUrl.lastIndexOf('/'))); - + OUString locationFileName(location.copy(location.lastIndexOf('/'))); if (locationFileName.equalsIgnoreAsciiCase(thisFileName)) bAmbiguousComponentName = true; @@ -1195,13 +1195,13 @@ BackendImpl::ComponentPackageImpl::isRegistered_( //Different extensions can use the same service implementations. Then the extensions //which was installed last will overwrite the one from the other extension. That is - //the registry will contain the path (the location) of the library or jar of the + //the registry will contain the path (the location) of the library or jar of the //second extension. In this case isRegistered called for the lib of the first extension - //would return "not registered". That would mean that during uninstallation + //would return "not registered". That would mean that during uninstallation //XPackage::registerPackage is not called, because it just was not registered. This is, - //however, necessary for jar files. Registering and unregistering update + //however, necessary for jar files. Registering and unregistering update //uno_packages/cache/registry/com.sun.star.comp.deployment.component.PackageRegistryBackend/unorc - //Therefore, we will return always "is ambiguous" if the path of this component cannot + //Therefore, we will return always "is ambiguous" if the path of this component cannot //be found in the registry and if there is another path and both have the same file name (but //the rest of the path is different). //If the caller cannot precisely determine that this package was registered, then it must @@ -1222,9 +1222,9 @@ void BackendImpl::ComponentPackageImpl::processPackage_( ::rtl::Reference<AbortChannel> const & abortChannel, Reference<XCommandEnvironment> const & xCmdEnv ) { - BackendImpl * that = getMyBackend(); - - + BackendImpl * that = getMyBackend(); + + const bool java = m_loader.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("com.sun.star.loader.Java2") ); const OUString url( getURL() ); @@ -1238,13 +1238,13 @@ void BackendImpl::ComponentPackageImpl::processPackage_( ComponentBackendDb::Data data; data.javaTypeLibrary = isJavaTypelib; if (doRegisterPackage) - { + { Reference <uno::XComponentContext> context(that->getComponentContext()); if (! startup) { context.set( that->getObject( url ), UNO_QUERY ); - + if (! context.is()) { context.set( that->insertObject( url, raise_uno_process( @@ -1253,7 +1253,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( UNO_QUERY_THROW ); } } - + const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() ); const Reference<registry::XImplementationRegistration> xImplReg( context->getServiceManager()->createInstanceWithContext( @@ -1284,7 +1284,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( for ( t_stringlist::const_iterator iPos( implNames.begin() ); iPos != implNames.end(); ++iPos ) { - checkAborted( abortChannel ); + checkAborted( abortChannel ); OUString const & implName = *iPos; // activate factory: const Reference<XInterface> xFactory( @@ -1299,7 +1299,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( OSL_ENSURE( 0, "### factory already registered?" ); } } - + if (! singletons.empty()) { // singletons live insertion: @@ -1340,7 +1340,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( } } } - + m_registered = REG_REGISTERED; getMyBackend()->addDataToDb(url, data); } @@ -1357,7 +1357,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( xContext = that->getComponentContext(); else bRemoteContext = true; - + t_stringlist implNames; t_stringpairvec singletons; if (m_bRemoved) @@ -1385,7 +1385,7 @@ void BackendImpl::ComponentPackageImpl::processPackage_( catch (container::NoSuchElementException &) { } } - + if (! singletons.empty()) { // singletons live removal: @@ -1424,20 +1424,20 @@ void BackendImpl::ComponentPackageImpl::processPackage_( } } } - + const Reference<registry::XSimpleRegistry> xServicesRDB( getRDB() ); const Reference<registry::XImplementationRegistration> xImplReg( xContext->getServiceManager()->createInstanceWithContext( OUSTR("com.sun.star.registry.ImplementationRegistration"), xContext ), UNO_QUERY_THROW ); xImplReg->revokeImplementation( url, xServicesRDB ); - + if (isJavaTypelib) that->removeFromUnoRc( java, url, xCmdEnv ); - + if (bRemoteContext) that->releaseObject( url ); - + m_registered = REG_NOT_REGISTERED; getMyBackend()->deleteDataFromDb(url); } @@ -1460,12 +1460,12 @@ BackendImpl * BackendImpl::TypelibraryPackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<TypelibraryPackageImpl *>(this))); } return pBackend; @@ -1493,11 +1493,11 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_( ::rtl::Reference<AbortChannel> const &, Reference<XCommandEnvironment> const & xCmdEnv ) { - BackendImpl * that = getMyBackend(); + BackendImpl * that = getMyBackend(); const OUString url( getURL() ); if (doRegisterPackage) - { + { // live insertion: if (m_jarFile) { // xxx todo add to classpath at runtime: ??? @@ -1546,13 +1546,13 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_( xSet->insert( Any(m_xTDprov) ); } } - + that->addToUnoRc( m_jarFile, url, xCmdEnv ); } else // revokePackage() - { + { that->removeFromUnoRc( m_jarFile, url, xCmdEnv ); - + // revoking types at runtime, possible, sensible? if (!m_xTDprov.is()) m_xTDprov.set( that->getObject( url ), UNO_QUERY ); @@ -1564,7 +1564,7 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_( "reflection.theTypeDescriptionManager") ), UNO_QUERY_THROW ); xSet->remove( Any(m_xTDprov) ); - + that->releaseObject( url ); m_xTDprov.clear(); } diff --git a/desktop/source/deployment/registry/component/dp_component.hrc b/desktop/source/deployment/registry/component/dp_component.hrc index 53085a48d185..5e9993ab1222 100644 --- a/desktop/source/deployment/registry/component/dp_component.hrc +++ b/desktop/source/deployment/registry/component/dp_component.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/component/dp_component.src b/desktop/source/deployment/registry/component/dp_component.src index 36f2a1cc4a5c..52dfa568ebe3 100644 --- a/desktop/source/deployment/registry/component/dp_component.src +++ b/desktop/source/deployment/registry/component/dp_component.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.cxx b/desktop/source/deployment/registry/configuration/dp_configuration.cxx index 5d89c2deca24..2688a277f947 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configuration.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -76,9 +76,9 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend class PackageImpl : public ::dp_registry::backend::Package { BackendImpl * getMyBackend() const ; - + const bool m_isSchema; - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -90,7 +90,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend bool startup, ::rtl::Reference<AbortChannel> const & abortChannel, Reference<XCommandEnvironment> const & xCmdEnv ); - + public: inline PackageImpl( ::rtl::Reference<PackageRegistryBackend> const & myBackend, @@ -103,41 +103,41 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend {} }; friend class PackageImpl; - + t_stringlist m_xcs_files; t_stringlist m_xcu_files; t_stringlist & getFiles( bool xcs ) { return xcs ? m_xcs_files : m_xcu_files; } - + bool m_configmgrini_inited; bool m_configmgrini_modified; std::auto_ptr<ConfigurationBackendDb> m_backendDb; - + // PackageRegistryBackend virtual Reference<deployment::XPackage> bindPackage_( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, - OUString const & identifier, + OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv ); - + ::std::auto_ptr<PersistentMap> m_registeredPackages; // for backwards compatibility virtual void SAL_CALL disposing(); - + const Reference<deployment::XPackageTypeInfo> m_xConfDataTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xConfSchemaTypeInfo; Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos; - + void configmgrini_verify_init( Reference<XCommandEnvironment> const & xCmdEnv ); void configmgrini_flush( Reference<XCommandEnvironment> const & xCmdEnv ); - + bool addToConfigmgrIni( bool isSchema, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); bool removeFromConfigmgrIni( bool isSchema, OUString const & url, Reference<XCommandEnvironment> const & xCmdEnv ); - + void addDataToDb(OUString const & url, ConfigurationBackendDb::Data const & data); ::boost::optional<ConfigurationBackendDb::Data> readDataFromDb(OUString const & url); OUString deleteDataFromDb(OUString const & url); @@ -146,7 +146,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -159,7 +159,7 @@ void BackendImpl::disposing() { try { configmgrini_flush( Reference<XCommandEnvironment>() ); - + PackageRegistryBackend::disposing(); } catch (RuntimeException &) { @@ -196,9 +196,9 @@ BackendImpl::BackendImpl( { m_typeInfos[ 0 ] = m_xConfDataTypeInfo; m_typeInfos[ 1 ] = m_xConfSchemaTypeInfo; - + const Reference<XCommandEnvironment> xCmdEnv; - + if (transientMode()) { //TODO @@ -221,7 +221,7 @@ BackendImpl::BackendImpl( m_registeredPackages.reset( new PersistentMap( makeURL( getCachePath(), OUSTR("registered_packages.db") ), - false ) ); + false ) ); } } @@ -305,7 +305,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( StrCannotDetectMediaType::get() + url, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); } - + String type, subType; INetContentTypeParameterList params; if (INetContentTypes::parse( mediaType, type, subType, ¶ms )) @@ -409,7 +409,7 @@ void BackendImpl::configmgrini_flush( return; if (!m_configmgrini_inited || !m_configmgrini_modified) return; - + ::rtl::OStringBuffer buf; if (! m_xcs_files.empty()) { @@ -443,7 +443,7 @@ void BackendImpl::configmgrini_flush( } buf.append(LF); } - + // write configmgr.ini: const Reference<io::XInputStream> xData( ::xmlscript::createInputStream( @@ -453,7 +453,7 @@ void BackendImpl::configmgrini_flush( ::ucbhelper::Content ucb_content( makeURL( getCachePath(), OUSTR("configmgr.ini") ), xCmdEnv ); ucb_content.writeStream( xData, true /* replace existing */ ); - + m_configmgrini_modified = false; } @@ -514,12 +514,12 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -541,7 +541,7 @@ BackendImpl::PackageImpl::isRegistered_( //fallback for user extension registered in berkeley DB bReg = that->m_registeredPackages->has( rtl::OUStringToOString( url, RTL_TEXTENCODING_UTF8 )); - + return beans::Optional< beans::Ambiguous<sal_Bool> >( true, beans::Ambiguous<sal_Bool>( bReg, false ) ); } @@ -602,7 +602,7 @@ OUString replaceOrigin( break; index = nBytes; } - + if ((write_pos + index) > filtered.getLength()) filtered.realloc( (filtered.getLength() + index) * 2 ); rtl_copyMemory( filtered.getArray() + write_pos, pBytes, index ); @@ -611,7 +611,7 @@ OUString replaceOrigin( nBytes -= index; if (nBytes == 0) break; - + // consume %: ++pBytes; --nBytes; @@ -675,7 +675,7 @@ void BackendImpl::PackageImpl::processPackage_( { BackendImpl * that = getMyBackend(); OUString url( getURL() ); - + if (doRegisterPackage) { ConfigurationBackendDb::Data data; @@ -767,7 +767,7 @@ void BackendImpl::PackageImpl::processPackage_( expandUnoRcUrl(url)); } } -} +} } // anon namespace diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.hrc b/desktop/source/deployment/registry/configuration/dp_configuration.hrc index 01e1905228b3..479f50e20baf 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.hrc +++ b/desktop/source/deployment/registry/configuration/dp_configuration.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/configuration/dp_configuration.src b/desktop/source/deployment/registry/configuration/dp_configuration.src index 7ff749b18459..3570eaf28fad 100644 --- a/desktop/source/deployment/registry/configuration/dp_configuration.src +++ b/desktop/source/deployment/registry/configuration/dp_configuration.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx index 58a2d7d30177..a0cafe03319c 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx index 7d4d1809ce72..7cb02edf55cc 100644 --- a/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx +++ b/desktop/source/deployment/registry/configuration/dp_configurationbackenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -51,10 +51,10 @@ namespace configuration { They will be removed when they are revoked. */ class ConfigurationBackendDb: public dp_registry::backend::BackendDb -{ +{ protected: virtual ::rtl::OUString getDbNSName(); - + virtual ::rtl::OUString getNSPrefix(); virtual ::rtl::OUString getRootElementName(); diff --git a/desktop/source/deployment/registry/dp_backend.cxx b/desktop/source/deployment/registry/dp_backend.cxx index 09a6a04651bf..957c55ef936b 100644 --- a/desktop/source/deployment/registry/dp_backend.cxx +++ b/desktop/source/deployment/registry/dp_backend.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -28,7 +28,7 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_desktop.hxx" - + #include "dp_backend.h" #include "dp_ucb.h" #include "rtl/uri.hxx" @@ -91,7 +91,7 @@ PackageRegistryBackend::PackageRegistryBackend( m_cachePath = *cachePath; if (readOnly) m_readOnly = *readOnly; - + if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("user") )) m_eContext = CONTEXT_USER; else if (m_context.equalsAsciiL( RTL_CONSTASCII_STRINGPARAM("shared") )) @@ -126,7 +126,7 @@ void PackageRegistryBackend::disposing() i->second->removeEventListener(this); m_bound.clear(); m_xComponentContext.clear(); - WeakComponentImplHelperBase::disposing(); + WeakComponentImplHelperBase::disposing(); } catch (RuntimeException &) { throw; @@ -153,10 +153,10 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage( check(); t_string2ref::const_iterator const iFind( m_bound.find( url ) ); - if (iFind != m_bound.end()) + if (iFind != m_bound.end()) { Reference<deployment::XPackage> xPackage( iFind->second ); - if (xPackage.is()) + if (xPackage.is()) { if (mediaType.getLength() && mediaType != xPackage->getPackageType()->getMediaType()) @@ -167,15 +167,15 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage( throw deployment::InvalidRemovedParameterException( OUSTR("XPackageRegistry::bindPackage: bRemoved parameter does not match"), static_cast<OWeakObject*>(this), xPackage->isRemoved(), xPackage); - return xPackage; + return xPackage; } } guard.clear(); - + Reference<deployment::XPackage> xNewPackage; try { - xNewPackage = bindPackage_( url, mediaType, bRemoved, + xNewPackage = bindPackage_( url, mediaType, bRemoved, identifier, xCmdEnv ); } catch (RuntimeException &) { @@ -196,7 +196,7 @@ Reference<deployment::XPackage> PackageRegistryBackend::bindPackage( OUSTR("Error binding package: ") + url, static_cast<OWeakObject *>(this), exc ); } - + guard.reset(); ::std::pair< t_string2ref::iterator, bool > insertion( @@ -227,7 +227,7 @@ OUString PackageRegistryBackend::createFolder( //make sure the folder exist ucbhelper::Content dataContent; ::dp_misc::create_folder(&dataContent, sDataFolder, xCmdEnv); - + OUString sDataFolderURL = dp_misc::expandUnoRcUrl(sDataFolder); OUString tempEntry; @@ -266,7 +266,7 @@ void PackageRegistryBackend::deleteUnusedFolders( try { const OUString sDataFolder = makeURL(getCachePath(), relUrl); - ::ucbhelper::Content tempFolder( + ::ucbhelper::Content tempFolder( sDataFolder, Reference<ucb::XCommandEnvironment>()); Reference<sdbc::XResultSet> xResultSet( tempFolder.createCursor( @@ -435,14 +435,14 @@ sal_Bool Package::isBundle() throw (RuntimeException) } //______________________________________________________________________________ -::sal_Int32 Package::checkPrerequisites( - const css::uno::Reference< css::task::XAbortChannel >&, +::sal_Int32 Package::checkPrerequisites( + const css::uno::Reference< css::task::XAbortChannel >&, const css::uno::Reference< css::ucb::XCommandEnvironment >&, - sal_Bool) + sal_Bool) throw (css::deployment::DeploymentException, css::deployment::ExtensionRemovedException, - css::ucb::CommandFailedException, - css::ucb::CommandAbortedException, + css::ucb::CommandFailedException, + css::ucb::CommandAbortedException, css::uno::RuntimeException) { if (m_bRemoved) @@ -451,11 +451,11 @@ sal_Bool Package::isBundle() throw (RuntimeException) } //______________________________________________________________________________ -::sal_Bool Package::checkDependencies( - const css::uno::Reference< css::ucb::XCommandEnvironment >& ) +::sal_Bool Package::checkDependencies( + const css::uno::Reference< css::ucb::XCommandEnvironment >& ) throw (css::deployment::DeploymentException, css::deployment::ExtensionRemovedException, - css::ucb::CommandFailedException, + css::ucb::CommandFailedException, css::uno::RuntimeException) { if (m_bRemoved) @@ -485,7 +485,7 @@ beans::Optional<OUString> Package::getIdentifier() throw (RuntimeException) { if (m_bRemoved) return beans::Optional<OUString>(true, m_identifier); - + return beans::Optional<OUString>(); } @@ -528,7 +528,7 @@ Sequence<OUString> Package::getUpdateInformationURLs() throw ( deployment::ExtensionRemovedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); return Sequence<OUString>(); } @@ -537,7 +537,7 @@ css::beans::StringPair Package::getPublisherInfo() throw ( deployment::ExtensionRemovedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); css::beans::StringPair aEmptyPair; return aEmptyPair; } @@ -547,7 +547,7 @@ uno::Reference< css::graphic::XGraphic > Package::getIcon( sal_Bool /*bHighContr throw (deployment::ExtensionRemovedException, RuntimeException ) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); uno::Reference< css::graphic::XGraphic > aEmpty; return aEmpty; @@ -568,7 +568,7 @@ void Package::exportTo( CommandFailedException, CommandAbortedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); ::ucbhelper::Content destFolder( destFolderURL, xCmdEnv ); ::ucbhelper::Content sourceContent( getURL(), xCmdEnv ); @@ -641,7 +641,7 @@ void Package::processPackage_impl( { check(); bool action = false; - + try { try { ::osl::ResettableMutexGuard guard( getMutex() ); @@ -701,7 +701,7 @@ void Package::processPackage_impl( //______________________________________________________________________________ void Package::registerPackage( - sal_Bool startup, + sal_Bool startup, Reference<task::XAbortChannel> const & xAbortChannel, Reference<XCommandEnvironment> const & xCmdEnv ) throw (deployment::DeploymentException, @@ -730,12 +730,12 @@ PackageRegistryBackend * Package::getMyBackend() const { PackageRegistryBackend * pBackend = m_myBackend.get(); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<Package *>(this))); } return pBackend; @@ -753,7 +753,7 @@ beans::Optional< OUString > Package::getRegistrationDataURL() { if (m_bRemoved) throw deployment::ExtensionRemovedException(); - return beans::Optional<OUString>(); + return beans::Optional<OUString>(); } sal_Bool Package::isRemoved() diff --git a/desktop/source/deployment/registry/dp_backenddb.cxx b/desktop/source/deployment/registry/dp_backenddb.cxx index a93bc0b45093..905ff6e95fd0 100644 --- a/desktop/source/deployment/registry/dp_backenddb.cxx +++ b/desktop/source/deployment/registry/dp_backenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -69,11 +69,11 @@ void BackendDb::save() xDataSource->setOutputStream(::xmlscript::createOutputStream(&bytes)); const Reference<css::io::XActiveDataControl> xDataControl(m_doc,css::uno::UNO_QUERY_THROW); xDataControl->start(); - + const Reference<css::io::XInputStream> xData( ::xmlscript::createInputStream(bytes)); ::ucbhelper::Content ucbDb(m_urlDb, 0); - ucbDb.writeStream(xData, true /*replace existing*/); + ucbDb.writeStream(xData, true /*replace existing*/); } css::uno::Reference<css::xml::dom::XDocument> BackendDb::getDocument() @@ -110,7 +110,7 @@ css::uno::Reference<css::xml::dom::XDocument> BackendDb::getDocument() throw css::uno::RuntimeException( OUSTR("Extension manager could not access database file:" ) + m_urlDb, 0); - + if (!m_doc.is()) throw css::uno::RuntimeException( OUSTR("Extension manager could not get root node of data base file: ") @@ -206,7 +206,7 @@ Reference<css::xml::dom::XNode> BackendDb::getKeyElement( const Reference<css::xml::dom::XDocument> doc = getDocument(); const Reference<css::xml::dom::XNode> root = doc->getFirstChild(); const Reference<css::xml::xpath::XXPathAPI> xpathApi = getXPathAPI(); - return xpathApi->selectSingleNode(root, sExpression.makeStringAndClear()); + return xpathApi->selectSingleNode(root, sExpression.makeStringAndClear()); } catch(css::uno::Exception &) { @@ -246,14 +246,14 @@ void BackendDb::writeVectorOfPair( { const Reference<css::xml::dom::XElement> pairNode( doc->createElementNS(sNameSpace, sPrefix + sPairTagName)); - + vectorNode->appendChild( Reference<css::xml::dom::XNode>( pairNode, css::uno::UNO_QUERY_THROW)); - + const Reference<css::xml::dom::XElement> firstNode( doc->createElementNS(sNameSpace, sPrefix + sFirstTagName)); - + pairNode->appendChild( Reference<css::xml::dom::XNode>( firstNode, css::uno::UNO_QUERY_THROW)); @@ -271,7 +271,7 @@ void BackendDb::writeVectorOfPair( pairNode->appendChild( Reference<css::xml::dom::XNode>( secondNode, css::uno::UNO_QUERY_THROW)); - + const Reference<css::xml::dom::XText> secondTextNode( doc->createTextNode( i->second)); @@ -286,7 +286,7 @@ void BackendDb::writeVectorOfPair( throw css::deployment::DeploymentException( OUSTR("Extension Manager: failed to write data entry in backend db: ") + m_urlDb, 0, exc); - } + } } ::std::vector< ::std::pair< OUString, OUString > > @@ -349,20 +349,20 @@ void BackendDb::writeSimpleList( const OUString sNameSpace = getDbNSName(); const OUString sPrefix(getNSPrefix() + OUSTR(":")); const Reference<css::xml::dom::XDocument> doc = getDocument(); - + const Reference<css::xml::dom::XElement> listNode( doc->createElementNS(sNameSpace, sPrefix + sListTagName)); xParent->appendChild( Reference<css::xml::dom::XNode>( listNode, css::uno::UNO_QUERY_THROW)); - + typedef ::std::list<OUString>::const_iterator ITC_ITEMS; for (ITC_ITEMS i = list.begin(); i != list.end(); i++) { const Reference<css::xml::dom::XNode> memberNode( doc->createElementNS(sNameSpace, sPrefix + sMemberTagName), css::uno::UNO_QUERY_THROW); - + listNode->appendChild(memberNode); const Reference<css::xml::dom::XNode> textNode( @@ -582,11 +582,11 @@ void RegisteredDb::addEntry(::rtl::OUString const & url) const OUString sNameSpace = getDbNSName(); const OUString sPrefix = getNSPrefix(); const OUString sEntry = getKeyElementName(); - + Reference<css::xml::dom::XDocument> doc = getDocument(); Reference<css::xml::dom::XNode> root = doc->getFirstChild(); -#if OSL_DEBUG_LEVEL > 0 +#if OSL_DEBUG_LEVEL > 0 //There must not be yet an entry with the same url OUString sExpression( sPrefix + OUSTR(":") + sEntry + OUSTR("[@url = \"") + url + OUSTR("\"]")); @@ -602,7 +602,7 @@ void RegisteredDb::addEntry(::rtl::OUString const & url) Reference<css::xml::dom::XNode> helpNode( helpElement, UNO_QUERY_THROW); root->appendChild(helpNode); - + save(); } catch(css::uno::Exception &) diff --git a/desktop/source/deployment/registry/dp_registry.cxx b/desktop/source/deployment/registry/dp_registry.cxx index bffdaeae1924..a90f64b9cb39 100644 --- a/desktop/source/deployment/registry/dp_registry.cxx +++ b/desktop/source/deployment/registry/dp_registry.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -99,20 +99,20 @@ class PackageRegistryImpl : private MutexHolder, public t_helper ci_string_hash, ci_string_equals > t_string2string; typedef ::std::set< Reference<deployment::XPackageRegistry> > t_registryset; - + t_string2registry m_mediaType2backend; t_string2string m_filter2mediaType; t_registryset m_ambiguousBackends; t_registryset m_allBackends; ::std::vector< Reference<deployment::XPackageTypeInfo> > m_typesInfos; - + void insertBackend( Reference<deployment::XPackageRegistry> const & xBackend ); - + protected: inline void check(); virtual void SAL_CALL disposing(); - + virtual ~PackageRegistryImpl(); PackageRegistryImpl() : t_helper( getMutex() ) {} @@ -125,7 +125,7 @@ public: // XUpdatable virtual void SAL_CALL update() throw (RuntimeException); - + // XPackageRegistry virtual Reference<deployment::XPackage> SAL_CALL bindPackage( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, @@ -161,7 +161,7 @@ void PackageRegistryImpl::disposing() m_mediaType2backend = t_string2registry(); m_ambiguousBackends = t_registryset(); m_allBackends = t_registryset(); - + t_helper::disposing(); } @@ -192,7 +192,7 @@ void PackageRegistryImpl::insertBackend( m_allBackends.insert( xBackend ); typedef ::std::hash_set<OUString, ::rtl::OUStringHash> t_stringset; t_stringset ambiguousFilters; - + const Sequence< Reference<deployment::XPackageTypeInfo> > packageTypes( xBackend->getSupportedPackageTypes() ); for ( sal_Int32 pos = 0; pos < packageTypes.getLength(); ++pos ) @@ -200,13 +200,13 @@ void PackageRegistryImpl::insertBackend( Reference<deployment::XPackageTypeInfo> const & xPackageType = packageTypes[ pos ]; m_typesInfos.push_back( xPackageType ); - + const OUString mediaType( normalizeMediaType( xPackageType->getMediaType() ) ); ::std::pair<t_string2registry::iterator, bool> mb_insertion( m_mediaType2backend.insert( t_string2registry::value_type( mediaType, xBackend ) ) ); - if (mb_insertion.second) + if (mb_insertion.second) { // add parameterless media-type, too: sal_Int32 semi = mediaType.indexOf( ';' ); @@ -285,7 +285,7 @@ void PackageRegistryImpl::insertBackend( } #endif } - + // cut out ambiguous filters: t_stringset::const_iterator iPos( ambiguousFilters.begin() ); const t_stringset::const_iterator iEnd( ambiguousFilters.end() ); @@ -302,7 +302,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( { PackageRegistryImpl * that = new PackageRegistryImpl; Reference<deployment::XPackageRegistry> xRet(that); - + // auto-detect all registered package registries: Reference<container::XEnumeration> xEnum( Reference<container::XContentEnumerationAccess>( @@ -334,7 +334,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( create_folder( 0, registryCachePath, Reference<XCommandEnvironment>() ); } - + Reference<deployment::XPackageRegistry> xBackend; Reference<lang::XSingleComponentFactory> xFac( element, UNO_QUERY ); if (xFac.is()) { @@ -356,14 +356,14 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( element, UNO_QUERY_THROW )->getImplementationName(), static_cast<OWeakObject *>(that) ); } - + that->insertBackend( xBackend ); } } - + // Insert bundle back-end. // Always register as last, because we want to add extensions also as folders - // and as a default we accept every folder, which was not recognized by the other + // and as a default we accept every folder, which was not recognized by the other // backends. Reference<deployment::XPackageRegistry> extensionBackend = ::dp_registry::backend::bundle::create( @@ -382,12 +382,12 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8 ) ) ); create_folder( 0, registryCachePath, Reference<XCommandEnvironment>()); - - + + #if OSL_DEBUG_LEVEL > 1 // dump tables: { - t_registryset allBackends; + t_registryset allBackends; dp_misc::TRACE("> [dp_registry.cxx] media-type detection:\n\n" ); for ( t_string2string::const_iterator iPos( that->m_filter2mediaType.begin() ); @@ -441,7 +441,7 @@ Reference<deployment::XPackageRegistry> PackageRegistryImpl::create( OSL_ASSERT( allBackends == that->m_allBackends ); } #endif - + return xRet; } @@ -502,7 +502,7 @@ Reference<deployment::XPackage> PackageRegistryImpl::bindPackage( for ( ; iPos != iEnd; ++iPos ) { try { - return (*iPos)->bindPackage( url, mediaType, bRemoved, + return (*iPos)->bindPackage( url, mediaType, bRemoved, identifier, xCmdEnv ); } catch (lang::IllegalArgumentException &) { @@ -532,7 +532,7 @@ Reference<deployment::XPackage> PackageRegistryImpl::bindPackage( getResourceString(RID_STR_UNSUPPORTED_MEDIA_TYPE) + mediaType, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); } - return iFind->second->bindPackage( url, mediaType, bRemoved, + return iFind->second->bindPackage( url, mediaType, bRemoved, identifier, xCmdEnv ); } } diff --git a/desktop/source/deployment/registry/dp_registry.src b/desktop/source/deployment/registry/dp_registry.src index 68a52621741f..1658e4bdcca2 100644 --- a/desktop/source/deployment/registry/dp_registry.src +++ b/desktop/source/deployment/registry/dp_registry.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -38,7 +38,7 @@ String RID_STR_REVOKING_PACKAGE }; String RID_STR_CANNOT_DETECT_MEDIA_TYPE -{ +{ Text [ en-US ] = "Cannot detect media-type: "; }; diff --git a/desktop/source/deployment/registry/executable/dp_executable.cxx b/desktop/source/deployment/registry/executable/dp_executable.cxx index b120bd9a4465..eb03c2246417 100644 --- a/desktop/source/deployment/registry/executable/dp_executable.cxx +++ b/desktop/source/deployment/registry/executable/dp_executable.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -57,7 +57,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend class ExecutablePackageImpl : public ::dp_registry::backend::Package { BackendImpl * getMyBackend() const; - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -83,10 +83,10 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend {} }; friend class ExecutablePackageImpl; - + typedef ::std::hash_map< OUString, Reference<XInterface>, ::rtl::OUStringHash > t_string2object; - + // PackageRegistryBackend virtual Reference<deployment::XPackage> bindPackage_( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, @@ -101,7 +101,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -126,7 +126,7 @@ BackendImpl::BackendImpl( OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml")); m_backendDb.reset( new ExecutableBackendDb(getComponentContext(), dbFile)); - } + } } void BackendImpl::addDataToDb(OUString const & url) @@ -185,7 +185,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.executable")) { return new BackendImpl::ExecutablePackageImpl( - this, url, name, m_xExecutableTypeInfo, bRemoved, + this, url, name, m_xExecutableTypeInfo, bRemoved, identifier); } } @@ -201,12 +201,12 @@ BackendImpl * BackendImpl::ExecutablePackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<ExecutablePackageImpl *>(this))); } return pBackend; @@ -250,7 +250,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( attributes |= (osl_File_Attribute_OwnExe | osl_File_Attribute_GrpExe | osl_File_Attribute_OthExe); else if (!getMyBackend()->m_context.equals(OUSTR("bundled"))) - //Bundled extension are required to be in the properly + //Bundled extension are required to be in the properly //installed. That is an executable must have the right flags OSL_ASSERT(0); @@ -268,7 +268,7 @@ void BackendImpl::ExecutablePackageImpl::processPackage_( //We currently cannot check if this XPackage represents a content of a particular extension //But we can check if we are within $UNO_USER_PACKAGES_CACHE etc. -//Done for security reasons. For example an extension manifest could contain a path to +//Done for security reasons. For example an extension manifest could contain a path to //an executable outside the extension. bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension() { @@ -278,7 +278,7 @@ bool BackendImpl::ExecutablePackageImpl::isUrlTargetInExtension() sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_USER_PACKAGES_CACHE")); else if (getMyBackend()->m_context.equals(OUSTR("shared"))) sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$UNO_SHARED_PACKAGES_CACHE")); - else if (getMyBackend()->m_context.equals(OUSTR("bundled"))) + else if (getMyBackend()->m_context.equals(OUSTR("bundled"))) sExtensionDir = dp_misc::expandUnoRcTerm(OUSTR("$BUNDLED_EXTENSIONS")); else OSL_ASSERT(0); diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx index 0c65a9bf4d2c..56a964597481 100644 --- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx +++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx index 1a5828015260..425531911933 100644 --- a/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx +++ b/desktop/source/deployment/registry/executable/dp_executablebackenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -47,14 +47,14 @@ namespace executable { /* The XML file stores the extensions which are currently registered. They will be removed when they are revoked. The format looks like this: - + <?xml version="1.0"?> */ class ExecutableBackendDb: public dp_registry::backend::RegisteredDb -{ +{ protected: virtual ::rtl::OUString getDbNSName(); - + virtual ::rtl::OUString getNSPrefix(); virtual ::rtl::OUString getRootElementName(); diff --git a/desktop/source/deployment/registry/help/dp_help.cxx b/desktop/source/deployment/registry/help/dp_help.cxx index 38aa08674baf..053929c4b16c 100644 --- a/desktop/source/deployment/registry/help/dp_help.cxx +++ b/desktop/source/deployment/registry/help/dp_help.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -41,7 +41,7 @@ #include "svl/inettype.hxx" #include "unotools/pathoptions.hxx" -#include <l10ntools/compilehelp.hxx> +#include <l10ntools/compilehelp.hxx> #include <com/sun/star/ucb/XSimpleFileAccess.hpp> #include <com/sun/star/util/XMacroExpander.hpp> #include <com/sun/star/uri/XUriReferenceFactory.hpp> @@ -68,7 +68,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend BackendImpl * getMyBackend() const; // HelpBackendDb::Data m_dbData; - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -112,15 +112,15 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference< ucb::XSimpleFileAccess > getFileAccess( void ); Reference< ucb::XSimpleFileAccess > m_xSFA; - + const Reference<deployment::XPackageTypeInfo> m_xHelpTypeInfo; Sequence< Reference<deployment::XPackageTypeInfo> > m_typeInfos; std::auto_ptr<HelpBackendDb> m_backendDb; - + public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -175,7 +175,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( throw lang::IllegalArgumentException( StrCannotDetectMediaType::get() + url, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); - + String type, subType; INetContentTypeParameterList params; if (INetContentTypes::parse( mediaType_, type, subType, ¶ms )) @@ -194,7 +194,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( "vnd.sun.star.help")) { return new PackageImpl( - this, url, name, m_xHelpTypeInfo, bRemoved, + this, url, name, m_xHelpTypeInfo, bRemoved, identifier); } } @@ -238,7 +238,7 @@ BackendImpl::PackageImpl::PackageImpl( { // if (bRemoved) // { -// ::boost::optional<HelpBackendDb::Data> opt = +// ::boost::optional<HelpBackendDb::Data> opt = // getMyBackend()->readDataFromDb(url); // if (opt) // m_dbData = *opt; @@ -250,23 +250,23 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; } -bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() +bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() { bool bCompiled = true; rtl::OUString aExpandedHelpURL = dp_misc::expandUnoRcUrl(getURL()); - + ::osl::Directory helpFolder(aExpandedHelpURL); if ( helpFolder.open() == ::osl::File::E_None) { @@ -284,7 +284,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() { if (stat.getFileType() != ::osl::FileStatus::Directory) continue; - + //look if there is the folder help.idxl in the language folder OUString compUrl(stat.getFileURL() + OUSTR("/help.idxl")); ::osl::Directory compiledFolder(compUrl); @@ -307,7 +307,7 @@ bool BackendImpl::PackageImpl::extensionContainsCompiledHelp() { //Error OSL_ASSERT(0); - bCompiled = false; + bCompiled = false; } } return bCompiled; @@ -355,11 +355,11 @@ beans::Optional< OUString > BackendImpl::PackageImpl::getRegistrationDataURL() ::boost::optional<HelpBackendDb::Data> data = getMyBackend()->readDataFromDb(getURL()); - + if (data) return beans::Optional<OUString>(true, data->dataUrl); - return beans::Optional<OUString>(true, OUString()); + return beans::Optional<OUString>(true, OUString()); } @@ -406,7 +406,7 @@ void BackendImpl::implProcessHelp { try { - xInvocation = Reference< script::XInvocation >( + xInvocation = Reference< script::XInvocation >( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.help.HelpIndexer" ), xContext ) , UNO_QUERY ); } @@ -441,12 +441,12 @@ void BackendImpl::implProcessHelp ::dp_misc::create_folder( &langFolderContent, langFolderDest, xCmdEnv); - + rtl::OUString aJarFile( makeURL(sHelpFolder, langFolderURLSegment + aSlash + aHelpStr + OUSTR(".jar"))); aJarFile = ::dp_misc::expandUnoRcUrl(aJarFile); - + rtl::OUString aEncodedJarFilePath = rtl::Uri::encode( aJarFile, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes, @@ -487,7 +487,7 @@ void BackendImpl::implProcessHelp rtl::OUString aOfficeHelpPath( SvtPathOptions().GetHelpPath() ); rtl::OUString aOfficeHelpPathFileURL; - ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); + ::osl::File::getFileURLFromSystemPath( aOfficeHelpPath, aOfficeHelpPathFileURL ); HelpProcessingErrorInfo aErrorInfo; bool bSuccess = compileExtensionHelp( @@ -530,8 +530,8 @@ void BackendImpl::implProcessHelp switch( aErrorInfo.m_eErrorClass ) { case HELPPROCESSING_GENERAL_ERROR: - case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; - case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; + case HELPPROCESSING_INTERNAL_ERROR: nErrStrId = RID_STR_HELPPROCESSING_GENERAL_ERROR; break; + case HELPPROCESSING_XMLPARSING_ERROR: nErrStrId = RID_STR_HELPPROCESSING_XMLPARSING_ERROR; break; default: ; }; @@ -627,7 +627,7 @@ Reference< ucb::XSimpleFileAccess > BackendImpl::getFileAccess( void ) Reference<XComponentContext> const & xContext = getComponentContext(); if( xContext.is() ) { - m_xSFA = Reference< ucb::XSimpleFileAccess >( + m_xSFA = Reference< ucb::XSimpleFileAccess >( xContext->getServiceManager()->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ), xContext ), UNO_QUERY ); @@ -635,7 +635,7 @@ Reference< ucb::XSimpleFileAccess > BackendImpl::getFileAccess( void ) if( !m_xSFA.is() ) { throw RuntimeException( - ::rtl::OUString::createFromAscii( + ::rtl::OUString::createFromAscii( "dp_registry::backend::help::BackendImpl::getFileAccess(), " "could not instatiate SimpleFileAccess." ), Reference< XInterface >() ); diff --git a/desktop/source/deployment/registry/help/dp_help.hrc b/desktop/source/deployment/registry/help/dp_help.hrc index c1e10547ccdd..451144813f25 100644 --- a/desktop/source/deployment/registry/help/dp_help.hrc +++ b/desktop/source/deployment/registry/help/dp_help.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -30,10 +30,10 @@ #include "deployment.hrc" -#define RID_STR_HELP (RID_DEPLOYMENT_HELP_START+2) +#define RID_STR_HELP (RID_DEPLOYMENT_HELP_START+2) -#define RID_STR_HELPPROCESSING_GENERAL_ERROR (RID_DEPLOYMENT_HELP_START+3) -#define RID_STR_HELPPROCESSING_XMLPARSING_ERROR (RID_DEPLOYMENT_HELP_START+4) +#define RID_STR_HELPPROCESSING_GENERAL_ERROR (RID_DEPLOYMENT_HELP_START+3) +#define RID_STR_HELPPROCESSING_XMLPARSING_ERROR (RID_DEPLOYMENT_HELP_START+4) #endif diff --git a/desktop/source/deployment/registry/help/dp_help.src b/desktop/source/deployment/registry/help/dp_help.src index 6b6a3f9a6508..6cb9b023e60d 100644 --- a/desktop/source/deployment/registry/help/dp_help.src +++ b/desktop/source/deployment/registry/help/dp_help.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx index 2f3a566e6151..92ce961de6d0 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx index 71001c9e7d92..4a2eb8ec5922 100644 --- a/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx +++ b/desktop/source/deployment/registry/help/dp_helpbackenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -50,10 +50,10 @@ namespace help { They will be removed when they are revoked. */ class HelpBackendDb: public dp_registry::backend::BackendDb -{ +{ protected: virtual ::rtl::OUString getDbNSName(); - + virtual ::rtl::OUString getNSPrefix(); virtual ::rtl::OUString getRootElementName(); diff --git a/desktop/source/deployment/registry/inc/dp_backend.h b/desktop/source/deployment/registry/inc/dp_backend.h index afadfc6cf5fd..53de2ef1da24 100644 --- a/desktop/source/deployment/registry/inc/dp_backend.h +++ b/desktop/source/deployment/registry/inc/dp_backend.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -65,13 +65,13 @@ typedef ::cppu::WeakComponentImplHelper1< //============================================================================== class Package : protected ::dp_misc::MutexHolder, public t_PackageBase { - PackageRegistryBackend * getMyBackend() const; + PackageRegistryBackend * getMyBackend() const; void processPackage_impl( bool registerPackage, bool startup, css::uno::Reference<css::task::XAbortChannel> const & xAbortChannel, css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv ); - + protected: ::rtl::Reference<PackageRegistryBackend> m_myBackend; const ::rtl::OUString m_url; @@ -81,14 +81,14 @@ protected: const bool m_bRemoved; //Only set if m_bRemoved = true; const ::rtl::OUString m_identifier; - + void check() const; void fireModified(); virtual void SAL_CALL disposing(); - + void checkAborted( ::rtl::Reference< ::dp_misc::AbortChannel > const & abortChannel ); - + // @@@ to be implemented by specific backend: virtual css::beans::Optional< css::beans::Ambiguous<sal_Bool> > isRegistered_( @@ -103,7 +103,7 @@ protected: ::rtl::Reference< ::dp_misc::AbortChannel > const & abortChannel, css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv ) = 0; - + virtual ~Package(); Package( ::rtl::Reference<PackageRegistryBackend> const & myBackend, ::rtl::OUString const & url, @@ -113,9 +113,9 @@ protected: xPackageType, bool bRemoved, ::rtl::OUString const & identifier); - + public: - + class TypeInfo : public ::cppu::WeakImplHelper1<css::deployment::XPackageTypeInfo> { @@ -148,7 +148,7 @@ public: sal_Bool smallIcon ) throw (css::uno::RuntimeException); }; - + // XComponent virtual void SAL_CALL dispose() throw (css::uno::RuntimeException); virtual void SAL_CALL addEventListener( @@ -157,7 +157,7 @@ public: virtual void SAL_CALL removeEventListener( css::uno::Reference<css::lang::XEventListener> const & xListener ) throw (css::uno::RuntimeException); - + // XModifyBroadcaster virtual void SAL_CALL addModifyListener( css::uno::Reference<css::util::XModifyListener> const & xListener ) @@ -165,7 +165,7 @@ public: virtual void SAL_CALL removeModifyListener( css::uno::Reference<css::util::XModifyListener> const & xListener ) throw (css::uno::RuntimeException); - + // XPackage virtual css::uno::Reference<css::task::XAbortChannel> SAL_CALL createAbortChannel() throw (css::uno::RuntimeException); @@ -178,21 +178,21 @@ public: css::ucb::CommandAbortedException, css::uno::RuntimeException); - virtual ::sal_Int32 SAL_CALL checkPrerequisites( - const css::uno::Reference< css::task::XAbortChannel >& xAbortChannel, + virtual ::sal_Int32 SAL_CALL checkPrerequisites( + const css::uno::Reference< css::task::XAbortChannel >& xAbortChannel, const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv, - sal_Bool noLicenseChecking) + sal_Bool noLicenseChecking) throw (css::deployment::DeploymentException, css::deployment::ExtensionRemovedException, - css::ucb::CommandFailedException, - css::ucb::CommandAbortedException, + css::ucb::CommandFailedException, + css::ucb::CommandAbortedException, css::uno::RuntimeException); - virtual ::sal_Bool SAL_CALL checkDependencies( - const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv ) + virtual ::sal_Bool SAL_CALL checkDependencies( + const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv ) throw (css::deployment::DeploymentException, css::deployment::ExtensionRemovedException, - css::ucb::CommandFailedException, + css::ucb::CommandFailedException, css::uno::RuntimeException); virtual void SAL_CALL registerPackage( @@ -288,7 +288,7 @@ class PackageRegistryBackend ::rtl::OUString, css::uno::Reference<css::deployment::XPackage>, ::rtl::OUStringHash > t_string2ref; t_string2ref m_bound; - + protected: ::rtl::OUString m_cachePath; css::uno::Reference<css::uno::XComponentContext> m_xComponentContext; @@ -306,17 +306,17 @@ protected: StrCannotDetectMediaType, RID_STR_CANNOT_DETECT_MEDIA_TYPE> {}; struct StrUnsupportedMediaType : public ::dp_misc::StaticResourceString< StrUnsupportedMediaType, RID_STR_UNSUPPORTED_MEDIA_TYPE> {}; - + // @@@ to be implemented by specific backend: virtual css::uno::Reference<css::deployment::XPackage> bindPackage_( ::rtl::OUString const & url, ::rtl::OUString const & mediaType, sal_Bool bRemoved, ::rtl::OUString const & identifier, css::uno::Reference<css::ucb::XCommandEnvironment> const & xCmdEnv ) = 0; - + void check(); virtual void SAL_CALL disposing(); - + virtual ~PackageRegistryBackend(); PackageRegistryBackend( css::uno::Sequence<css::uno::Any> const & args, @@ -342,26 +342,26 @@ protected: */ static void deleteTempFolder( ::rtl::OUString const & folderUrl); - + public: struct StrRegisteringPackage : public ::dp_misc::StaticResourceString< StrRegisteringPackage, RID_STR_REGISTERING_PACKAGE> {}; struct StrRevokingPackage : public ::dp_misc::StaticResourceString< StrRevokingPackage, RID_STR_REVOKING_PACKAGE> {}; - + inline css::uno::Reference<css::uno::XComponentContext> const & getComponentContext() const { return m_xComponentContext; } - + inline ::rtl::OUString const & getCachePath() const { return m_cachePath; } inline bool transientMode() const { return m_cachePath.getLength() == 0; } inline ::rtl::OUString getContext() const {return m_context; } - + // XEventListener virtual void SAL_CALL disposing( css::lang::EventObject const & evt ) throw (css::uno::RuntimeException); - + // XPackageRegistry virtual css::uno::Reference<css::deployment::XPackage> SAL_CALL bindPackage( ::rtl::OUString const & url, ::rtl::OUString const & mediaType, diff --git a/desktop/source/deployment/registry/inc/dp_backenddb.hxx b/desktop/source/deployment/registry/inc/dp_backenddb.hxx index 5e9b6c0cf703..11dff5a510d3 100644 --- a/desktop/source/deployment/registry/inc/dp_backenddb.hxx +++ b/desktop/source/deployment/registry/inc/dp_backenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,13 +54,13 @@ namespace backend { class BackendDb { private: - + css::uno::Reference<css::xml::dom::XDocument> m_doc; css::uno::Reference<css::xml::xpath::XXPathAPI> m_xpathApi; BackendDb(BackendDb const &); BackendDb & operator = (BackendDb const &); - + protected: const css::uno::Reference<css::uno::XComponentContext> m_xContext; ::rtl::OUString m_urlDb; @@ -79,7 +79,7 @@ protected: css::uno::Reference<css::xml::dom::XNode> getKeyElement( ::rtl::OUString const & url); - + void writeSimpleList( ::std::list< ::rtl::OUString> const & list, ::rtl::OUString const & sListTagName, @@ -100,11 +100,11 @@ protected: css::uno::Reference<css::xml::dom::XNode> writeKeyElement( ::rtl::OUString const & url); - + ::rtl::OUString readSimpleElement( ::rtl::OUString const & sElementName, css::uno::Reference<css::xml::dom::XNode> const & xParent); - + ::std::vector< ::std::pair< ::rtl::OUString, ::rtl::OUString > > readVectorOfPair( css::uno::Reference<css::xml::dom::XNode> const & parent, @@ -158,7 +158,7 @@ public: ::rtl::OUString const & url); virtual ~RegisteredDb() {}; - + virtual void addEntry(::rtl::OUString const & url); virtual bool getEntry(::rtl::OUString const & url); diff --git a/desktop/source/deployment/registry/inc/dp_registry.hrc b/desktop/source/deployment/registry/inc/dp_registry.hrc index 4a3b1d0b1a4a..7f8124b78d1a 100644 --- a/desktop/source/deployment/registry/inc/dp_registry.hrc +++ b/desktop/source/deployment/registry/inc/dp_registry.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx index 0ae1004e7119..c3b0c092c0f7 100644 --- a/desktop/source/deployment/registry/package/dp_extbackenddb.cxx +++ b/desktop/source/deployment/registry/package/dp_extbackenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/package/dp_extbackenddb.hxx b/desktop/source/deployment/registry/package/dp_extbackenddb.hxx index d045dfffef91..ac57bd794e03 100644 --- a/desktop/source/deployment/registry/package/dp_extbackenddb.hxx +++ b/desktop/source/deployment/registry/package/dp_extbackenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -76,7 +76,7 @@ public: ::std::pair< ::rtl::OUString, ::rtl::OUString> >::const_iterator ITC_ITEMS; }; - + public: ExtensionBackendDb( css::uno::Reference<css::uno::XComponentContext> const & xContext, @@ -85,7 +85,7 @@ public: void addEntry(::rtl::OUString const & url, Data const & data); Data getEntry(::rtl::OUString const & url); - + }; diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 718cdbc06a03..603f52414fa1 100755 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -105,16 +105,16 @@ class BackendImpl : public ImplBaseT const bool m_legacyBundle; Sequence< Reference<deployment::XPackage> > m_bundle; Sequence< Reference<deployment::XPackage> > * m_pBundle; - + ExtensionBackendDb::Data m_dbData; - + Reference<deployment::XPackage> bindBundleItem( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, //that is, useing data base information OUString const & identifier, Reference<ucb::XCommandEnvironment> const & xCmdEnv, bool notifyDetectionError = true ); - + typedef ::std::vector< Reference<deployment::XPackage> > t_packagevec; void scanBundle( t_packagevec & bundle, @@ -140,10 +140,10 @@ class BackendImpl : public ImplBaseT ::sal_Bool checkLicense( Reference< ucb::XCommandEnvironment > const & xCmdEnv, - DescriptionInfoset const & description, bool bNoLicenseChecking) - throw (deployment::DeploymentException, - ucb::CommandFailedException, - ucb::CommandAbortedException, + DescriptionInfoset const & description, bool bNoLicenseChecking) + throw (deployment::DeploymentException, + ucb::CommandFailedException, + ucb::CommandAbortedException, RuntimeException); // @throws DeploymentException OUString getTextFromURL( @@ -163,11 +163,11 @@ class BackendImpl : public ImplBaseT bool startup, ::rtl::Reference<AbortChannel> const & abortChannel, Reference<ucb::XCommandEnvironment> const & xCmdEnv ); - + virtual void SAL_CALL disposing(); - + public: PackageImpl( ::rtl::Reference<PackageRegistryBackend> const & myBackend, @@ -177,7 +177,7 @@ class BackendImpl : public ImplBaseT bool legacyBundle, bool bRemoved, OUString const & identifier); - + // XPackage virtual sal_Bool SAL_CALL isBundle() throw (RuntimeException); @@ -200,21 +200,21 @@ class BackendImpl : public ImplBaseT ucb::CommandAbortedException, RuntimeException); - virtual ::sal_Int32 SAL_CALL checkPrerequisites( - const Reference< task::XAbortChannel >& xAbortChannel, + virtual ::sal_Int32 SAL_CALL checkPrerequisites( + const Reference< task::XAbortChannel >& xAbortChannel, const Reference< ucb::XCommandEnvironment >& xCmdEnv, ::sal_Bool noLicenseChecking) throw (deployment::ExtensionRemovedException, - deployment::DeploymentException, - ucb::CommandFailedException, - ucb::CommandAbortedException, + deployment::DeploymentException, + ucb::CommandFailedException, + ucb::CommandAbortedException, RuntimeException); - virtual ::sal_Bool SAL_CALL checkDependencies( - const Reference< ucb::XCommandEnvironment >& xCmdEnv ) + virtual ::sal_Bool SAL_CALL checkDependencies( + const Reference< ucb::XCommandEnvironment >& xCmdEnv ) throw (deployment::DeploymentException, deployment::ExtensionRemovedException, - ucb::CommandFailedException, + ucb::CommandFailedException, RuntimeException); virtual beans::Optional<OUString> SAL_CALL getIdentifier() @@ -231,14 +231,14 @@ class BackendImpl : public ImplBaseT virtual OUString SAL_CALL getDisplayName() throw (deployment::ExtensionRemovedException, RuntimeException); - + virtual Reference< graphic::XGraphic > SAL_CALL getIcon( ::sal_Bool bHighContrast ) throw (deployment::ExtensionRemovedException, RuntimeException); - }; + }; friend class PackageImpl; - + Reference<deployment::XPackageRegistry> m_xRootRegistry; const Reference<deployment::XPackageTypeInfo> m_xBundleTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xLegacyBundleTypeInfo; @@ -249,28 +249,28 @@ class BackendImpl : public ImplBaseT void addDataToDb(OUString const & url, ExtensionBackendDb::Data const & data); ExtensionBackendDb::Data readDataFromDb(OUString const & url); void deleteDataFromDb(OUString const & url); - + // PackageRegistryBackend virtual Reference<deployment::XPackage> bindPackage_( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, OUString const & identifier, Reference<ucb::XCommandEnvironment> const & xCmdEnv ); - + virtual void SAL_CALL disposing(); - + public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext, Reference<deployment::XPackageRegistry> const & xRootRegistry ); - + // XServiceInfo virtual OUString SAL_CALL getImplementationName() throw (RuntimeException); virtual sal_Bool SAL_CALL supportsService( OUString const& name ) throw (RuntimeException); virtual Sequence<OUString> SAL_CALL getSupportedServiceNames() throw (RuntimeException); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -406,7 +406,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( StrCannotDetectMediaType::get() + url, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); } - + String type, subType; INetContentTypeParameterList params; if (INetContentTypes::parse( mediaType, type, subType, ¶ms )) @@ -425,13 +425,13 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( } if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.package-bundle")) { return new PackageImpl( - this, url, name, m_xBundleTypeInfo, false, bRemoved, + this, url, name, m_xBundleTypeInfo, false, bRemoved, identifier); } else if (subType.EqualsIgnoreCaseAscii( "vnd.sun.star.legacy-package-bundle")) { return new PackageImpl( - this, url, name, m_xLegacyBundleTypeInfo, true, bRemoved, + this, url, name, m_xLegacyBundleTypeInfo, true, bRemoved, identifier); } } @@ -487,12 +487,12 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -505,7 +505,7 @@ void BackendImpl::PackageImpl::disposing() for ( sal_Int32 pos = 0; pos < len; ++pos ) try_dispose( p[ pos ] ); m_bundle.realloc( 0 ); - + Package::disposing(); } @@ -525,7 +525,7 @@ BackendImpl::PackageImpl::isRegistered_( //and not registered anyway, this does not matter. const Sequence< Reference<deployment::XPackage> > bundle( getBundle( abortChannel.get(), xCmdEnv ) ); - + bool reg = false; bool present = false; bool ambig = false; @@ -549,7 +549,7 @@ BackendImpl::PackageImpl::isRegistered_( { //we never come here in the first iteration if (reg != (status.Value != sal_False)) { - + ambig = true; reg = false; break; @@ -579,7 +579,7 @@ OUString BackendImpl::PackageImpl::getTextFromURL( seq.getConstArray()), seq.getLength(), RTL_TEXTENCODING_UTF8); } catch (css::uno::Exception&) - { + { Any exc( ::cppu::getCaughtException() ); throw css::deployment::DeploymentException( OUSTR("Could not read file ") + licenseUrl, 0, exc); @@ -650,13 +650,13 @@ bool BackendImpl::PackageImpl::checkDependencies( ::sal_Bool BackendImpl::PackageImpl::checkLicense( css::uno::Reference< css::ucb::XCommandEnvironment > const & xCmdEnv, - DescriptionInfoset const & info, bool alreadyInstalled) - throw (css::deployment::DeploymentException, - css::ucb::CommandFailedException, - css::ucb::CommandAbortedException, + DescriptionInfoset const & info, bool alreadyInstalled) + throw (css::deployment::DeploymentException, + css::ucb::CommandFailedException, + css::ucb::CommandAbortedException, css::uno::RuntimeException) { - try + try { ::boost::optional<SimpleLicenseAttributes> simplLicAttr = info.getSimpleLicenseAttributes(); @@ -664,11 +664,11 @@ bool BackendImpl::PackageImpl::checkDependencies( return true; OUString sLic = info.getLocalizedLicenseURL(); //If we do not get a localized licence then there is an error in the description.xml - //This should be handled by using a validating parser. Therefore we assume that no + //This should be handled by using a validating parser. Therefore we assume that no //license is available. if (sLic.getLength() == 0) throw css::deployment::DeploymentException( - OUSTR("Could not obtain path to license. Possible error in description.xml"), 0, Any()); + OUSTR("Could not obtain path to license. Possible error in description.xml"), 0, Any()); OUString sHref = m_url_expanded + OUSTR("/") + sLic; OUString sLicense = getTextFromURL(xCmdEnv, sHref); ////determine who has to agree to the license @@ -682,12 +682,12 @@ bool BackendImpl::PackageImpl::checkDependencies( //and the suppress-on-update flag is not set for the new extension // alreadyInstalled | bSuppressOnUpdate | show license //---------------------------------------- - // 0 | 0 | 1 + // 0 | 0 | 1 // 0 | 1 | 1 // 1 | 0 | 1 // 1 | 1 | 0 - - if ( !(alreadyInstalled && simplLicAttr->suppressOnUpdate)) + + if ( !(alreadyInstalled && simplLicAttr->suppressOnUpdate)) { css::deployment::LicenseException licExc( OUString(), 0, getDisplayName(), sLicense, @@ -704,8 +704,8 @@ bool BackendImpl::PackageImpl::checkDependencies( else return false; //throw css::deployment::DeploymentException( - // OUSTR("Extension Manager: User declined the license."), - // static_cast<OWeakObject*>(this), + // OUSTR("Extension Manager: User declined the license."), + // static_cast<OWeakObject*>(this), // Any( css::deployment::LicenseException(OUSTR("User declined the license."), 0, m_name, sLicense))); } return true; @@ -723,14 +723,14 @@ bool BackendImpl::PackageImpl::checkDependencies( } } -::sal_Int32 BackendImpl::PackageImpl::checkPrerequisites( - const css::uno::Reference< css::task::XAbortChannel >&, +::sal_Int32 BackendImpl::PackageImpl::checkPrerequisites( + const css::uno::Reference< css::task::XAbortChannel >&, const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv, sal_Bool alreadyInstalled) - throw (css::deployment::DeploymentException, + throw (css::deployment::DeploymentException, css::deployment::ExtensionRemovedException, - css::ucb::CommandFailedException, - css::ucb::CommandAbortedException, + css::ucb::CommandFailedException, + css::ucb::CommandAbortedException, css::uno::RuntimeException) { if (m_bRemoved) @@ -754,9 +754,9 @@ bool BackendImpl::PackageImpl::checkDependencies( return 0; } -::sal_Bool BackendImpl::PackageImpl::checkDependencies( - const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv ) - throw (deployment::DeploymentException, +::sal_Bool BackendImpl::PackageImpl::checkDependencies( + const css::uno::Reference< css::ucb::XCommandEnvironment >& xCmdEnv ) + throw (deployment::DeploymentException, deployment::ExtensionRemovedException, ucb::CommandFailedException, RuntimeException) @@ -779,7 +779,7 @@ beans::Optional<OUString> BackendImpl::PackageImpl::getIdentifier() else identifier = dp_misc::generateIdentifier( getDescriptionInfoset().getIdentifier(), m_name); - + return beans::Optional<OUString>( true, identifier); } @@ -788,7 +788,7 @@ OUString BackendImpl::PackageImpl::getVersion() throw (deployment::ExtensionRemovedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); return getDescriptionInfoset().getVersion(); } @@ -804,7 +804,7 @@ beans::StringPair BackendImpl::PackageImpl::getPublisherInfo() throw (deployment::ExtensionRemovedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); ::std::pair< OUString, OUString > aInfo = getDescriptionInfoset().getLocalizedPublisherNameAndURL(); beans::StringPair aStrPair( aInfo.first, aInfo.second ); return aStrPair; @@ -815,7 +815,7 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool throw (deployment::ExtensionRemovedException, RuntimeException ) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); uno::Reference< graphic::XGraphic > xGraphic; @@ -828,13 +828,13 @@ uno::Reference< graphic::XGraphic > BackendImpl::PackageImpl::getIcon( sal_Bool uno::Reference< graphic::XGraphicProvider > xGraphProvider( xContext->getServiceManager()->createInstanceWithContext( OUSTR( "com.sun.star.graphic.GraphicProvider" ), xContext ), uno::UNO_QUERY ); - + if ( xGraphProvider.is() ) { uno::Sequence< beans::PropertyValue > aMediaProps( 1 ); aMediaProps[0].Name = OUSTR( "URL" ); aMediaProps[0].Value <<= aFullIconURL; - + xGraphic = xGraphProvider->queryGraphic( aMediaProps ); } } @@ -852,9 +852,9 @@ void BackendImpl::PackageImpl::processPackage_( { const Sequence< Reference<deployment::XPackage> > bundle( getBundle( abortChannel.get(), xCmdEnv ) ); - + if (doRegisterPackage) - { + { ExtensionBackendDb::Data data; const sal_Int32 len = bundle.getLength(); for ( sal_Int32 pos = 0; pos < len; ++pos ) @@ -867,7 +867,7 @@ void BackendImpl::PackageImpl::processPackage_( try { xPackage->registerPackage( startup, xSubAbortChannel, xCmdEnv ); } - catch (Exception &) + catch (Exception &) { //We even try a rollback if the user cancelled the action (CommandAbortedException) //in order to prevent invalid database entries. @@ -890,7 +890,7 @@ void BackendImpl::PackageImpl::processPackage_( } if (approve && !abort) // ignore error, just continue continue; - + { ProgressLevel progress( xCmdEnv, OUSTR("rollback...") ); @@ -901,7 +901,7 @@ void BackendImpl::PackageImpl::processPackage_( bundle[ pos ]->revokePackage( xSubAbortChannel, xCmdEnv ); } - catch (Exception &) + catch (Exception &) { OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( @@ -912,7 +912,7 @@ void BackendImpl::PackageImpl::processPackage_( } progress.update( OUSTR("rollback finished.") ); } - + deployment::DeploymentException dpExc; if (exc >>= dpExc) { throw ucb::CommandFailedException( @@ -980,11 +980,11 @@ OUString BackendImpl::PackageImpl::getDescription() throw (deployment::ExtensionRemovedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); const OUString sRelativeURL(getDescriptionInfoset().getLocalizedDescriptionURL()); OUString sDescription; - if (sRelativeURL.getLength()) + if (sRelativeURL.getLength()) { OUString sURL = m_url_expanded + OUSTR("/") + sRelativeURL; @@ -1012,7 +1012,7 @@ void BackendImpl::PackageImpl::exportTo( ucb::CommandAbortedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); ::ucbhelper::Content sourceContent( m_url_expanded, xCmdEnv ); OUString title(newTitle); @@ -1022,7 +1022,7 @@ void BackendImpl::PackageImpl::exportTo( title, rtl_UriCharClassPchar, rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8 ) ) ); - + if (nameClashAction == ucb::NameClash::ASK) { if (create_ucb_content( @@ -1046,7 +1046,7 @@ void BackendImpl::PackageImpl::exportTo( static_cast<OWeakObject *>(this), Any() ); } erase_path( destURL, xCmdEnv ); - + ::rtl::OUStringBuffer buf; buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("vnd.sun.star.zip://") ); buf.append( ::rtl::Uri::encode( destURL, @@ -1055,7 +1055,7 @@ void BackendImpl::PackageImpl::exportTo( RTL_TEXTENCODING_UTF8 ) ); buf.append( static_cast<sal_Unicode>('/') ); OUString destFolder( buf.makeStringAndClear() ); - + ::ucbhelper::Content destFolderContent( destFolder, xCmdEnv ); { // transfer every item of folder into zip: @@ -1077,19 +1077,19 @@ void BackendImpl::PackageImpl::exportTo( progress.update( Any() ); // animating progress bar } } - + // assure META-INF folder: ::ucbhelper::Content metainfFolderContent; create_folder( &metainfFolderContent, makeURL( destFolderContent.getURL(), OUSTR("META-INF") ), xCmdEnv ); - + if (m_legacyBundle) { // easy to migrate legacy bundles to new format: // just export them once using a .oxt name! // set detected media-types of any bundle item: - + // collect all manifest entries: Sequence< Reference<deployment::XPackage> > bundle; try { @@ -1107,7 +1107,7 @@ void BackendImpl::PackageImpl::exportTo( OSL_ENSURE( 0, ::rtl::OUStringToOString( exc.Message, RTL_TEXTENCODING_UTF8 ).getStr() ); } - + ::std::vector< Sequence<beans::PropertyValue> > manifest; manifest.reserve( bundle.getLength() ); sal_Int32 baseURLlen = m_url_expanded.getLength(); @@ -1142,7 +1142,7 @@ void BackendImpl::PackageImpl::exportTo( pattribs[ 1 ].Value <<= mediaType; manifest.push_back( attribs ); } - + // write into pipe: Reference<XComponentContext> xContext( getMyBackend()->getComponentContext() ); @@ -1155,7 +1155,7 @@ void BackendImpl::PackageImpl::exportTo( OUSTR("com.sun.star.io.Pipe"), xContext ), UNO_QUERY_THROW ); xManifestWriter->writeManifestSequence( xPipe, comphelper::containerToSequence(manifest) ); - + // write buffered pipe data to content: ::ucbhelper::Content manifestContent( makeURL( metainfFolderContent.getURL(), OUSTR("manifest.xml") ), @@ -1176,14 +1176,14 @@ void BackendImpl::PackageImpl::exportTo( OSL_ENSURE( 0, "### missing META-INF/manifest.xml file!" ); return; } - + if (! metainfFolderContent.transferContent( manifestContent, ::ucbhelper::InsertOperation_COPY, OUString(), ucb::NameClash::OVERWRITE )) throw RuntimeException( OUSTR("UCB transferContent() failed!"), static_cast<OWeakObject *>(this) ); } - + // xxx todo: maybe obsolete in the future try { destFolderContent.executeCommand( OUSTR("flush"), Any() ); @@ -1234,7 +1234,7 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( xCmdEnv, false /* no throw */ )) mediaType = OUSTR("application/vnd.sun.star." "dialog-library"); - + if (mediaType.getLength() > 0) { const Reference<deployment::XPackage> xPackage( bindBundleItem( getURL(), mediaType, false, OUString(), @@ -1251,7 +1251,7 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( // .oxt: scanBundle( bundle, AbortChannel::get(xAbortChannel), xCmdEnv ); } - + } catch (RuntimeException &) { throw; @@ -1272,7 +1272,7 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( static_cast<OWeakObject *>(this), exc ); } } - + // sort: schema before config data, typelibs before components: Sequence< Reference<deployment::XPackage> > ret( bundle.size() ); Reference<deployment::XPackage> * pret = ret.getArray(); @@ -1306,7 +1306,7 @@ Sequence< Reference<deployment::XPackage> > BackendImpl::PackageImpl::getBundle( ++lower_end; } OSL_ASSERT( lower_end == upper_end ); - + const ::osl::MutexGuard guard( getMutex() ); pBundle = m_pBundle; if (pBundle == 0) { @@ -1344,7 +1344,7 @@ Reference<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem( // ignore any nested bundles: if (isBundle_(mediaType)) return Reference<deployment::XPackage>(); - + Reference<deployment::XPackage>xPackage; try { xPackage.set( getMyBackend()->m_xRootRegistry->bindPackage( @@ -1371,7 +1371,7 @@ Reference<deployment::XPackage> BackendImpl::PackageImpl::bindBundleItem( task::XInteractionApprove::static_type(), xCmdEnv, 0, 0 ); } } - + if (xPackage.is()) { const Reference<deployment::XPackageTypeInfo> xPackageType( xPackage->getPackageType() ); @@ -1395,17 +1395,17 @@ void BackendImpl::PackageImpl::scanBundle( if (! create_ucb_content( &manifestContent, makeURL( m_url_expanded, OUSTR("META-INF/manifest.xml") ), - xCmdEnv, false /* no throw */ )) + xCmdEnv, false /* no throw */ )) { OSL_ENSURE( 0, "### missing META-INF/manifest.xml file!" ); return; } - - + + const lang::Locale officeLocale = getOfficeLocale(); OUString descrFile; lang::Locale descrFileLocale; - + const Reference<XComponentContext> xContext( getMyBackend()->getComponentContext() ); Reference<packages::manifest::XManifestReader> xManifestReader( @@ -1430,23 +1430,23 @@ void BackendImpl::PackageImpl::scanBundle( RTL_CONSTASCII_STRINGPARAM("MediaType") )) attribs[i].Value >>= mediaType; } - + if (fullPath.getLength() == 0 || mediaType.getLength() == 0 || mediaType.equalsAsciiL( // opt: exclude common text/xml RTL_CONSTASCII_STRINGPARAM("text/xml") )) continue; - + String type, subType; INetContentTypeParameterList params; if (! INetContentTypes::parse( mediaType, type, subType, ¶ms )) continue; - + INetContentTypeParameter const * param = params.find( ByteString("platform") ); if (param != 0 && !platform_fits( param->m_sValue )) continue; const OUString url( makeURL( packageRootURL, fullPath ) ); - + // check for bundle description: if (type.EqualsIgnoreCaseAscii("application") && subType.EqualsIgnoreCaseAscii( @@ -1475,12 +1475,12 @@ void BackendImpl::PackageImpl::scanBundle( } continue; } - + checkAborted( abortChannel ); - + //We make sure that we only create one XPackage for a particular URL. //Sometime programmers insert the same URL several times in the manifest - //which may lead to DisposedExceptions. + //which may lead to DisposedExceptions. if (bundle.end() == std::find_if(bundle.begin(), bundle.end(), XPackage_eq(url))) { const Reference<deployment::XPackage> xPackage( @@ -1493,7 +1493,7 @@ void BackendImpl::PackageImpl::scanBundle( fprintf(stderr, "manifest.xml contains a duplicate entry!\n"); } } - + if (descrFile.getLength() > 0) { ::ucbhelper::Content descrFileContent; @@ -1527,7 +1527,7 @@ void BackendImpl::PackageImpl::scanLegacyBundle( bool skip_registration ) { ::ucbhelper::Content ucbContent( url, xCmdEnv ); - + // check for platform pathes: const OUString title( ucbContent.getPropertyValue( StrTitle::get() ).get<OUString>() ); @@ -1539,16 +1539,16 @@ void BackendImpl::PackageImpl::scanLegacyBundle( if (title.endsWithIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM("skip_registration") )) skip_registration = true; - + OUString ar [] = { StrTitle::get(), OUSTR("IsFolder") }; Reference<sdbc::XResultSet> xResultSet( - ucbContent.createCursor( + ucbContent.createCursor( Sequence<OUString>( ar, ARLEN(ar) ), ::ucbhelper::INCLUDE_FOLDERS_AND_DOCUMENTS ) ); while (xResultSet->next()) { checkAborted( abortChannel ); - + const Reference<sdbc::XRow> xRow( xResultSet, UNO_QUERY_THROW ); const OUString title_enc( ::rtl::Uri::encode( xRow->getString( 1 /* Title */ ), @@ -1556,7 +1556,7 @@ void BackendImpl::PackageImpl::scanLegacyBundle( rtl_UriEncodeIgnoreEscapes, RTL_TEXTENCODING_UTF8 ) ); const OUString path( makeURL( url, title_enc ) ); - + OUString mediaType; const Reference<deployment::XPackage> xPackage( bindBundleItem( path, OUString() /* detect */, false, OUString(), @@ -1567,17 +1567,17 @@ void BackendImpl::PackageImpl::scanLegacyBundle( OSL_ASSERT( xPackageType.is() ); if (xPackageType.is()) mediaType = xPackageType->getMediaType(); - + if (skip_registration && // xxx todo: additional parsing? mediaType.matchIgnoreAsciiCaseAsciiL( RTL_CONSTASCII_STRINGPARAM( "application/vnd.sun.star.uno-component") )) continue; - + bundle.push_back( xPackage ); } - + if (mediaType.getLength() == 0 || // script.xlb, dialog.xlb can be met everywhere: mediaType.matchIgnoreAsciiCaseAsciiL( @@ -1599,7 +1599,7 @@ OUString BackendImpl::PackageImpl::getDisplayName() throw (deployment::ExtensionRemovedException, RuntimeException) { if (m_bRemoved) - throw deployment::ExtensionRemovedException(); + throw deployment::ExtensionRemovedException(); OUString sName = getDescriptionInfoset().getLocalizedDisplayName(); if (sName.getLength() == 0) @@ -1613,7 +1613,7 @@ BackendImpl::PackageImpl::getPackagesFromDb( Reference<ucb::XCommandEnvironment> const & xCmdEnv) { ::std::vector<Reference<deployment::XPackage> > retVector; - + typedef ::std::vector< ::std::pair<OUString, OUString> >::const_iterator ITC; for (ITC i = m_dbData.items.begin(); i != m_dbData.items.end(); i++) { @@ -1622,7 +1622,7 @@ BackendImpl::PackageImpl::getPackagesFromDb( OSL_ASSERT(xExtension.is()); retVector.push_back(xExtension); } - + return retVector; } diff --git a/desktop/source/deployment/registry/package/dp_package.hrc b/desktop/source/deployment/registry/package/dp_package.hrc index 3a840b64f0b6..0b258a58cdf3 100644 --- a/desktop/source/deployment/registry/package/dp_package.hrc +++ b/desktop/source/deployment/registry/package/dp_package.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/package/dp_package.src b/desktop/source/deployment/registry/package/dp_package.src index 57307040bba4..056a17cb0618 100644 --- a/desktop/source/deployment/registry/package/dp_package.src +++ b/desktop/source/deployment/registry/package/dp_package.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/script/dp_lib_container.cxx b/desktop/source/deployment/registry/script/dp_lib_container.cxx index 1fc4c3d211bc..4dc71b7fd9e3 100644 --- a/desktop/source/deployment/registry/script/dp_lib_container.cxx +++ b/desktop/source/deployment/registry/script/dp_lib_container.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -60,7 +60,7 @@ OUString LibraryContainer::get_libname( ::xmlscript::LibDescriptor import; ::ucbhelper::Content ucb_content( url, xCmdEnv ); xml_parse( ::xmlscript::importLibrary( import ), ucb_content, xContext ); - + if (import.aName.getLength() == 0) { throw Exception( StrCannotDetermineLibName::get(), Reference<XInterface>() ); diff --git a/desktop/source/deployment/registry/script/dp_lib_container.h b/desktop/source/deployment/registry/script/dp_lib_container.h index 13e29659d30e..b0f29c1e80f3 100644 --- a/desktop/source/deployment/registry/script/dp_lib_container.h +++ b/desktop/source/deployment/registry/script/dp_lib_container.h @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/script/dp_script.cxx b/desktop/source/deployment/registry/script/dp_script.cxx index d578ffcf0c40..45fb378f1c5d 100644 --- a/desktop/source/deployment/registry/script/dp_script.cxx +++ b/desktop/source/deployment/registry/script/dp_script.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -68,11 +68,11 @@ class BackendImpl : public t_helper class PackageImpl : public ::dp_registry::backend::Package { BackendImpl * getMyBackend() const; - + const OUString m_scriptURL; const OUString m_dialogURL; OUString m_dialogName; - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -84,7 +84,7 @@ class BackendImpl : public t_helper bool startup, ::rtl::Reference<AbortChannel> const & abortChannel, Reference<XCommandEnvironment> const & xCmdEnv ); - + public: PackageImpl( ::rtl::Reference<BackendImpl> const & myBackend, @@ -94,21 +94,21 @@ class BackendImpl : public t_helper bool bRemoved, OUString const & identifier); }; friend class PackageImpl; - + // PackageRegistryBackend virtual Reference<deployment::XPackage> bindPackage_( OUString const & url, OUString const & mediaType, sal_Bool bRemoved, OUString const & identifier, Reference<XCommandEnvironment> const & xCmdEnv ); - + void addDataToDb(OUString const & url); void deleteDataFromDb(OUString const & url); bool isRegisteredInDb(OUString const & url); - + // Reference< ucb::XSimpleFileAccess > getFileAccess( void ); -// Reference< ucb::XSimpleFileAccess > m_xSFA; +// Reference< ucb::XSimpleFileAccess > m_xSFA; const Reference<deployment::XPackageTypeInfo> m_xBasicLibTypeInfo; const Reference<deployment::XPackageTypeInfo> m_xDialogLibTypeInfo; @@ -117,10 +117,10 @@ class BackendImpl : public t_helper public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - + // XUpdatable virtual void SAL_CALL update() throw (RuntimeException); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -175,7 +175,7 @@ BackendImpl::BackendImpl( { m_typeInfos[ 0 ] = m_xBasicLibTypeInfo; m_typeInfos[ 1 ] = m_xDialogLibTypeInfo; - + OSL_ASSERT( ! transientMode() ); if (!transientMode()) @@ -183,7 +183,7 @@ BackendImpl::BackendImpl( OUString dbFile = makeURL(getCachePath(), OUSTR("backenddb.xml")); m_backendDb.reset( new ScriptBackendDb(getComponentContext(), dbFile)); - } + } } void BackendImpl::addDataToDb(OUString const & url) @@ -252,7 +252,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( StrCannotDetectMediaType::get() + url, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); } - + String type, subType; INetContentTypeParameterList params; if (INetContentTypes::parse( mediaType, type, subType, ¶ms )) @@ -264,7 +264,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( 0, dialogURL, xCmdEnv, false /* no throw */ )) { dialogURL = OUString(); } - + if (subType.EqualsIgnoreCaseAscii("vnd.sun.star.basic-library")) { OUString scriptURL( makeURL( url, OUSTR("script.xlb"))); @@ -272,8 +272,8 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( 0, scriptURL, xCmdEnv, false /* no throw */ )) { scriptURL = OUString(); } - - return new PackageImpl( + + return new PackageImpl( this, url, xCmdEnv, scriptURL, dialogURL, bRemoved, identifier); } @@ -300,12 +300,12 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -380,7 +380,7 @@ void BackendImpl::PackageImpl::processPackage_( //user repository. That is, the script of the newly added user extension does //not work anymore. Therefore we must check if the currently active //script comes in fact from the currently processed extension. - + if (bRegistered) { //we also prevent and live deployment at startup @@ -392,20 +392,20 @@ void BackendImpl::PackageImpl::processPackage_( if (sScriptUrl.equals(m_scriptURL)) xScriptLibs->removeLibrary(m_name); } - + if (bDialog && xDialogLibs.is() && xDialogLibs->hasByName(m_dialogName)) { const OUString sDialogUrl = xDialogLibs->getOriginalLibraryLinkURL(m_dialogName); if (sDialogUrl.equals(m_dialogURL)) xDialogLibs->removeLibrary(m_dialogName); } - } + } getMyBackend()->deleteDataFromDb(getURL()); return; } } if (bRegistered) - return; // Already registered + return; // Already registered // Update LibraryContainer bool bScriptSuccess = false; @@ -447,7 +447,7 @@ void BackendImpl::PackageImpl::processPackage_( } - if (bDialog && xDialogLibs.is()) + if (bDialog && xDialogLibs.is()) { bool bCanAdd = true; if (xDialogLibs->hasByName(m_dialogName)) @@ -466,7 +466,7 @@ void BackendImpl::PackageImpl::processPackage_( else { bCanAdd = false; - } + } } if (bCanAdd) @@ -476,7 +476,7 @@ void BackendImpl::PackageImpl::processPackage_( } } } - bool bSuccess = bScript || bDialog; // Something must have happened + bool bSuccess = bScript || bDialog; // Something must have happened if( bRunning && !startup) if( (bScript && !bScriptSuccess) || (bDialog && !bDialogSuccess) ) bSuccess = false; diff --git a/desktop/source/deployment/registry/script/dp_script.hrc b/desktop/source/deployment/registry/script/dp_script.hrc index 8ddfa6f51ffc..f5b52f1b1f31 100644 --- a/desktop/source/deployment/registry/script/dp_script.hrc +++ b/desktop/source/deployment/registry/script/dp_script.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/script/dp_script.src b/desktop/source/deployment/registry/script/dp_script.src index 117f4eac945a..21e0cfdcc9f8 100644 --- a/desktop/source/deployment/registry/script/dp_script.src +++ b/desktop/source/deployment/registry/script/dp_script.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx index 8c6a4924212e..436ea3ce5f29 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx index 58a749480113..63015ab1e46c 100644 --- a/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx +++ b/desktop/source/deployment/registry/script/dp_scriptbackenddb.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -48,16 +48,16 @@ namespace script { They will be removed when they are revoked. */ class ScriptBackendDb: public dp_registry::backend::RegisteredDb -{ +{ protected: virtual ::rtl::OUString getDbNSName(); - + virtual ::rtl::OUString getNSPrefix(); virtual ::rtl::OUString getRootElementName(); virtual ::rtl::OUString getKeyElementName(); - + public: diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx index fe0f378160d9..9d66e80f7114 100644 --- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -94,13 +94,13 @@ ParcelDescDocHandler::startElement( const OUString& aName, throw ( xml::sax::SAXException, RuntimeException ) { - - dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() for ") + + + dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() for ") + aName + OUSTR("\n")); if ( !skipIndex ) { if ( aName.equals( OUString::createFromAscii( "parcel" ) ) ) - { + { m_sLang = xAttribs->getValueByName( OUString::createFromAscii( "language" ) ); } ++skipIndex; @@ -110,7 +110,7 @@ ParcelDescDocHandler::startElement( const OUString& aName, dp_misc::TRACE(OUSTR("ParcelDescDocHandler::startElement() skipping for ") + aName + OUSTR("\n")); } - + } void SAL_CALL ParcelDescDocHandler::endElement( const OUString & aName ) diff --git a/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx b/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx index 83ffddda1aff..6d2dc52006e3 100644 --- a/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx +++ b/desktop/source/deployment/registry/sfwk/dp_parceldesc.hxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -54,7 +54,7 @@ private: sal_Int32 skipIndex; public: ParcelDescDocHandler():m_bIsParsed( false ), skipIndex( 0 ){} - ::rtl::OUString getParcelLanguage() { return m_sLang; } + ::rtl::OUString getParcelLanguage() { return m_sLang; } bool isParsed() { return m_bIsParsed; } // XDocumentHandler virtual void SAL_CALL startDocument() diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx index 02b6452f33cb..0e8dc29d53c4 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.cxx @@ -2,7 +2,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite @@ -64,12 +64,12 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend class PackageImpl : public ::dp_registry::backend::Package { BackendImpl * getMyBackend() const; - + Reference< container::XNameContainer > m_xNameCntrPkgHandler; - OUString m_descr; - + OUString m_descr; + void initPackageHandler(); - + // Package virtual beans::Optional< beans::Ambiguous<sal_Bool> > isRegistered_( ::osl::ResettableMutexGuard & guard, @@ -81,7 +81,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend bool startup, ::rtl::Reference<AbortChannel> const & abortChannel, Reference<XCommandEnvironment> const & xCmdEnv ); - + public: PackageImpl( ::rtl::Reference<BackendImpl> const & myBackend, @@ -91,7 +91,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend virtual OUString SAL_CALL getDescription() throw (RuntimeException); }; friend class PackageImpl; - + // PackageRegistryBackend virtual Reference<deployment::XPackage> bindPackage_( OUString const & url, OUString const & mediaType, @@ -99,12 +99,12 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend Reference<XCommandEnvironment> const & xCmdEnv ); const Reference<deployment::XPackageTypeInfo> m_xTypeInfo; - + public: BackendImpl( Sequence<Any> const & args, Reference<XComponentContext> const & xComponentContext ); - + // XPackageRegistry virtual Sequence< Reference<deployment::XPackageTypeInfo> > SAL_CALL getSupportedPackageTypes() throw (RuntimeException); @@ -114,12 +114,12 @@ BackendImpl * BackendImpl::PackageImpl::getMyBackend() const { BackendImpl * pBackend = static_cast<BackendImpl *>(m_myBackend.get()); if (NULL == pBackend) - { + { //May throw a DisposedException check(); //We should never get here... throw RuntimeException( - OUSTR("Failed to get the BackendImpl"), + OUSTR("Failed to get the BackendImpl"), static_cast<OWeakObject*>(const_cast<PackageImpl *>(this))); } return pBackend; @@ -143,7 +143,7 @@ BackendImpl::PackageImpl::PackageImpl( m_descr(libType) { initPackageHandler(); - + sal_Int32 segmEnd = url.getLength(); if (url.getLength() > 0 && url[ url.getLength() - 1 ] == '/') --segmEnd; @@ -247,7 +247,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( StrCannotDetectMediaType::get() + url, static_cast<OWeakObject *>(this), static_cast<sal_Int16>(-1) ); } - + String type, subType; INetContentTypeParameterList params; if (INetContentTypes::parse( mediaType, type, subType, ¶ms )) @@ -258,15 +258,15 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( { OUString lang = OUString::createFromAscii("Script"); OUString sParcelDescURL = makeURL( - url, OUSTR("parcel-descriptor.xml") ); + url, OUSTR("parcel-descriptor.xml") ); ::ucbhelper::Content ucb_content; if (create_ucb_content( &ucb_content, sParcelDescURL, xCmdEnv, false /* no throw */ )) { - ParcelDescDocHandler* pHandler = - new ParcelDescDocHandler(); + ParcelDescDocHandler* pHandler = + new ParcelDescDocHandler(); Reference< xml::sax::XDocumentHandler > xDocHandler = pHandler; @@ -275,7 +275,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( Reference< xml::sax::XParser > xParser( xContext->getServiceManager()->createInstanceWithContext( - OUSTR("com.sun.star.xml.sax.Parser"), xContext ), + OUSTR("com.sun.star.xml.sax.Parser"), xContext ), UNO_QUERY_THROW ); xParser->setDocumentHandler( xDocHandler ); @@ -284,7 +284,7 @@ Reference<deployment::XPackage> BackendImpl::bindPackage_( source.sSystemId = ucb_content.getURL(); xParser->parseStream( source ); - if ( pHandler->isParsed() ) + if ( pHandler->isParsed() ) { lang = pHandler->getParcelLanguage(); } @@ -316,14 +316,14 @@ void BackendImpl::PackageImpl:: initPackageHandler() { if (m_xNameCntrPkgHandler.is()) return; - + BackendImpl * that = getMyBackend(); Any aContext; if ( that->m_eContext == CONTEXT_USER ) { aContext <<= OUSTR("user"); - } + } else if ( that->m_eContext == CONTEXT_SHARED ) { aContext <<= OUSTR("share"); @@ -338,7 +338,7 @@ void BackendImpl::PackageImpl:: initPackageHandler() // NOT supported at the momemtn // TODO } - Reference< provider::XScriptProviderFactory > xFac( + Reference< provider::XScriptProviderFactory > xFac( that->getComponentContext()->getValueByName( OUSTR( "/singletons/com.sun.star.script.provider.theMasterScriptProviderFactory") ), UNO_QUERY ); @@ -379,11 +379,11 @@ void BackendImpl::PackageImpl::processPackage_( { if ( !m_xNameCntrPkgHandler.is() ) { - dp_misc::TRACE("no package handler!!!!\n"); - throw RuntimeException( OUSTR("No package Handler " ), + dp_misc::TRACE("no package handler!!!!\n"); + throw RuntimeException( OUSTR("No package Handler " ), Reference< XInterface >() ); - } - + } + if (doRegisterPackage) { // will throw if it fails diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc b/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc index 0eb619e839e3..ed164251cc23 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.hrc @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite diff --git a/desktop/source/deployment/registry/sfwk/dp_sfwk.src b/desktop/source/deployment/registry/sfwk/dp_sfwk.src index c8d37ce067ac..32a507240123 100644 --- a/desktop/source/deployment/registry/sfwk/dp_sfwk.src +++ b/desktop/source/deployment/registry/sfwk/dp_sfwk.src @@ -1,7 +1,7 @@ /************************************************************************* * * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. - * + * * Copyright 2000, 2010 Oracle and/or its affiliates. * * OpenOffice.org - a multi-platform office productivity suite |