diff options
-rw-r--r-- | basctl/source/basicide/doceventnotifier.cxx | 23 | ||||
-rw-r--r-- | extensions/source/propctrlr/formcomponenthandler.cxx | 23 | ||||
-rw-r--r-- | extensions/source/propctrlr/formresid.hrc | 2 |
3 files changed, 36 insertions, 12 deletions
diff --git a/basctl/source/basicide/doceventnotifier.cxx b/basctl/source/basicide/doceventnotifier.cxx index e4332891d1d1..f97420da5926 100644 --- a/basctl/source/basicide/doceventnotifier.cxx +++ b/basctl/source/basicide/doceventnotifier.cxx @@ -140,8 +140,7 @@ namespace basctl //-------------------------------------------------------------------- void SAL_CALL DocumentEventNotifier_Impl::notifyEvent( const EventObject& _rEvent ) throw (RuntimeException) { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); - ::osl::MutexGuard aGuard( m_aMutex ); + ::osl::ClearableMutexGuard aGuard( m_aMutex ); OSL_PRECOND( !impl_isDisposed_nothrow(), "DocumentEventNotifier_Impl::notifyEvent: disposed, but still getting events?" ); if ( impl_isDisposed_nothrow() ) @@ -151,7 +150,6 @@ namespace basctl OSL_ENSURE( xDocument.is(), "DocumentEventNotifier_Impl::notifyEvent: illegal source document!" ); if ( !xDocument.is() ) return; - ScriptDocument aDocument( xDocument ); struct EventEntry { @@ -172,8 +170,24 @@ namespace basctl for ( size_t i=0; i < sizeof( aEvents ) / sizeof( aEvents[0] ); ++i ) { - if ( _rEvent.EventName.equalsAscii( aEvents[i].pEventName ) ) + if ( !_rEvent.EventName.equalsAscii( aEvents[i].pEventName ) ) + continue; + + ScriptDocument aDocument( xDocument ); + { + // the listener implementations usually require the SolarMutex, so lock it here. + // But ensure the proper order of locking the solar and the own mutex + aGuard.clear(); + ::vos::OClearableGuard aSolarGuard( Application::GetSolarMutex() ); + ::osl::MutexGuard aGuard2( m_aMutex ); + + if ( impl_isDisposed_nothrow() ) + // somebody took the chance to dispose us -> bail out + return; + (m_pListener->*aEvents[i].listenerMethod)( aDocument ); + } + break; } } @@ -250,7 +264,6 @@ namespace basctl //-------------------------------------------------------------------- void DocumentEventNotifier::dispose() { - ::vos::OGuard aSolarGuard( Application::GetSolarMutex() ); m_pImpl->dispose(); } diff --git a/extensions/source/propctrlr/formcomponenthandler.cxx b/extensions/source/propctrlr/formcomponenthandler.cxx index c413de6e7e44..b6dc84dff225 100644 --- a/extensions/source/propctrlr/formcomponenthandler.cxx +++ b/extensions/source/propctrlr/formcomponenthandler.cxx @@ -559,8 +559,12 @@ namespace pcr ::rtl::OUString sControlValue; OSL_VERIFY( _rControlValue >>= sControlValue ); - String sShowHide = String( PcrRes( RID_STR_SHOW_HIDE ) ); - aPropertyValue <<= (sal_Bool)( sShowHide.GetToken(1) == String( sControlValue ) ); + ::std::vector< ::rtl::OUString > aListEntries; + tools::StringListResource aRes( PcrRes( RID_RSC_ENUM_SHOWHIDE ), aListEntries ); + OSL_ENSURE( aListEntries.size() == 2, "FormComponentPropertyHandler::convertToPropertyValue: broken resource for Show/Hide!" ); + sal_Bool bShow = ( aListEntries.size() < 2 ) || ( sControlValue == aListEntries[1] ); + + aPropertyValue <<= bShow; } break; @@ -661,10 +665,17 @@ namespace pcr case PROPERTY_ID_SHOW_RECORDACTIONS: case PROPERTY_ID_SHOW_FILTERSORT: { - String aEntries = PcrRes( RID_STR_SHOW_HIDE ); - ::rtl::OUString sControlValue( - ::comphelper::getBOOL( _rPropertyValue ) ? aEntries.GetToken( 1 ) : aEntries.GetToken( 0 ) ); - aControlValue <<= sControlValue; + ::std::vector< ::rtl::OUString > aListEntries; + tools::StringListResource aRes( PcrRes( RID_RSC_ENUM_SHOWHIDE ), aListEntries ); + OSL_ENSURE( aListEntries.size() == 2, "FormComponentPropertyHandler::convertToControlValue: broken resource for Show/Hide!" ); + + if ( aListEntries.size() == 2 ) + { + ::rtl::OUString sControlValue = ::comphelper::getBOOL( _rPropertyValue ) + ? aListEntries[1] + : aListEntries[0]; + aControlValue <<= sControlValue; + } } break; diff --git a/extensions/source/propctrlr/formresid.hrc b/extensions/source/propctrlr/formresid.hrc index badda59d2d2c..cfd9e7aaebfe 100644 --- a/extensions/source/propctrlr/formresid.hrc +++ b/extensions/source/propctrlr/formresid.hrc @@ -248,7 +248,7 @@ #define RID_STR_HIDEINACTIVESELECTION ( RID_FORMBROWSER_START + 217 ) #define RID_STR_VISUALEFFECT ( RID_FORMBROWSER_START + 218 ) #define RID_STR_BORDERCOLOR ( RID_FORMBROWSER_START + 219 ) -#define RID_STR_SHOW_HIDE ( RID_FORMBROWSER_START + 220 ) + // FREE #define RID_STR_XML_DATA_MODEL ( RID_FORMBROWSER_START + 221 ) #define RID_STR_BIND_EXPRESSION ( RID_FORMBROWSER_START + 222 ) #define RID_STR_XSD_REQUIRED ( RID_FORMBROWSER_START + 223 ) |