Tag: cws_src680_qiq User: fs Date: 2006/06/27 05:14:18 Modified: dba/dbaccess/source/ui/browser/brwctrlr.cxx
Log: RESYNC: (1.91-1.92); FILE MERGED File Changes: Directory: /dba/dbaccess/source/ui/browser/ =========================================== File [changed]: brwctrlr.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/brwctrlr.cxx?r1=1.91.16.2&r2=1.91.16.3 Delta lines: +75 -85 --------------------- --- brwctrlr.cxx 19 Jun 2006 09:27:50 -0000 1.91.16.2 +++ brwctrlr.cxx 27 Jun 2006 12:14:15 -0000 1.91.16.3 @@ -310,10 +310,10 @@ DBG_NAME(FormControllerImpl) //------------------------------------------------------------------ -SbaXDataBrowserController::FormControllerImpl::FormControllerImpl(SbaXDataBrowserController* m_pOwner) - :m_pOwner(m_pOwner) +SbaXDataBrowserController::FormControllerImpl::FormControllerImpl(SbaXDataBrowserController* _pOwner) + :m_aActivateListeners(_pOwner->getMutex()) + ,m_pOwner(_pOwner) ,m_bActive(sal_False) - ,m_aActivateListeners(m_pOwner->getMutex()) { DBG_CTOR(FormControllerImpl,NULL); @@ -346,7 +346,7 @@ } //------------------------------------------------------------------ -void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & Model) throw( RuntimeException ) +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setModel(const Reference< ::com::sun::star::awt::XTabControllerModel > & /*Model*/) throw( RuntimeException ) { OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setModel : invalid call, can't change my model !"); } @@ -358,7 +358,7 @@ } //------------------------------------------------------------------ -void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContainer(const Reference< ::com::sun::star::awt::XControlContainer > & _Container) throw( RuntimeException ) +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::setContainer(const Reference< ::com::sun::star::awt::XControlContainer > & /*_Container*/) throw( RuntimeException ) { OSL_ENSURE(sal_False, "SbaXDataBrowserController::FormControllerImpl::setContainer : invalid call, can't change my container !"); } @@ -434,11 +434,13 @@ // ((::com::sun::star::form::XFormControllerListener*)aIter.next())->formDeactivated(aEvt); // m_bActive = sal_False; break; + default: + break; } } //------------------------------------------------------------------ -void SAL_CALL SbaXDataBrowserController::FormControllerImpl::disposing(const ::com::sun::star::lang::EventObject& Source) throw( RuntimeException ) +void SAL_CALL SbaXDataBrowserController::FormControllerImpl::disposing(const ::com::sun::star::lang::EventObject& /*Source*/) throw( RuntimeException ) { // nothing to do // we don't add ourself as listener to any broadcasters, so we are not resposible for removing us @@ -514,16 +516,16 @@ //------------------------------------------------------------------------------ SbaXDataBrowserController::SbaXDataBrowserController(const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM) :OGenericUnoController(_rM) + ,m_aAsyncGetCellFocus(LINK(this, SbaXDataBrowserController, OnAsyncGetCellFocus)) + ,m_sStateSaveRecord(ModuleRes(RID_STR_SAVE_CURRENT_RECORD)) + ,m_sStateUndoRecord(ModuleRes(RID_STR_UNDO_MODIFY_RECORD)) ,m_pLoadThread(NULL) - ,m_bClosingKillOpen( sal_False ) - ,m_bLoadCanceled( sal_False ) + ,m_pFormControllerImpl(NULL) ,m_nPendingLoadFinished(0) ,m_nFormActionNestingLevel(0) + ,m_bLoadCanceled( sal_False ) + ,m_bClosingKillOpen( sal_False ) ,m_bErrorOccured( sal_False ) - ,m_sStateSaveRecord(ModuleRes(RID_STR_SAVE_CURRENT_RECORD)) - ,m_sStateUndoRecord(ModuleRes(RID_STR_UNDO_MODIFY_RECORD)) - ,m_aAsyncGetCellFocus(LINK(this, SbaXDataBrowserController, OnAsyncGetCellFocus)) - ,m_pFormControllerImpl(NULL) { DBG_CTOR(SbaXDataBrowserController,NULL); @@ -751,13 +753,13 @@ return sal_True; } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::AddColumnListener(const Reference< XPropertySet > & xCol) +void SbaXDataBrowserController::AddColumnListener(const Reference< XPropertySet > & /*xCol*/) { // we're not interested in any column properties ... } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::RemoveColumnListener(const Reference< XPropertySet > & xCol) +void SbaXDataBrowserController::RemoveColumnListener(const Reference< XPropertySet > & /*xCol*/) { } //------------------------------------------------------------------------------ @@ -789,10 +791,10 @@ } // ------------------------------------------------------------------------- -void SbaXDataBrowserController::removeModelListeners(const Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel) +void SbaXDataBrowserController::removeModelListeners(const Reference< XControlModel > & _xGridControlModel) { // every single column model - Reference< ::com::sun::star::container::XIndexContainer > xColumns(getControlModel(), UNO_QUERY); + Reference< XIndexContainer > xColumns(_xGridControlModel, UNO_QUERY); if (xColumns.is()) { sal_Int32 nCount = xColumns->getCount(); @@ -803,13 +805,13 @@ } } - Reference< ::com::sun::star::container::XContainer > xColContainer(getControlModel(), UNO_QUERY); + Reference< XContainer > xColContainer(_xGridControlModel, UNO_QUERY); if (xColContainer.is()) - xColContainer->removeContainerListener((::com::sun::star::container::XContainerListener*)this); + xColContainer->removeContainerListener( this ); - Reference< ::com::sun::star::form::XReset > xReset(getControlModel(), UNO_QUERY); + Reference< XReset > xReset(_xGridControlModel, UNO_QUERY); if (xReset.is()) - xReset->removeResetListener((::com::sun::star::form::XResetListener*)this); + xReset->removeResetListener( this ); } // ------------------------------------------------------------------------- @@ -848,7 +850,7 @@ } //------------------------------------------------------------------ -void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& e) throw( RuntimeException ) +void SAL_CALL SbaXDataBrowserController::focusGained(const FocusEvent& /*e*/) throw( RuntimeException ) { // notify our activate listeners (registered on the form controller aggregate) EventObject aEvt(*this); @@ -892,13 +894,13 @@ } // ------------------------------------------------------------------------- -void SbaXDataBrowserController::disposingGridControl(const ::com::sun::star::lang::EventObject& Source) +void SbaXDataBrowserController::disposingGridControl(const ::com::sun::star::lang::EventObject& /*Source*/) { removeControlListeners(getBrowserView()->getGridControl()); } // ------------------------------------------------------------------------- -void SbaXDataBrowserController::disposingGridModel(const ::com::sun::star::lang::EventObject& Source) +void SbaXDataBrowserController::disposingGridModel(const ::com::sun::star::lang::EventObject& /*Source*/) { removeModelListeners(getControlModel()); } @@ -1061,7 +1063,7 @@ } //------------------------------------------------------------------------ -void SbaXDataBrowserController::modified(const ::com::sun::star::lang::EventObject& aEvent) throw( RuntimeException ) +void SbaXDataBrowserController::modified(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { setCurrentModified( sal_True ); } @@ -1101,10 +1103,8 @@ } // ----------------------------------------------------------------------- -sal_Bool SbaXDataBrowserController::suspend(sal_Bool bSuspend) throw( RuntimeException ) +sal_Bool SbaXDataBrowserController::suspend(sal_Bool /*bSuspend*/) throw( RuntimeException ) { -// m_bSuspending = sal_True; -// // have a pending open operation ? if (PendingLoad()) { @@ -1150,7 +1150,6 @@ m_aAsyncInvalidateAll.CancelCall(); sal_Bool bSuccess = SaveModified(); -// m_bSuspending = sal_False; return bSuccess; } // ----------------------------------------------------------------------- @@ -1291,6 +1290,8 @@ // remove the "get cell focus"-event m_aAsyncGetCellFocus.CancelCall(); break; + default: + break; } } @@ -1319,7 +1320,7 @@ } Reference< ::com::sun::star::container::XIndexAccess > xParameters = aEvent.Parameters; - ::vos::OClearableGuard aGuard(Application::GetSolarMutex()); + ::vos::OGuard aSolarGuard(Application::GetSolarMutex()); // this may be executed in a non-main thread and we want to use vcl ... Window* pParent = Application::GetDefDialogParent(); // don't use the content as parent if it isn't visible @@ -1347,10 +1348,7 @@ // create the handler, let it handle the request Reference< XInteractionHandler > xHandler(getORB()->createInstance(SERVICE_SDB_INTERACTION_HANDLER), UNO_QUERY); if (xHandler.is()) - { - ::vos::OGuard aGuard(Application::GetSolarMutex()); xHandler->handle(xParamRequest); - } if (!pParamValues->wasSelected()) { // canceled @@ -1397,7 +1395,7 @@ //------------------------------------------------------------------------------ -sal_Bool SbaXDataBrowserController::approveReset(const ::com::sun::star::lang::EventObject& rEvent) throw( RuntimeException ) +sal_Bool SbaXDataBrowserController::approveReset(const ::com::sun::star::lang::EventObject& /*rEvent*/) throw( RuntimeException ) { return sal_True; } @@ -1406,11 +1404,12 @@ void SbaXDataBrowserController::resetted(const ::com::sun::star::lang::EventObject& rEvent) throw( RuntimeException ) { DBG_ASSERT(rEvent.Source == getControlModel(), "SbaXDataBrowserController::resetted : where did this come from ?"); + (void)rEvent; setCurrentModified( sal_False ); } //------------------------------------------------------------------------------ -sal_Bool SbaXDataBrowserController::confirmDelete(const ::com::sun::star::sdb::RowChangeEvent& aEvent) throw( RuntimeException ) +sal_Bool SbaXDataBrowserController::confirmDelete(const ::com::sun::star::sdb::RowChangeEvent& /*aEvent*/) throw( RuntimeException ) { if (QueryBox(getBrowserView(), ModuleRes(QUERY_BRW_DELETE_ROWS)).Execute() != RET_YES) return sal_False; @@ -1437,7 +1436,6 @@ // any filter or sort order set ? aReturn.bEnabled = m_xParser->getFilter().getLength() || m_xParser->getHavingClause().getLength() || m_xParser->getOrder().getLength(); return aReturn; - break; } // no chance while loading the form if (PendingLoad()) @@ -1591,17 +1589,9 @@ return OGenericUnoController::GetState(nId); } } - catch(Exception& e) + catch(const Exception& ) { -#if DBG_UTIL - String sMessage("SbaXDataBrowserController::GetState(", RTL_TEXTENCODING_ASCII_US); - sMessage += String::CreateFromInt32(nId); - sMessage.AppendAscii(") : caught an exception ! message : "); - sMessage += (const sal_Unicode*)e.Message; - DBG_ERROR(ByteString(sMessage, gsl_getSystemTextEncoding()).GetBuffer()); -#else - e; // make compiler happy -#endif + DBG_UNHANDLED_EXCEPTION(); } return aReturn; @@ -1820,7 +1810,7 @@ } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< PropertyValue >& aArgs) +void SbaXDataBrowserController::Execute(sal_uInt16 nId, const Sequence< PropertyValue >& /*aArgs*/) { sal_Bool bSortUp = sal_True; @@ -1915,18 +1905,8 @@ "SbaXDataBrowserController::Execute : caught an exception while composing the new filter !" ) - Reference< ::com::sun::star::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); - sal_uInt16 nViewPos = -1; - try - { - if ( xGrid.is() ) - nViewPos = xGrid->getCurrentColumnPosition(); - } - catch(Exception&) {} - if (bParserSuccess) applyParserOrder(sOldSort); - } break; @@ -2143,7 +2123,6 @@ Reference< ::com::sun::star::awt::XControl > xActiveControl(getBrowserView()->getGridControl()); Reference< ::com::sun::star::form::XBoundControl > xLockingTest(xActiveControl, UNO_QUERY); sal_Bool bControlIsLocked = xLockingTest.is() && xLockingTest->getLock(); - sal_Bool bResult = sal_True; if (xActiveControl.is() && !bControlIsLocked) { // zunaechst das Control fragen ob es das IFace unterstuetzt @@ -2507,20 +2486,20 @@ } } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::loaded(const EventObject& aEvent) throw( RuntimeException ) +void SbaXDataBrowserController::loaded(const EventObject& /*aEvent*/) throw( RuntimeException ) { // not interested in // we're loading within an separate thread and have a handling for it's "finished event" } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::unloading(const EventObject& aEvent) throw( RuntimeException ) +void SbaXDataBrowserController::unloading(const EventObject& /*aEvent*/) throw( RuntimeException ) { // not interested in } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::unloaded(const EventObject& aEvent) throw( RuntimeException ) +void SbaXDataBrowserController::unloaded(const EventObject& /*aEvent*/) throw( RuntimeException ) { InvalidateAll(); // do this asynchron, there are other listeners reacting on this message ... @@ -2539,16 +2518,16 @@ } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::reloading(const EventObject& aEvent) throw( RuntimeException ) +void SbaXDataBrowserController::reloading(const EventObject& /*aEvent*/) throw( RuntimeException ) { // not interested in } //------------------------------------------------------------------------------ -void SbaXDataBrowserController::reloaded(const EventObject& aEvent) throw( RuntimeException ) +void SbaXDataBrowserController::reloaded(const EventObject& /*aEvent*/) throw( RuntimeException ) { InvalidateAll(); - // do this asynchron, there are other listeners reacting on this message ... + // do this asynchronously, there are other listeners reacting on this message ... // (it's a little hack : the grid columns are listening to this event, too, and their bound field may // change as a reaction on that event. as we have no chance to be notified of this change (which is // the one we're interested in) we give them time to do what they want to before invalidating our @@ -2617,8 +2596,8 @@ // XRowSetListener virtual void SAL_CALL cursorMoved(const ::com::sun::star::lang::EventObject& event) throw( RuntimeException ); - virtual void SAL_CALL rowChanged(const ::com::sun::star::lang::EventObject& event) throw( RuntimeException ){}; - virtual void SAL_CALL rowSetChanged(const ::com::sun::star::lang::EventObject& event) throw( RuntimeException ){}; + virtual void SAL_CALL rowChanged(const ::com::sun::star::lang::EventObject& event) throw( RuntimeException ); + virtual void SAL_CALL rowSetChanged(const ::com::sun::star::lang::EventObject& event) throw( RuntimeException ); // ::com::sun::star::lang::XEventListener virtual void SAL_CALL disposing(const ::com::sun::star::lang::EventObject& Source) throw( RuntimeException ); @@ -2641,8 +2620,8 @@ DBG_NAME(LoadFormHelper) //------------------------------------------------------------------------------ LoadFormHelper::LoadFormHelper(const Reference< XRowSet > & _rxForm) - :m_xForm(_rxForm) - ,m_eState(STARTED) + :m_eState(STARTED) + ,m_xForm(_rxForm) { DBG_CTOR(LoadFormHelper,NULL); @@ -2673,7 +2652,7 @@ } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& aEvent) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::loaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); DBG_ASSERT(m_eState == STARTED || m_eState == DISPOSED, "LoadFormHelper::loaded : wrong call !"); @@ -2682,7 +2661,7 @@ } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::unloaded(const ::com::sun::star::lang::EventObject& aEvent) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::unloaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); DBG_ERROR("LoadFormHelper::unloaded : shouldn't be called !"); @@ -2690,22 +2669,22 @@ } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::unloading(const ::com::sun::star::lang::EventObject& aEvent) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::unloading(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::reloading(const ::com::sun::star::lang::EventObject& aEvent) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::reloading(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::reloaded(const ::com::sun::star::lang::EventObject& aEvent) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::reloaded(const ::com::sun::star::lang::EventObject& /*aEvent*/) throw( RuntimeException ) { } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::cursorMoved(const ::com::sun::star::lang::EventObject& event) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::cursorMoved(const ::com::sun::star::lang::EventObject& /*event*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); if (m_eState == LOADED) @@ -2713,7 +2692,17 @@ } //------------------------------------------------------------------------------ -void SAL_CALL LoadFormHelper::disposing(const ::com::sun::star::lang::EventObject& Source) throw( RuntimeException ) +void SAL_CALL LoadFormHelper::rowChanged(const ::com::sun::star::lang::EventObject& /*event*/) throw( RuntimeException ) +{ +} + +//------------------------------------------------------------------------------ +void SAL_CALL LoadFormHelper::rowSetChanged(const ::com::sun::star::lang::EventObject& /*event*/) throw( RuntimeException ) +{ +} + +//------------------------------------------------------------------------------ +void SAL_CALL LoadFormHelper::disposing(const ::com::sun::star::lang::EventObject& /*Source*/) throw( RuntimeException ) { ::osl::MutexGuard aGuard(m_aAccessSafety); implDispose(); @@ -2728,7 +2717,7 @@ //------------------------------------------------------------------------------ bool LoadFormHelper::WaitUntilReallyLoaded(bool _bOnlyIfLoaded) { - ::osl::ClearableMutexGuard aGuard(m_aAccessSafety); + ::osl::ResettableMutexGuard aGuard( m_aAccessSafety ); if (DISPOSED == m_eState) return false; @@ -2741,11 +2730,12 @@ while (!bDone) { - ::osl::MutexGuard aGuard(m_aAccessSafety); + aGuard.reset(); bDone = (POSITIONED == m_eState); + aGuard.clear(); } - ::osl::MutexGuard aGuard2(m_aAccessSafety); + aGuard.reset(); implDispose(); return true; @@ -2917,10 +2907,10 @@ return 0L; } // ----------------------------------------------------------------------------- -sal_uInt16 SbaXDataBrowserController::getCurrentColumnPosition() +sal_Int16 SbaXDataBrowserController::getCurrentColumnPosition() { Reference< ::com::sun::star::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); - sal_uInt16 nViewPos = -1; + sal_Int16 nViewPos = -1; try { if ( xGrid.is() ) @@ -2930,7 +2920,7 @@ return nViewPos; } // ----------------------------------------------------------------------------- -void SbaXDataBrowserController::setCurrentColumnPosition(sal_uInt16 _nPos) +void SbaXDataBrowserController::setCurrentColumnPosition( sal_Int16 _nPos ) { Reference< ::com::sun::star::form::XGrid > xGrid(getBrowserView()->getGridControl(), UNO_QUERY); try @@ -2988,7 +2978,7 @@ } } // ----------------------------------------------------------------------------- -sal_Bool SbaXDataBrowserController::InitializeGridModel(const Reference< ::com::sun::star::form::XFormComponent > & xGrid) +sal_Bool SbaXDataBrowserController::InitializeGridModel(const Reference< ::com::sun::star::form::XFormComponent > & /*xGrid*/) { return sal_True; } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
