diff options
Diffstat (limited to 'svx/source/form/fmtextcontrolshell.cxx')
-rw-r--r-- | svx/source/form/fmtextcontrolshell.cxx | 95 |
1 files changed, 42 insertions, 53 deletions
diff --git a/svx/source/form/fmtextcontrolshell.cxx b/svx/source/form/fmtextcontrolshell.cxx index 3aaa8d73f65e..8c8f787690fd 100644 --- a/svx/source/form/fmtextcontrolshell.cxx +++ b/svx/source/form/fmtextcontrolshell.cxx @@ -30,8 +30,20 @@ // MARKER(update_precomp.py): autogen include statement, do not remove #include "precompiled_svx.hxx" -#include "fmtextcontrolshell.hxx" + +#include "fmprop.hrc" +#include "fmresids.hrc" +#include "fmtextcontroldialogs.hxx" #include "fmtextcontrolfeature.hxx" +#include "fmtextcontrolshell.hxx" +#include "svx/crsditem.hxx" +#include "svx/dialmgr.hxx" +#include "svx/editeng.hxx" +#include "svx/eeitem.hxx" +#include "svx/fmglob.hxx" +#include "svx/scriptspaceitem.hxx" +#include "svx/svxids.hrc" +#include "svx/udlnitem.hxx" /** === begin UNO includes === **/ #include <com/sun/star/beans/XPropertySet.hpp> @@ -42,48 +54,28 @@ #include <com/sun/star/awt/XFocusListener.hpp> #include <com/sun/star/awt/XMouseListener.hpp> /** === end UNO includes === **/ -#include <sfx2/request.hxx> + +#include <comphelper/componentcontext.hxx> +#include <comphelper/processfactory.hxx> +#include <cppuhelper/implbase1.hxx> +#include <sfx2/app.hxx> #include <sfx2/bindings.hxx> -#include <sfx2/msgpool.hxx> #include <sfx2/dispatch.hxx> -#include <sfx2/sfxuno.hxx> -#include <sfx2/viewfrm.hxx> +#include <sfx2/msgpool.hxx> #include <sfx2/objsh.hxx> +#include <sfx2/request.hxx> #include <sfx2/sfxuno.hxx> - -#include <sfx2/app.hxx> -#include <vcl/outdev.hxx> -#include <vcl/msgbox.hxx> -#include <svtools/languageoptions.hxx> -#include <svtools/intitem.hxx> -#include <svtools/whiter.hxx> +#include <sfx2/viewfrm.hxx> #include <svtools/eitem.hxx> +#include <svtools/intitem.hxx> #include <svtools/itempool.hxx> +#include <svtools/languageoptions.hxx> #include <svtools/stringtransfer.hxx> +#include <svtools/whiter.hxx> #include <toolkit/helper/vclunohelper.hxx> #include <tools/diagnose_ex.h> -#include <comphelper/componentcontext.hxx> -#include <comphelper/processfactory.hxx> -#include <cppuhelper/implbase1.hxx> - -#ifndef _SVX_SVXIDS_HRC -#include <svx/svxids.hrc> -#endif -#include <svx/fmglob.hxx> -#include <svx/dialmgr.hxx> -#ifndef _SVX_FMRESIDS_HRC -#include "fmresids.hrc" -#endif -#include <svx/editeng.hxx> -#include <svx/eeitem.hxx> -#ifndef _SVX_FMPROP_HRC -#include "fmprop.hrc" -#endif -#include "fmtextcontroldialogs.hxx" -#include <svx/scriptspaceitem.hxx> - -#include <svx/udlnitem.hxx> -#include <svx/crsditem.hxx> +#include <vcl/msgbox.hxx> +#include <vcl/outdev.hxx> #include <vos/mutex.hxx> #include <memory> @@ -227,7 +219,7 @@ namespace svx } catch( const Exception& ) { - DBG_ERROR( "FmFocusListenerAdapter::FmFocusListenerAdapter: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } osl_decrementInterlockedCount( &m_refCount ); @@ -324,7 +316,7 @@ namespace svx } catch( const Exception& ) { - DBG_ERROR( "FmMouseListenerAdapter::FmMouseListenerAdapter: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } osl_decrementInterlockedCount( &m_refCount ); @@ -517,7 +509,7 @@ namespace svx } catch( const Exception& ) { - OSL_ENSURE( sal_False, "lcl_determineReadOnly: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return bIsReadOnlyModel; } @@ -536,7 +528,7 @@ namespace svx } catch( const Exception& ) { - OSL_ENSURE( sal_False, "lcl_getWindow: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return pWindow; @@ -563,7 +555,7 @@ namespace svx } catch( const Exception& ) { - OSL_ENSURE( sal_False, "lcl_isRichText: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return bIsRichText; } @@ -797,7 +789,7 @@ namespace svx } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FmTextControlShell::executeSelectAll: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return false; // not handled } @@ -839,7 +831,7 @@ namespace svx } catch( const Exception& ) { - OSL_ENSURE( sal_False, "FmTextControlShell::executeClipboardSlot: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } return false; // not handled } @@ -1085,18 +1077,18 @@ namespace svx if ( !_rxController.is() ) return; + // sometimes, a form controller notifies activations, even if it's already activated + if ( m_xActiveController == _rxController ) + return; + try { - if ( m_xActiveController == _rxController ) - // sometimes, a form controller notifies activations, even if it's already activated - return; - startControllerListening( _rxController ); controlActivated( _rxController->getCurrentControl() ); } catch( const Exception& ) { - DBG_ERROR( "FmTextControlShell::formActivated: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } } @@ -1119,11 +1111,11 @@ namespace svx //------------------------------------------------------------------------ void FmTextControlShell::startControllerListening( const Reference< XFormController >& _rxController ) { - DBG_ASSERT( _rxController.is(), "FmTextControlShell::startControllerListening: invalid controller!" ); + OSL_PRECOND( _rxController.is(), "FmTextControlShell::startControllerListening: invalid controller!" ); if ( !_rxController.is() ) return; - DBG_ASSERT( !isControllerListening(), "FmTextControlShell::startControllerListening: already listening!" ); + OSL_PRECOND( !isControllerListening(), "FmTextControlShell::startControllerListening: already listening!" ); if ( isControllerListening() ) stopControllerListening( ); DBG_ASSERT( !isControllerListening(), "FmTextControlShell::startControllerListening: inconsistence!" ); @@ -1143,7 +1135,7 @@ namespace svx } catch( const Exception& ) { - DBG_ERROR( "FmTextControlShell::startControllerListening: caught an exception!" ); + DBG_UNHANDLED_EXCEPTION(); } m_xActiveController = _rxController; @@ -1152,7 +1144,7 @@ namespace svx //------------------------------------------------------------------------ void FmTextControlShell::stopControllerListening( ) { - DBG_ASSERT( isControllerListening(), "FmTextControlShell::stopControllerListening: inconsistence!" ); + OSL_PRECOND( isControllerListening(), "FmTextControlShell::stopControllerListening: inconsistence!" ); // dispose all listeners associated with the controls of the active controller for ( FocusListenerAdapters::iterator aLoop = m_aControlObservers.begin(); @@ -1207,7 +1199,6 @@ namespace svx void FmTextControlShell::controlDeactivated( ) { DBG_ASSERT( IsActiveControl(), "FmTextControlShell::controlDeactivated: no active control!" ); - OSL_TRACE( "deactivated: %X", m_xActiveControl.get() ); m_bActiveControl = false; @@ -1217,8 +1208,6 @@ namespace svx //------------------------------------------------------------------------ void FmTextControlShell::controlActivated( const Reference< XControl >& _rxControl ) { - OSL_TRACE( "activated : %X", _rxControl.get() ); - // ensure that all knittings with the previously active control are lost if ( m_xActiveControl.is() ) implClearActiveControlRef(); |