Tag: cws_src680_dba30 User: fs Date: 05/12/15 00:56:56 Modified: /dba/dbaccess/source/ui/browser/ brwctrlr.cxx, genericcontroller.cxx /dba/dbaccess/source/ui/inc/ brwctrlr.hxx
Log: refined the clipboard handling, to removed potential problems found during #124875# 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.89&r2=1.89.16.1 Delta lines: +24 -15 --------------------- --- brwctrlr.cxx 23 Sep 2005 12:19:18 -0000 1.89 +++ brwctrlr.cxx 15 Dec 2005 08:56:51 -0000 1.89.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: brwctrlr.cxx,v $ * - * $Revision: 1.89 $ + * $Revision: 1.89.16.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:19:18 $ + * last change: $Author: fs $ $Date: 2005/12/15 08:56:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -523,6 +523,7 @@ ,m_sStateUndoRecord(ModuleRes(RID_STR_UNDO_MODIFY_RECORD)) ,m_aAsyncGetCellFocus(LINK(this, SbaXDataBrowserController, OnAsyncGetCellFocus)) ,m_pFormControllerImpl(NULL) + ,m_pClipbordNotifier( NULL ) { DBG_CTOR(SbaXDataBrowserController,NULL); @@ -534,6 +535,9 @@ m_xFormControllerImpl->setDelegator(*this); } ::comphelper::decrement(m_refCount); + + m_aInvalidateClipboard.SetTimeoutHdl(LINK(this, SbaXDataBrowserController, OnInvalidateClipboard)); + m_aInvalidateClipboard.SetTimeout(300); } //------------------------------------------------------------------------------ @@ -1215,7 +1219,7 @@ removeModelListeners(getControlModel()); - if ( getView() ) + if ( getView() && m_pClipbordNotifier ) { m_pClipbordNotifier->ClearCallbackLink(); m_pClipbordNotifier->AddRemoveListener( getView(), sal_False ); @@ -1274,8 +1278,8 @@ // start the clipboard timer if (getBrowserView() && getBrowserView()->getVclControl() && !m_aInvalidateClipboard.IsActive()) { - m_aInvalidateClipboard.SetTimeout(300); m_aInvalidateClipboard.Start(); + OnInvalidateClipboard( NULL ); } break; case ::com::sun::star::frame::FrameAction_FRAME_DEACTIVATING: @@ -1285,7 +1289,7 @@ if (getBrowserView() && getBrowserView()->getVclControl() && m_aInvalidateClipboard.IsActive()) { m_aInvalidateClipboard.Stop(); - LINK(this, SbaXDataBrowserController, OnInvalidateClipboard).Call(NULL); + OnInvalidateClipboard( NULL ); } // remove the "get cell focus"-event m_aAsyncGetCellFocus.CancelCall(); @@ -2191,29 +2195,38 @@ //------------------------------------------------------------------------------ void SbaXDataBrowserController::CellActivated() { - m_aInvalidateClipboard.SetTimeout(300); m_aInvalidateClipboard.Start(); + OnInvalidateClipboard( NULL ); } //------------------------------------------------------------------------------ void SbaXDataBrowserController::CellDeactivated() { m_aInvalidateClipboard.Stop(); - LINK(this, SbaXDataBrowserController, OnInvalidateClipboard).Call(NULL); + OnInvalidateClipboard( NULL ); } //------------------------------------------------------------------------------ IMPL_LINK( SbaXDataBrowserController, OnClipboardChanged, void*, EMPTYARG ) { + ::vos::OGuard aGuard(Application::GetSolarMutex()); return OnInvalidateClipboard( NULL ); } //------------------------------------------------------------------------------ -IMPL_LINK(SbaXDataBrowserController, OnInvalidateClipboard, void*, EMPTYARG) +IMPL_LINK(SbaXDataBrowserController, OnInvalidateClipboard, AutoTimer*, _pTimer) { InvalidateFeature(ID_BROWSER_CUT); InvalidateFeature(ID_BROWSER_COPY); + + // if the invalidation was triggered by the timer, we do not need to invalidate PASTE. + // The timer is only for checking the CUT/COPY slots regulariry, which depend on the + // selection state of the active cell + // TODO: get a callback at the Edit which allows to be notified when the selection + // changes. This would be much better than this cycle-eating polling mechanism here .... + if ( _pTimer != &m_aInvalidateClipboard ) InvalidateFeature(ID_BROWSER_PASTE); + return 0L; } @@ -2482,10 +2495,6 @@ // ------------------------------- InvalidateAll(); - - // ------------------------------- - // start the clipboard invalidator - m_aInvalidateClipboard.SetTimeoutHdl(LINK(this, SbaXDataBrowserController, OnInvalidateClipboard)); m_aAsyncGetCellFocus.Call(); } File [changed]: genericcontroller.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/browser/genericcontroller.cxx?r1=1.63.14.4&r2=1.63.14.5 Delta lines: +5 -4 ------------------- --- genericcontroller.cxx 13 Oct 2005 15:11:22 -0000 1.63.14.4 +++ genericcontroller.cxx 15 Dec 2005 08:56:52 -0000 1.63.14.5 @@ -4,9 +4,9 @@ * * $RCSfile: genericcontroller.cxx,v $ * - * $Revision: 1.63.14.4 $ + * $Revision: 1.63.14.5 $ * - * last change: $Author: fs $ $Date: 2005/10/13 15:11:22 $ + * last change: $Author: fs $ $Date: 2005/12/15 08:56:52 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -740,6 +740,7 @@ { // remeber the listener together with the URL m_arrStatusListener.insert(m_arrStatusListener.end(), DispatchTarget(_rURL, aListener)); + // initially broadcast the state ImplBroadcastFeatureState(_rURL.Complete, aListener, sal_True); // force the new state to be broadcasted to the new listener Directory: /dba/dbaccess/source/ui/inc/ ======================================= File [changed]: brwctrlr.hxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/inc/brwctrlr.hxx?r1=1.33&r2=1.33.16.1 Delta lines: +4 -4 ------------------- --- brwctrlr.hxx 23 Sep 2005 12:34:35 -0000 1.33 +++ brwctrlr.hxx 15 Dec 2005 08:56:53 -0000 1.33.16.1 @@ -4,9 +4,9 @@ * * $RCSfile: brwctrlr.hxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.33.16.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:34:35 $ + * last change: $Author: fs $ $Date: 2005/12/15 08:56:53 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -389,7 +389,7 @@ void addColumnListeners(const ::com::sun::star::uno::Reference< ::com::sun::star::awt::XControlModel > & _xGridControlModel); // time to check the CUT/COPY/PASTE-slot-states - DECL_LINK( OnInvalidateClipboard, void* ); + DECL_LINK( OnInvalidateClipboard, AutoTimer* ); DECL_LINK( OnClipboardChanged, void* ); // search callbacks --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
