summaryrefslogtreecommitdiff
path: root/ucb
diff options
context:
space:
mode:
authorJens-Heiner Rechtien <hr@openoffice.org>2004-05-10 13:23:24 +0000
committerJens-Heiner Rechtien <hr@openoffice.org>2004-05-10 13:23:24 +0000
commit66ca8de43c9ae4b5b6447285e73c9475199f4cdc (patch)
tree6c98efd99538e548c5bfe902f955083ff1da0987 /ucb
parent67d44ef4ff0bda2618a18a1ffb572beeb96bd004 (diff)
INTEGRATION: CWS relocinst (1.11.164); FILE MERGED
2004/04/22 11:30:20 kso 1.11.164.2: #116281# - OfficeInstallationDirectory -> OfficeInstallationDirectories 2004/04/13 08:39:11 kso 1.11.164.1: #116281# - Does no longer store absolute paths to the office installation dir.
Diffstat (limited to 'ucb')
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyprovider.cxx53
1 files changed, 51 insertions, 2 deletions
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index bd3e116c4270..8eea2aac315f 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -2,9 +2,9 @@
*
* $RCSfile: hierarchyprovider.cxx,v $
*
- * $Revision: 1.11 $
+ * $Revision: 1.12 $
*
- * last change: $Author: kso $ $Date: 2001-07-12 15:04:00 $
+ * last change: $Author: hr $ $Date: 2004-05-10 14:23:24 $
*
* The Contents of this file are made available subject to the terms of
* either of the following licenses
@@ -73,9 +73,15 @@
#ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
#include <com/sun/star/beans/PropertyValue.hpp>
#endif
+#ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
+#include <com/sun/star/beans/XPropertySet.hpp>
+#endif
#ifndef _COM_SUN_STAR_CONTAINER_XHIERARCHICALNAMEACCESS_HPP_
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
#endif
+#ifndef _COM_SUN_STAR_UTIL_XOFFICEINSTALLATIONDIRECTORIES_HPP_
+#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
+#endif
#ifndef _UCBHELPER_CONTENTIDENTIFIER_HXX
#include <ucbhelper/contentidentifier.hxx>
#endif
@@ -339,3 +345,46 @@ HierarchyContentProvider::getRootConfigReadNameAccess(
return (*it).second.xRootReadAccess;
}
+//=========================================================================
+uno::Reference< util::XOfficeInstallationDirectories >
+HierarchyContentProvider::getOfficeInstallationDirectories()
+{
+ if ( !m_xOfficeInstDirs.is() )
+ {
+ vos::OGuard aGuard( m_aMutex );
+ if ( !m_xOfficeInstDirs.is() )
+ {
+ OSL_ENSURE( m_xSMgr.is(), "No service manager!" );
+
+ uno::Reference< uno::XComponentContext > xCtx;
+ uno::Reference< beans::XPropertySet > xPropSet(
+ m_xSMgr, uno::UNO_QUERY );
+ if ( xPropSet.is() )
+ {
+ xPropSet->getPropertyValue(
+ rtl::OUString(
+ RTL_CONSTASCII_USTRINGPARAM( "DefaultContext" ) ) )
+ >>= xCtx;
+ }
+
+ OSL_ENSURE( xCtx.is(),
+ "Unable to obtain component context from "
+ "service manager!" );
+
+ if ( xCtx.is() )
+ {
+ xCtx->getValueByName(
+ rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+ "/singletons/"
+ "com.sun.star.util.theOfficeInstallationDirectories" ) ) )
+ >>= m_xOfficeInstDirs;
+
+// Be silent. singleton only available in an Office environment.
+// OSL_ENSURE( m_xOfficeInstDirs.is(),
+// "Unable to obtain office directories singleton!" );
+ }
+ }
+ }
+ return m_xOfficeInstDirs;
+}
+