summaryrefslogtreecommitdiff
path: root/unotools/source/config/confignode.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'unotools/source/config/confignode.cxx')
-rw-r--r--unotools/source/config/confignode.cxx60
1 files changed, 28 insertions, 32 deletions
diff --git a/unotools/source/config/confignode.cxx b/unotools/source/config/confignode.cxx
index 4b1b9fe272db..c8134137db0c 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);
@@ -155,13 +172,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();
}
}
}
@@ -455,16 +468,9 @@ namespace utl
aReturn = m_xHierarchyAccess->getByHierarchicalName(_rPath);
}
}
- catch(NoSuchElementException& e)
+ catch(const NoSuchElementException&)
{
- #if OSL_DEBUG_LEVEL > 0
- rtl::OStringBuffer aBuf( 256 );
- aBuf.append("OConfigurationNode::getNodeValue: caught a NoSuchElementException while trying to open ");
- aBuf.append( rtl::OUStringToOString( e.Message, RTL_TEXTENCODING_ASCII_US ) );
- OSL_ENSURE(sal_False, aBuf.getStr());
- #else
- (void)e;
- #endif
+ DBG_UNHANDLED_EXCEPTION();
}
return aReturn;
}
@@ -487,7 +493,7 @@ namespace utl
}
catch(Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationNode::cloneAsRoot: could not retrieve the node path!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
@@ -548,13 +554,9 @@ namespace utl
m_xCommitter->commitChanges();
return sal_True;
}
- catch(WrappedTargetException&)
- {
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::commit: caught a WrappedTargetException!");
- }
- catch(RuntimeException&)
+ catch(const Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::commit: caught a RuntimeException!");
+ DBG_UNHANDLED_EXCEPTION();
}
return sal_False;
}
@@ -591,7 +593,7 @@ namespace utl
}
catch(const Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::createWithProvider: unable to check the service conformance of the provider given!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
#endif
@@ -635,15 +637,9 @@ namespace utl
try { xComp->dispose(); } catch(Exception&) { }
}
}
- catch(Exception& e)
+ catch(const Exception&)
{
- #if OSL_DEBUG_LEVEL > 0
- ::rtl::OString sMessage( "OConfigurationTreeRoot::createWithProvider: caught an exception while creating the access object!\nmessage:\n" );
- sMessage += ::rtl::OString( e.Message.getStr(), e.Message.getLength(), RTL_TEXTENCODING_ASCII_US );
- OSL_ENSURE( sal_False, sMessage.getStr() );
- #else
- (void)e;
- #endif
+ DBG_UNHANDLED_EXCEPTION();
}
}
bTryAgain = CM_PREFER_UPDATABLE == _eMode;
@@ -670,9 +666,9 @@ namespace utl
if (xProviderAsFac.is())
return createWithProvider(xProviderAsFac, _rPath, _nDepth, _eMode, _bLazyWrite);
}
- catch(Exception&)
+ catch(const Exception&)
{
- OSL_ENSURE(sal_False, "OConfigurationTreeRoot::createWithServiceFactory: error while instantiating the provider service!");
+ DBG_UNHANDLED_EXCEPTION();
}
}
return OConfigurationTreeRoot();