summaryrefslogtreecommitdiff
path: root/desktop
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-03-09 13:03:49 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-03-09 13:03:49 +0100
commit67e69a55820f50973ca0de75ccab2bb07d0bada8 (patch)
tree171ade8d63ec6d9802584d16877c447078be7623 /desktop
parent157ce65588ec8ef4ff8f805f7b8a64fefdd9edec (diff)
Revert "WIP: Experimental new binary type.rdb format"
This reverts commit 892ef8b0565c7f5f343d71e3b61c41655f80267b, Windows-only cli_ure needs to be adapted first.
Diffstat (limited to 'desktop')
-rw-r--r--desktop/source/deployment/registry/component/dp_component.cxx57
1 files changed, 45 insertions, 12 deletions
diff --git a/desktop/source/deployment/registry/component/dp_component.cxx b/desktop/source/deployment/registry/component/dp_component.cxx
index 4fd9f495ce35..991c5782c214 100644
--- a/desktop/source/deployment/registry/component/dp_component.cxx
+++ b/desktop/source/deployment/registry/component/dp_component.cxx
@@ -35,6 +35,7 @@
#include "svl/inettype.hxx"
#include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
#include "com/sun/star/container/XNameContainer.hpp"
+#include "com/sun/star/container/XHierarchicalNameAccess.hpp"
#include "com/sun/star/container/XSet.hpp"
#include "com/sun/star/registry/XSimpleRegistry.hpp"
#include "com/sun/star/registry/XImplementationRegistration.hpp"
@@ -183,6 +184,7 @@ class BackendImpl : public ::dp_registry::backend::PackageRegistryBackend
BackendImpl * getMyBackend() const;
const bool m_jarFile;
+ Reference<container::XHierarchicalNameAccess> m_xTDprov;
virtual void SAL_CALL disposing();
@@ -399,6 +401,7 @@ void BackendImpl::ComponentPackageImpl::disposing()
//______________________________________________________________________________
void BackendImpl::TypelibraryPackageImpl::disposing()
{
+ m_xTDprov.clear();
Package::disposing();
}
@@ -1530,12 +1533,37 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_(
}
else // RDB:
{
- css::uno::Reference< css::container::XSet >(
- that->getComponentContext()->getValueByName(
- "/singletons"
- "/com.sun.star.reflection.theTypeDescriptionManager"),
- css::uno::UNO_QUERY_THROW)->insert(
- css::uno::makeAny(expandUnoRcUrl(url)));
+ Reference<XComponentContext> const & xContext =
+ that->getComponentContext();
+ if (! m_xTDprov.is())
+ {
+ m_xTDprov.set( that->getObject( url ), UNO_QUERY );
+ if (! m_xTDprov.is())
+ {
+ const Reference<registry::XSimpleRegistry> xReg(
+ xContext->getServiceManager()
+ ->createInstanceWithContext("com.sun.star.registry.SimpleRegistry",
+ xContext ), UNO_QUERY_THROW );
+ xReg->open( expandUnoRcUrl(url),
+ true /* read-only */, false /* ! create */ );
+ const Any arg(xReg);
+ Reference<container::XHierarchicalNameAccess> xTDprov(
+ xContext->getServiceManager()
+ ->createInstanceWithArgumentsAndContext(
+ "com.sun.star.comp.stoc.RegistryTypeDescriptionProvider",
+ Sequence<Any>( &arg, 1 ), xContext ), UNO_QUERY );
+ OSL_ASSERT( xTDprov.is() );
+ if (xTDprov.is())
+ m_xTDprov.set( that->insertObject( url, xTDprov ),
+ UNO_QUERY_THROW );
+ }
+ }
+ if (m_xTDprov.is()) {
+ Reference<container::XSet> xSet(
+ xContext->getValueByName( "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ),
+ UNO_QUERY_THROW );
+ xSet->insert( Any(m_xTDprov) );
+ }
}
that->addToUnoRc( m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB,
@@ -1547,13 +1575,18 @@ void BackendImpl::TypelibraryPackageImpl::processPackage_(
m_jarFile ? RCITEM_JAR_TYPELIB : RCITEM_RDB_TYPELIB, url, xCmdEnv );
// revoking types at runtime, possible, sensible?
- if (!m_jarFile) {
- css::uno::Reference< css::container::XSet >(
+ if (!m_xTDprov.is())
+ m_xTDprov.set( that->getObject( url ), UNO_QUERY );
+ if (m_xTDprov.is()) {
+ // remove live:
+ const Reference<container::XSet> xSet(
that->getComponentContext()->getValueByName(
- "/singletons"
- "/com.sun.star.reflection.theTypeDescriptionManager"),
- css::uno::UNO_QUERY_THROW)->remove(
- css::uno::makeAny(expandUnoRcUrl(url)));
+ "/singletons/com.sun.star.reflection.theTypeDescriptionManager" ),
+ UNO_QUERY_THROW );
+ xSet->remove( Any(m_xTDprov) );
+
+ that->releaseObject( url );
+ m_xTDprov.clear();
}
}
}