summaryrefslogtreecommitdiff
path: root/unotools
diff options
context:
space:
mode:
authorsb <sb@openoffice.org>2010-01-21 09:42:10 +0100
committersb <sb@openoffice.org>2010-01-21 09:42:10 +0100
commit08e3d3d8892f40bac9b1c45ecf331e8c0f4ffcbd (patch)
tree2998da1e3e89a052c292af2f9f0ab6063f1286ab /unotools
parent76931af4a549c5f3ce155b054f80213caf023261 (diff)
parent7f5f6c30e89c27422a1576ccceb9b0d79c8e3f0d (diff)
sb111: merged in DEV300_m70
Diffstat (limited to 'unotools')
-rw-r--r--unotools/inc/unotools/confignode.hxx3
-rw-r--r--unotools/source/config/confignode.cxx23
2 files changed, 21 insertions, 5 deletions
diff --git a/unotools/inc/unotools/confignode.hxx b/unotools/inc/unotools/confignode.hxx
index 580274004e1a..2e305030fa2b 100644
--- a/unotools/inc/unotools/confignode.hxx
+++ b/unotools/inc/unotools/confignode.hxx
@@ -88,6 +88,9 @@ namespace utl
/// dtor
~OConfigurationNode() {}
+ /// returns the local name of the node
+ ::rtl::OUString getLocalName() const;
+
/** open a sub node
@param _rPath access path of the to-be-opened sub node. May be a hierarchical path.
*/
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index 9ba3f642c328..b0e1dc95f00a 100644
--- a/unotools/source/config/confignode.cxx
+++ b/unotools/source/config/confignode.cxx
@@ -41,6 +41,7 @@
#include <com/sun/star/lang/XComponent.hpp>
#include <com/sun/star/util/XStringEscape.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
+#include <com/sun/star/container/XNamed.hpp>
#include <comphelper/extract.hxx>
#include <rtl/string.hxx>
#if OSL_DEBUG_LEVEL > 0
@@ -139,6 +140,22 @@ namespace utl
}
//------------------------------------------------------------------------
+ ::rtl::OUString OConfigurationNode::getLocalName() const
+ {
+ ::rtl::OUString sLocalName;
+ try
+ {
+ Reference< XNamed > xNamed( m_xDirectAccess, UNO_QUERY_THROW );
+ sLocalName = xNamed->getName();
+ }
+ catch( const Exception& )
+ {
+ DBG_UNHANDLED_EXCEPTION();
+ }
+ return sLocalName;
+ }
+
+ //------------------------------------------------------------------------
::rtl::OUString OConfigurationNode::normalizeName(const ::rtl::OUString& _rName, NAMEORIGIN _eOrigin) const
{
::rtl::OUString sName(_rName);
@@ -154,13 +171,9 @@ namespace utl
else
sName = xEscaper->unescapeString(sName);
}
- catch(IllegalArgumentException&)
- {
- OSL_ENSURE(sal_False, "OConfigurationNode::normalizeName: illegal argument (caught an exception saying so)!");
- }
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::normalizeName: caught an exception!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
}