summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/source/property/opropertybag.cxx9
-rw-r--r--comphelper/source/property/property.cxx25
2 files changed, 24 insertions, 10 deletions
diff --git a/comphelper/source/property/opropertybag.cxx b/comphelper/source/property/opropertybag.cxx
index 8b816e8c1ce9..caa895021103 100644
--- a/comphelper/source/property/opropertybag.cxx
+++ b/comphelper/source/property/opropertybag.cxx
@@ -240,7 +240,7 @@ namespace comphelper
if ( !( _element >>= aProperty ) )
throw IllegalArgumentException( ::rtl::OUString(), *this, 1 );
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard g( m_aMutex );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
@@ -254,6 +254,7 @@ namespace comphelper
// our property info is dirty
m_pArrayHelper.reset();
+ g.clear();
setModified(sal_True);
}
@@ -346,7 +347,7 @@ namespace comphelper
//--------------------------------------------------------------------
void SAL_CALL OPropertyBag::addProperty( const ::rtl::OUString& _rName, ::sal_Int16 _nAttributes, const Any& _rInitialValue ) throw (PropertyExistException, IllegalTypeException, IllegalArgumentException, RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard g( m_aMutex );
// check whether the type is allowed, everything else will be checked
// by m_aDynamicProperties
@@ -362,19 +363,21 @@ namespace comphelper
// our property info is dirty
m_pArrayHelper.reset();
+ g.clear();
setModified(sal_True);
}
//--------------------------------------------------------------------
void SAL_CALL OPropertyBag::removeProperty( const ::rtl::OUString& _rName ) throw (UnknownPropertyException, NotRemoveableException, RuntimeException)
{
- ::osl::MutexGuard aGuard( m_aMutex );
+ ::osl::ClearableMutexGuard g( m_aMutex );
m_aDynamicProperties.removeProperty( _rName );
// our property info is dirty
m_pArrayHelper.reset();
+ g.clear();
setModified(sal_True);
}
diff --git a/comphelper/source/property/property.cxx b/comphelper/source/property/property.cxx
index fe6cbaa9d767..0ccc28d4238b 100644
--- a/comphelper/source/property/property.cxx
+++ b/comphelper/source/property/property.cxx
@@ -38,15 +38,11 @@
#include <osl/diagnose.h>
#if OSL_DEBUG_LEVEL > 0
- #ifndef _RTL_STRBUF_HXX_
#include <rtl/strbuf.hxx>
- #endif
- #ifndef _CPPUHELPER_EXC_HLP_HXX_
#include <cppuhelper/exc_hlp.hxx>
- #endif
- #ifndef _OSL_THREAD_H_
#include <osl/thread.h>
- #endif
+ #include <com/sun/star/lang/XServiceInfo.hpp>
+ #include <typeinfo>
#endif
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/lang/IllegalArgumentException.hpp>
@@ -71,6 +67,10 @@ namespace comphelper
using ::com::sun::star::uno::cpp_queryInterface;
using ::com::sun::star::uno::cpp_acquire;
using ::com::sun::star::uno::cpp_release;
+#if OSL_DEBUG_LEVEL > 0
+ using ::com::sun::star::lang::XServiceInfo;
+#endif
+ using ::com::sun::star::uno::UNO_QUERY;
/** === end UNO using === **/
namespace PropertyAttribute = ::com::sun::star::beans::PropertyAttribute;
@@ -110,7 +110,18 @@ void copyProperties(const Reference<XPropertySet>& _rxSource,
::rtl::OStringBuffer aBuffer;
aBuffer.append( "::comphelper::copyProperties: could not copy property '" );
aBuffer.append( ::rtl::OString( pSourceProps->Name.getStr(), pSourceProps->Name.getLength(), RTL_TEXTENCODING_ASCII_US ) );
- aBuffer.append( "' to the destination set.\n" );
+ aBuffer.append( "' to the destination set (a '" );
+
+ Reference< XServiceInfo > xSI( _rxDest, UNO_QUERY );
+ if ( xSI.is() )
+ {
+ aBuffer.append( ::rtl::OUStringToOString( xSI->getImplementationName(), osl_getThreadTextEncoding() ) );
+ }
+ else
+ {
+ aBuffer.append( typeid( *_rxDest.get() ).name() );
+ }
+ aBuffer.append( "' implementation).\n" );
Any aException( ::cppu::getCaughtException() );
aBuffer.append( "Caught an exception of type '" );