INTEGRATION: CWS dba202a (1.71.24); FILE MERGED
2005/11/25 13:42:11 fs 1.71.24.1: comphelper::OReusableGuard -> osl::ResettableMutexGuard / NOTIFY_LISTENERS replaced by ListenerContainer::forEach/notifyEach
This commit is contained in:
@@ -4,9 +4,9 @@
|
||||
*
|
||||
* $RCSfile: DatabaseForm.cxx,v $
|
||||
*
|
||||
* $Revision: 1.71 $
|
||||
* $Revision: 1.72 $
|
||||
*
|
||||
* last change: $Author: hr $ $Date: 2005-09-23 11:50:34 $
|
||||
* last change: $Author: obo $ $Date: 2005-12-21 13:20:23 $
|
||||
*
|
||||
* The Contents of this file are made available subject to
|
||||
* the terms of GNU Lesser General Public License Version 2.1.
|
||||
@@ -1152,7 +1152,7 @@ sal_Bool ODatabaseForm::InsertFilePart( INetMIMEMessage& rParent, const ::rtl::O
|
||||
//------------------------------------------------------------------------------
|
||||
void ODatabaseForm::onError(const SQLErrorEvent& _rEvent)
|
||||
{
|
||||
NOTIFY_LISTENERS(m_aErrorListeners, XSQLErrorListener, errorOccured, _rEvent);
|
||||
m_aErrorListeners.notifyEach( &XSQLErrorListener::errorOccured, _rEvent );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -1208,7 +1208,7 @@ bool ODatabaseForm::hasValidParent() const
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
bool ODatabaseForm::fillParameters( ReusableMutexGuard& _rClearForNotifies, const Reference< XInteractionHandler >& _rxCompletionHandler )
|
||||
bool ODatabaseForm::fillParameters( ::osl::ResettableMutexGuard& _rClearForNotifies, const Reference< XInteractionHandler >& _rxCompletionHandler )
|
||||
{
|
||||
// do we have to fill the parameters again?
|
||||
if ( !m_aParameterManager.isUpToDate() )
|
||||
@@ -1246,7 +1246,7 @@ void ODatabaseForm::restoreInsertOnlyState( )
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
sal_Bool ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler)
|
||||
sal_Bool ODatabaseForm::executeRowSet(::osl::ResettableMutexGuard& _rClearForNotifies, sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler)
|
||||
{
|
||||
if (!m_xAggregateAsRowSet.is())
|
||||
return sal_False;
|
||||
@@ -1297,7 +1297,7 @@ sal_Bool ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sa
|
||||
onError(eDb, m_sCurrentErrorContext);
|
||||
else
|
||||
onError(eDb, FRM_RES_STRING(RID_STR_READERROR));
|
||||
_rClearForNotifies.attach(m_aMutex);
|
||||
_rClearForNotifies.reset();
|
||||
|
||||
restoreInsertOnlyState( );
|
||||
}
|
||||
@@ -1339,7 +1339,7 @@ sal_Bool ODatabaseForm::executeRowSet(ReusableMutexGuard& _rClearForNotifies, sa
|
||||
onError(eDB, m_sCurrentErrorContext);
|
||||
else
|
||||
onError(eDB, FRM_RES_STRING(RID_STR_READERROR));
|
||||
_rClearForNotifies.attach(m_aMutex);
|
||||
_rClearForNotifies.reset();
|
||||
bSuccess = sal_False;
|
||||
}
|
||||
}
|
||||
@@ -1922,7 +1922,7 @@ Any ODatabaseForm::getPropertyDefaultByHandle( sal_Int32 nHandle ) const
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::reset() throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
|
||||
if (isLoaded())
|
||||
{
|
||||
@@ -1965,7 +1965,7 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners)
|
||||
if ( !m_aResetListeners.approveReset() )
|
||||
return;
|
||||
|
||||
ReusableMutexGuard aResetGuard(m_aResetSafety);
|
||||
::osl::ResettableMutexGuard aResetGuard(m_aResetSafety);
|
||||
// do we have a database connected form and stay on the insert row
|
||||
sal_Bool bInsertRow = sal_False;
|
||||
if (m_xAggregateSet.is())
|
||||
@@ -2057,7 +2057,7 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners)
|
||||
}
|
||||
}
|
||||
|
||||
aResetGuard.attach(m_aResetSafety);
|
||||
aResetGuard.reset();
|
||||
// ensure that the row isn't modified
|
||||
// (do this _before_ the listeners are notified ! their reaction (maybe asynchronous) may depend
|
||||
// on the modified state of the row
|
||||
@@ -2070,7 +2070,7 @@ void ODatabaseForm::reset_impl(bool _bAproveByListeners)
|
||||
m_aResetListeners.resetted();
|
||||
}
|
||||
|
||||
aResetGuard.attach(m_aResetSafety);
|
||||
aResetGuard.reset();
|
||||
// and again : ensure the row isn't modified
|
||||
// we already did this after we (and maybe our dependents) resetted the values, but the listeners may have changed the row, too
|
||||
if (bInsertRow)
|
||||
@@ -2383,7 +2383,7 @@ void ODatabaseForm::_propertyChanged(const PropertyChangeEvent& evt) throw( Runt
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com::sun::star::lang::NoSupportException, ::com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
|
||||
Reference<XForm> xParentForm(getParent(), UNO_QUERY);
|
||||
if (xParentForm.is())
|
||||
@@ -2424,7 +2424,7 @@ void SAL_CALL ODatabaseForm::setParent(const InterfaceRef& Parent) throw ( ::com
|
||||
//------------------------------------------------------------------------------
|
||||
sal_Bool SAL_CALL ODatabaseForm::getGroupControl() throw(com::sun::star::uno::RuntimeException)
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
|
||||
// Sollen Controls in einer TabOrder gruppe zusammengefasst werden?
|
||||
if (m_aCycle.hasValue())
|
||||
@@ -2443,7 +2443,7 @@ sal_Bool SAL_CALL ODatabaseForm::getGroupControl() throw(com::sun::star::uno::Ru
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::setControlModels(const Sequence<Reference<XControlModel> >& rControls) throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
|
||||
// TabIndex in der Reihenfolge der Sequence setzen
|
||||
const Reference<XControlModel>* pControls = rControls.getConstArray();
|
||||
@@ -2839,7 +2839,7 @@ sal_Bool ODatabaseForm::implEnsureConnection()
|
||||
//------------------------------------------------------------------------------
|
||||
void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler ) throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
|
||||
// are we already loaded?
|
||||
if (isLoaded())
|
||||
@@ -2876,7 +2876,7 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs
|
||||
m_bLoaded = sal_True;
|
||||
aGuard.clear();
|
||||
EventObject aEvt(static_cast<XWeak*>(this));
|
||||
NOTIFY_LISTENERS(m_aLoadListeners, XLoadListener, loaded, aEvt);
|
||||
m_aLoadListeners.notifyEach( &XLoadListener::loaded, aEvt );
|
||||
|
||||
// if we are on the insert row, we have to reset all controls
|
||||
// to set the default values
|
||||
@@ -2888,7 +2888,7 @@ void ODatabaseForm::load_impl(sal_Bool bCausedByParentForm, sal_Bool bMoveToFirs
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::unload() throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
if (!isLoaded())
|
||||
return;
|
||||
|
||||
@@ -2896,7 +2896,7 @@ void SAL_CALL ODatabaseForm::unload() throw( RuntimeException )
|
||||
|
||||
aGuard.clear();
|
||||
EventObject aEvt(static_cast<XWeak*>(this));
|
||||
NOTIFY_LISTENERS(m_aLoadListeners, XLoadListener, unloading, aEvt);
|
||||
m_aLoadListeners.notifyEach( &XLoadListener::unloading, aEvt );
|
||||
|
||||
if (m_xAggregateAsRowSet.is())
|
||||
{
|
||||
@@ -2919,7 +2919,7 @@ void SAL_CALL ODatabaseForm::unload() throw( RuntimeException )
|
||||
{
|
||||
eDB;
|
||||
}
|
||||
aGuard.attach(m_aMutex);
|
||||
aGuard.reset();
|
||||
}
|
||||
|
||||
m_bLoaded = sal_False;
|
||||
@@ -2930,7 +2930,7 @@ void SAL_CALL ODatabaseForm::unload() throw( RuntimeException )
|
||||
stopSharingConnection();
|
||||
|
||||
aGuard.clear();
|
||||
NOTIFY_LISTENERS(m_aLoadListeners, XLoadListener, unloaded, aEvt);
|
||||
m_aLoadListeners.notifyEach( &XLoadListener::unloaded, aEvt );
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
@@ -2942,7 +2942,7 @@ void SAL_CALL ODatabaseForm::reload() throw( RuntimeException )
|
||||
//------------------------------------------------------------------------------
|
||||
void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInteractionHandler >& _rxCompletionHandler ) throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
if (!isLoaded())
|
||||
return;
|
||||
|
||||
@@ -2959,7 +2959,7 @@ void ODatabaseForm::reload_impl(sal_Bool bMoveToFirst, const Reference< XInterac
|
||||
while (aIter.hasMoreElements())
|
||||
((XLoadListener*)aIter.next())->reloading(aEvent);
|
||||
|
||||
aGuard.attach(m_aMutex);
|
||||
aGuard.reset();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3025,7 +3025,7 @@ void SAL_CALL ODatabaseForm::cursorMoved(const EventObject& event) throw( Runtim
|
||||
{
|
||||
// reload the subform with the new parameters of the parent
|
||||
// do this handling delayed to provide of execute too many SQL Statements
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
if (m_pLoadTimer->IsActive())
|
||||
m_pLoadTimer->Stop();
|
||||
|
||||
@@ -3128,7 +3128,7 @@ sal_Bool SAL_CALL ODatabaseForm::approveRowSetChange(const EventObject& event) t
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::addRowSetApproveListener(const Reference<XRowSetApproveListener>& _rListener) throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
m_aRowSetApproveListeners.addInterface(_rListener);
|
||||
|
||||
// do we have to multiplex ?
|
||||
@@ -3146,7 +3146,7 @@ void SAL_CALL ODatabaseForm::addRowSetApproveListener(const Reference<XRowSetApp
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::removeRowSetApproveListener(const Reference<XRowSetApproveListener>& _rListener) throw( RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
// do we have to remove the multiplex ?
|
||||
m_aRowSetApproveListeners.removeInterface(_rListener);
|
||||
if ( m_aRowSetApproveListeners.getLength() == 0 )
|
||||
@@ -3190,7 +3190,7 @@ void SAL_CALL ODatabaseForm::removeParameterListener(const Reference<XDatabasePa
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::executeWithCompletion( const Reference< XInteractionHandler >& _rxHandler ) throw(SQLException, RuntimeException)
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
// the difference between execute and load is, that we position on the first row in case of load
|
||||
// after execute we remain before the first row
|
||||
if (!isLoaded())
|
||||
@@ -3218,7 +3218,7 @@ void SAL_CALL ODatabaseForm::executeWithCompletion( const Reference< XInteractio
|
||||
//------------------------------------------------------------------------------
|
||||
void SAL_CALL ODatabaseForm::execute() throw( SQLException, RuntimeException )
|
||||
{
|
||||
ReusableMutexGuard aGuard(m_aMutex);
|
||||
::osl::ResettableMutexGuard aGuard(m_aMutex);
|
||||
// if somebody calls an execute and we're not loaded we reroute this call to our load method.
|
||||
|
||||
// the difference between execute and load is, that we position on the first row in case of load
|
||||
|
Reference in New Issue
Block a user