User: kz Date: 2008-03-06 18:11:14+0000 Modified: dba/dbaccess/source/ui/app/AppSwapWindow.cxx
Log: INTEGRATION: CWS odbmacros2 (1.12.98); FILE MERGED 2008/02/19 08:54:16 fs 1.12.98.2: don't remember E_NONE as last type 2008/01/28 11:35:21 fs 1.12.98.1: during #i49133#: changeContainer->selectContainer File Changes: Directory: /dba/dbaccess/source/ui/app/ ======================================= File [changed]: AppSwapWindow.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/app/AppSwapWindow.cxx?r1=1.12&r2=1.13 Delta lines: +25 -17 --------------------- --- AppSwapWindow.cxx 2007-07-06 07:59:58+0000 1.12 +++ AppSwapWindow.cxx 2008-03-06 18:11:11+0000 1.13 @@ -184,6 +184,24 @@ SvxIconChoiceCtrlEntry* pEntry = m_aIconControl.GetSelectedEntry(nPos); return ( pEntry ) ? *static_cast<ElementType*>(pEntry->GetUserData()) : E_NONE; } + +// ----------------------------------------------------------------------------- +bool OApplicationSwapWindow::onContainerSelected( ElementType _eType ) +{ + if ( m_eLastType == _eType ) + return true; + + if ( m_rBorderWin.getView()->getElementNotification()->onContainerSelect( _eType ) ) + { + if ( _eType != E_NONE ) + m_eLastType = _eType; + return true; + } + + PostUserEvent( LINK( this, OApplicationSwapWindow, ChangeToLastSelected ) ); + return false; +} + // ----------------------------------------------------------------------------- IMPL_LINK(OApplicationSwapWindow, OnContainerSelectHdl, SvtIconChoiceCtrl*, _pControl) { @@ -193,26 +211,18 @@ if ( pEntry ) eType = *static_cast<ElementType*>(pEntry->GetUserData()); - if ( m_eLastType != eType && eType != E_NONE ) - { - if ( m_rBorderWin.getView()->getElementNotification()->onContainerSelect(eType) ) - m_eLastType = eType; - else - { - PostUserEvent(LINK(this, OApplicationSwapWindow, ChangeToLastSelected)); - } - } + onContainerSelected( eType ); return 1L; } //------------------------------------------------------------------------------ IMPL_LINK(OApplicationSwapWindow, ChangeToLastSelected, void*, EMPTYARG) { - changeContainer(m_eLastType); + selectContainer(m_eLastType); return 0L; } // ----------------------------------------------------------------------------- -void OApplicationSwapWindow::changeContainer(ElementType _eType) +void OApplicationSwapWindow::selectContainer(ElementType _eType) { ULONG nCount = m_aIconControl.GetEntryCount(); SvxIconChoiceCtrlEntry* pEntry = NULL; @@ -223,11 +233,9 @@ break; pEntry = NULL; } + if ( pEntry ) - { m_aIconControl.SetCursor(pEntry); - OnContainerSelectHdl(&m_aIconControl); - } - else - m_eLastType = E_NONE; + + onContainerSelected( _eType ); } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
