diff options
author | Joachim Lingner <jl@openoffice.org> | 2011-01-04 12:01:53 +0100 |
---|---|---|
committer | Joachim Lingner <jl@openoffice.org> | 2011-01-04 12:01:53 +0100 |
commit | 7508b11431ad7e08ab49a8a239a79ee9ae80334d (patch) | |
tree | 661469b3352f6c1f0faa9581eba30b6de5fa49aa /desktop/source/deployment/registry/package | |
parent | 2e54587cb31ebf2c747297ffd86cd79e2d54a4a0 (diff) | |
parent | 794c821e4d48c34aa376cdc7b6ab2cb029d9574d (diff) |
jl160 merge with DEV300m96
Diffstat (limited to 'desktop/source/deployment/registry/package')
-rwxr-xr-x[-rw-r--r--] | desktop/source/deployment/registry/package/dp_package.cxx | 44 |
1 files changed, 38 insertions, 6 deletions
diff --git a/desktop/source/deployment/registry/package/dp_package.cxx b/desktop/source/deployment/registry/package/dp_package.cxx index 302b36603619..d247597a808f 100644..100755 --- a/desktop/source/deployment/registry/package/dp_package.cxx +++ b/desktop/source/deployment/registry/package/dp_package.cxx @@ -190,6 +190,9 @@ class BackendImpl : public ImplBaseT virtual OUString SAL_CALL getDescription() throw (deployment::ExtensionRemovedException, RuntimeException); + virtual OUString SAL_CALL getLicenseText() + throw (deployment::ExtensionRemovedException, RuntimeException); + virtual void SAL_CALL exportTo( OUString const & destFolderURL, OUString const & newTitle, sal_Int32 nameClashAction, @@ -1004,16 +1007,45 @@ OUString BackendImpl::PackageImpl::getDescription() if (sRelativeURL.getLength()) { OUString sURL = m_url_expanded + OUSTR("/") + sRelativeURL; - sDescription = getTextFromURL( - css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL); + try + { + sDescription = getTextFromURL( css::uno::Reference< css::ucb::XCommandEnvironment >(), sURL ); + } + catch ( css::deployment::DeploymentException& ) + { + OSL_ENSURE( 0, ::rtl::OUStringToOString( ::comphelper::anyToString( ::cppu::getCaughtException() ), RTL_TEXTENCODING_UTF8 ).getStr() ); + } } + if (sDescription.getLength()) return sDescription; - else if(m_oldDescription.getLength()) - return m_oldDescription; - else - return OUString(); + return m_oldDescription; +} + +//______________________________________________________________________________ +OUString BackendImpl::PackageImpl::getLicenseText() + throw (deployment::ExtensionRemovedException, RuntimeException) +{ + if (m_bRemoved) + throw deployment::ExtensionRemovedException(); + + OUString sLicense; + DescriptionInfoset aInfo = getDescriptionInfoset(); + + ::boost::optional< SimpleLicenseAttributes > aSimplLicAttr = aInfo.getSimpleLicenseAttributes(); + if ( aSimplLicAttr ) + { + OUString aLicenseURL = aInfo.getLocalizedLicenseURL(); + + if ( aLicenseURL.getLength() ) + { + OUString aFullURL = m_url_expanded + OUSTR("/") + aLicenseURL; + sLicense = getTextFromURL( Reference< ucb::XCommandEnvironment >(), aFullURL); + } + } + + return sLicense; } //______________________________________________________________________________ |