summaryrefslogtreecommitdiff
path: root/chart2
diff options
context:
space:
mode:
authorIngrid Halama <iha@openoffice.org>2010-05-26 17:39:17 +0200
committerIngrid Halama <iha@openoffice.org>2010-05-26 17:39:17 +0200
commitdbabefbcf1457f88d58c205c1da1630671ba9efd (patch)
treef3cf8b06d65bbc76fed02cfba34a15b4e9455dcf /chart2
parent7ac5261f789e58e489652ed988319568185b681b (diff)
chart47: #i86555# prevent deadlock while changing title vie API
Diffstat (limited to 'chart2')
-rw-r--r--chart2/source/model/main/FormattedString.cxx10
-rw-r--r--chart2/source/model/main/Title.cxx17
2 files changed, 15 insertions, 12 deletions
diff --git a/chart2/source/model/main/FormattedString.cxx b/chart2/source/model/main/FormattedString.cxx
index ae810266df29..9d38fafd3cf7 100644
--- a/chart2/source/model/main/FormattedString.cxx
+++ b/chart2/source/model/main/FormattedString.cxx
@@ -122,11 +122,13 @@ uno::Reference< util::XCloneable > SAL_CALL FormattedString::createClone()
void SAL_CALL FormattedString::setString( const ::rtl::OUString& String )
throw (uno::RuntimeException)
{
- // /--
- MutexGuard aGuard( GetMutex());
- m_aString = String;
+ {
+ MutexGuard aGuard( GetMutex());
+ m_aString = String;
+ }
+ //don't keep the mutex locked while calling out
fireModifyEvent();
- // \--
+
}
// ____ XModifyBroadcaster ____
diff --git a/chart2/source/model/main/Title.cxx b/chart2/source/model/main/Title.cxx
index 0a215c2d4c15..8b3235636964 100644
--- a/chart2/source/model/main/Title.cxx
+++ b/chart2/source/model/main/Title.cxx
@@ -265,15 +265,16 @@ uno::Sequence< uno::Reference< chart2::XFormattedString > > SAL_CALL Title::getT
void SAL_CALL Title::setText( const uno::Sequence< uno::Reference< chart2::XFormattedString > >& Strings )
throw (uno::RuntimeException)
{
- // /--
- MutexGuard aGuard( GetMutex() );
- ModifyListenerHelper::removeListenerFromAllElements(
- ContainerHelper::SequenceToVector( m_aStrings ), m_xModifyEventForwarder );
- m_aStrings = Strings;
- ModifyListenerHelper::addListenerToAllElements(
- ContainerHelper::SequenceToVector( m_aStrings ), m_xModifyEventForwarder );
+ {
+ MutexGuard aGuard( GetMutex() );
+ ModifyListenerHelper::removeListenerFromAllElements(
+ ContainerHelper::SequenceToVector( m_aStrings ), m_xModifyEventForwarder );
+ m_aStrings = Strings;
+ ModifyListenerHelper::addListenerToAllElements(
+ ContainerHelper::SequenceToVector( m_aStrings ), m_xModifyEventForwarder );
+ }
+ //don't keep the mutex locked while calling out
fireModifyEvent();
- // \--
}
// ================================================================================