summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-02-13 08:31:59 +0200
committerNoel Grandin <noel@peralex.com>2013-03-04 10:13:19 +0200
commitfb0f7c2415321a3bcae00802b98ae76144ea4e79 (patch)
tree36dad4567ce8bddb82dc0b78a8eead16fdaaa825
parent57dbe20c2bfa0cf5ced0826f61a130414c948f83 (diff)
fdo#46808, convert singleton util::theOfficeInstallationDirectories
.. to new-style UNO. And deprecate old service in favour of singleton. Change-Id: I67244097c22af02530214d7c529dd0d32f5964c1
-rw-r--r--offapi/UnoApi_offapi.mk1
-rw-r--r--offapi/com/sun/star/util/OfficeInstallationDirectories.idl20
-rw-r--r--offapi/com/sun/star/util/theOfficeInstallationDirectories.idl48
-rw-r--r--offapi/type_reference/types.rdbbin7440384 -> 7439872 bytes
-rw-r--r--sfx2/source/doc/doctemplates.cxx11
-rw-r--r--svtools/source/misc/templatefoldercache.cxx10
-rw-r--r--ucb/source/ucp/hierarchy/hierarchyprovider.cxx10
7 files changed, 58 insertions, 42 deletions
diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk
index 21e050fbe16d..6877658c4f5c 100644
--- a/offapi/UnoApi_offapi.mk
+++ b/offapi/UnoApi_offapi.mk
@@ -362,6 +362,7 @@ $(eval $(call gb_UnoApi_add_idlfiles_nohdl,offapi,offapi/com/sun/star/util,\
NumberFormatsSupplier \
PathSubstitution \
TextSearch \
+ theOfficeInstallationDirectories \
UriAbbreviation \
URLTransformer \
))
diff --git a/offapi/com/sun/star/util/OfficeInstallationDirectories.idl b/offapi/com/sun/star/util/OfficeInstallationDirectories.idl
index a4c8f13d2865..94f7164f14bd 100644
--- a/offapi/com/sun/star/util/OfficeInstallationDirectories.idl
+++ b/offapi/com/sun/star/util/OfficeInstallationDirectories.idl
@@ -39,24 +39,10 @@ module com { module sun { module star { module util {
installations.
@since OOo 2.0
+ @deprecated rather use the singleton theOfficeInstallationDirectories
*/
-published service OfficeInstallationDirectories
-{
- /** provides access to the current office installation directories (office
- base installation and user data).
- */
- interface com::sun::star::util::XOfficeInstallationDirectories;
-};
-
-
-/** A singleton that provides access to the current office installation
- directories.
-
- @see OfficeInstallationDirectories
-*/
-published singleton theOfficeInstallationDirectories
-{
- service com::sun::star::util::OfficeInstallationDirectories;
+published service OfficeInstallationDirectories {
+ interface XOfficeInstallationDirectories;
};
diff --git a/offapi/com/sun/star/util/theOfficeInstallationDirectories.idl b/offapi/com/sun/star/util/theOfficeInstallationDirectories.idl
new file mode 100644
index 000000000000..275c069ddde0
--- /dev/null
+++ b/offapi/com/sun/star/util/theOfficeInstallationDirectories.idl
@@ -0,0 +1,48 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#ifndef __com_sun_star_util_theOfficeInstallationDirectories_idl__
+#define __com_sun_star_util_theOfficeInstallationDirectories_idl__
+
+#include <com/sun/star/util/XOfficeInstallationDirectories.idl>
+
+
+module com { module sun { module star { module util {
+
+
+/** encapsulates access to the current office installation directory and
+ office user data directory, provides functionality to create URLs
+ containing relocatable (not absolute) references to the current office
+ installation directory and user data directory and vice versa.
+
+ <p>This functionality is useful when data containing references to the
+ current office installation directory or user data directory must be made
+ persistent and re-read later. In many cases, storing the reference
+ directly would destroy the relocatability of an office installation and the
+ possibility to share one office user data directory among parallel office
+ installations.
+ */
+published singleton theOfficeInstallationDirectories : XOfficeInstallationDirectories;
+
+
+}; }; }; };
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/offapi/type_reference/types.rdb b/offapi/type_reference/types.rdb
index 720c3ecd6e50..ff334d8332de 100644
--- a/offapi/type_reference/types.rdb
+++ b/offapi/type_reference/types.rdb
Binary files differ
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index d85ca00f72f5..c25faa6a9811 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -40,6 +40,7 @@
#include <com/sun/star/beans/XPropertyContainer.hpp>
#include <com/sun/star/beans/StringPair.hpp>
#include <com/sun/star/util/theMacroExpander.hpp>
+#include <com/sun/star/util/theOfficeInstallationDirectories.hpp>
#include <com/sun/star/configuration/theDefaultProvider.hpp>
#include <com/sun/star/container/XContainerQuery.hpp>
#include <com/sun/star/document/XTypeDetection.hpp>
@@ -2830,15 +2831,7 @@ void SfxURLRelocator_Impl::initOfficeInstDirs()
uno::Reference< XComponentContext > xCtx(
comphelper::getComponentContext( mxFactory ) );
- xCtx->getValueByName(
- rtl::OUString(
- "/singletons/"
- "com.sun.star.util.theOfficeInstallationDirectories" ) )
- >>= mxOfficeInstDirs;
-
- OSL_ENSURE( mxOfficeInstDirs.is(),
- "Unable to obtain office installation directory "
- "singleton!" );
+ mxOfficeInstDirs = theOfficeInstallationDirectories::get(xCtx);
}
}
}
diff --git a/svtools/source/misc/templatefoldercache.cxx b/svtools/source/misc/templatefoldercache.cxx
index 18e873024165..538c2246111a 100644
--- a/svtools/source/misc/templatefoldercache.cxx
+++ b/svtools/source/misc/templatefoldercache.cxx
@@ -25,7 +25,7 @@
#include <com/sun/star/sdbc/XRow.hpp>
#include <com/sun/star/ucb/XContentAccess.hpp>
#include <com/sun/star/uno/XComponentContext.hpp>
-#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
+#include <com/sun/star/util/theOfficeInstallationDirectories.hpp>
#include <ucbhelper/content.hxx>
#include <rtl/ref.hxx>
#include <salhelper/simplereferenceobject.hxx>
@@ -829,13 +829,7 @@ namespace svt
{
uno::Reference< uno::XComponentContext > xCtx(
comphelper::getProcessComponentContext() );
- xCtx->getValueByName(
- rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
- "/singletons/com.sun.star.util.theOfficeInstallationDirectories" ) ) )
- >>= m_xOfficeInstDirs;
-
- OSL_ENSURE( m_xOfficeInstDirs.is(),
- "Unable to obtain office directories singleton!" );
+ m_xOfficeInstDirs = util::theOfficeInstallationDirectories::get(xCtx);
}
}
return m_xOfficeInstDirs;
diff --git a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
index 0fc6ec64c89a..2920d4461dd2 100644
--- a/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
+++ b/ucb/source/ucp/hierarchy/hierarchyprovider.cxx
@@ -28,7 +28,7 @@
#include <osl/diagnose.h>
#include <com/sun/star/beans/PropertyValue.hpp>
#include <com/sun/star/container/XHierarchicalNameAccess.hpp>
-#include <com/sun/star/util/XOfficeInstallationDirectories.hpp>
+#include <com/sun/star/util/theOfficeInstallationDirectories.hpp>
#include <comphelper/processfactory.hxx>
#include <ucbhelper/contentidentifier.hxx>
#include "hierarchyprovider.hxx"
@@ -268,13 +268,7 @@ HierarchyContentProvider::getOfficeInstallationDirectories()
{
OSL_ENSURE( m_xContext.is(), "No service manager!" );
- m_xContext->getValueByName(
- rtl::OUString( "/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!" );
+ m_xOfficeInstDirs = util::theOfficeInstallationDirectories::get(m_xContext);
}
}
return m_xOfficeInstDirs;