summaryrefslogtreecommitdiff
path: root/xmlhelp
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2009-12-10 17:46:18 +0100
committersb <sb@openoffice.org>2009-12-10 17:46:18 +0100
commitd9164f354a8951ad220d5ae937517228296d1922 (patch)
tree17bcc6282d3708c3331a59513fb40ccefeaaad4b /xmlhelp
parentb069d0fabfa30848596bdc106380f75a725b686e (diff)
parent875ac20478f16e5107acb222c0b851b99d2e0f27 (diff)
sb111: merged in DEV300_m67
Diffstat (limited to 'xmlhelp')
-rw-r--r--xmlhelp/source/cxxhelp/provider/databases.cxx20
1 files changed, 20 insertions, 0 deletions
diff --git a/xmlhelp/source/cxxhelp/provider/databases.cxx b/xmlhelp/source/cxxhelp/provider/databases.cxx
index a727ec82b70c..0f92d909d525 100644
--- a/xmlhelp/source/cxxhelp/provider/databases.cxx
+++ b/xmlhelp/source/cxxhelp/provider/databases.cxx
@@ -137,6 +137,19 @@ rtl::OUString Databases::expandURL( const rtl::OUString& aURL, Reference< uno::X
return aRetURL;
}
+
+// Hold Packages to improve performance (#i106100)
+// The PackageManager implementation seems to completely throw away all cached data
+// as soon as the last reference to a XPackage dies. Maybe this should be changed.
+struct ImplPackageSequenceHolder
+{
+ Sequence< Reference< deployment::XPackage > > m_aUserPackagesSeq;
+ Sequence< Reference< deployment::XPackage > > m_aSharedPackagesSeq;
+};
+
+static ImplPackageSequenceHolder* GpPackageSequenceHolder = NULL;
+
+
Databases::Databases( sal_Bool showBasic,
const rtl::OUString& instPath,
const com::sun::star::uno::Sequence< rtl::OUString >& imagesZipPaths,
@@ -182,6 +195,8 @@ Databases::Databases( sal_Bool showBasic,
m_xSFA = Reference< ucb::XSimpleFileAccess >(
m_xSMgr->createInstanceWithContext( rtl::OUString::createFromAscii( "com.sun.star.ucb.SimpleFileAccess" ),
m_xContext ), UNO_QUERY_THROW );
+
+ GpPackageSequenceHolder = new ImplPackageSequenceHolder();
}
Databases::~Databases()
@@ -230,6 +245,7 @@ Databases::~Databases()
}
}
+ delete GpPackageSequenceHolder;
}
static bool impl_getZipFile(
@@ -1525,6 +1541,8 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextUserHelpPack
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("user") );
m_aUserPackagesSeq = xUserManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ if( GpPackageSequenceHolder != NULL )
+ GpPackageSequenceHolder->m_aUserPackagesSeq = m_aUserPackagesSeq;
m_bUserPackagesLoaded = true;
}
@@ -1555,6 +1573,8 @@ Reference< deployment::XPackage > ExtensionIteratorBase::implGetNextSharedHelpPa
thePackageManagerFactory::get( m_xContext )->getPackageManager( rtl::OUString::createFromAscii("shared") );
m_aSharedPackagesSeq = xSharedManager->getDeployedPackages
( Reference< task::XAbortChannel >(), Reference< ucb::XCommandEnvironment >() );
+ if( GpPackageSequenceHolder != NULL )
+ GpPackageSequenceHolder->m_aSharedPackagesSeq = m_aSharedPackagesSeq;
m_bSharedPackagesLoaded = true;
}