diff options
author | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-25 10:42:53 +0100 |
---|---|---|
committer | Frank Schoenheit [fs] <frank.schoenheit@oracle.com> | 2011-02-25 10:42:53 +0100 |
commit | c53fb2d4ac0f9eab262ab97336f9f58a3f880fb3 (patch) | |
tree | 1a0db771e960926400ed3c108ef345b7c5d54d0c /framework/source | |
parent | b180cab3b3d48c86f5981ca04e08e6c7db861cd6 (diff) |
gridfixes: don't be too generous with exceptions: avoid where possible (by checking beforehand), and assert when caught
Diffstat (limited to 'framework/source')
-rw-r--r-- | framework/source/fwe/classes/framelistanalyzer.cxx | 10 | ||||
-rw-r--r-- | framework/source/helper/titlebarupdate.cxx | 32 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 8 | ||||
-rw-r--r-- | framework/source/uifactory/windowcontentfactorymanager.cxx | 5 |
4 files changed, 23 insertions, 32 deletions
diff --git a/framework/source/fwe/classes/framelistanalyzer.cxx b/framework/source/fwe/classes/framelistanalyzer.cxx index 1a33ebf91d7e..1585fb7b1342 100644 --- a/framework/source/fwe/classes/framelistanalyzer.cxx +++ b/framework/source/fwe/classes/framelistanalyzer.cxx @@ -48,6 +48,7 @@ // includes of other projects #include <unotools/processfactory.hxx> #include <vcl/svapp.hxx> +#include <tools/diagnose_ex.h> //_______________________________________________ // namespace @@ -153,7 +154,7 @@ void FrameListAnalyzer::impl_analyze() // check, if the reference frame includes the backing component. // But look, if this analyze step is realy needed. - if ((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT) + if (((m_eDetectMode & E_BACKINGCOMPONENT) == E_BACKINGCOMPONENT) && m_xReferenceFrame.is() ) { try { @@ -162,8 +163,13 @@ void FrameListAnalyzer::impl_analyze() ::rtl::OUString sModule = xModuleMgr->identify(m_xReferenceFrame); m_bReferenceIsBacking = (sModule.equals(SERVICENAME_STARTMODULE)); } + catch(const css::frame::UnknownModuleException&) + { + } catch(const css::uno::Exception&) - {} + { + DBG_UNHANDLED_EXCEPTION(); + } } // check, if the reference frame includes the help module. diff --git a/framework/source/helper/titlebarupdate.cxx b/framework/source/helper/titlebarupdate.cxx index 9b6501af4c20..a8282c135062 100644 --- a/framework/source/helper/titlebarupdate.cxx +++ b/framework/source/helper/titlebarupdate.cxx @@ -104,37 +104,15 @@ // other includes //_________________________________________________________________________________________________________________ -#ifndef _COMPHELPER_SEQUENCEASHASHMAP_HXX #include <comphelper/sequenceashashmap.hxx> -#endif - -#ifndef _UTL_CONFIGMGR_HXX #include <unotools/configmgr.hxx> -#endif - -#ifndef _UTL_BOOTSTRAP_HXX #include <unotools/bootstrap.hxx> -#endif - -#ifndef _SV_WINDOW_HXX #include <vcl/window.hxx> -#endif - -#ifndef _SV_SYSWIN_HXX #include <vcl/syswin.hxx> -#endif - -#ifndef _TOOLKIT_HELPER_VCLUNOHELPER_HXX_ #include <toolkit/unohlp.hxx> -#endif - -#ifndef _SV_SVAPP_HXX #include <vcl/svapp.hxx> -#endif - -#ifndef _SV_WRKWIN_HXX #include <vcl/wrkwin.hxx> -#endif +#include <tools/diagnose_ex.h> //_________________________________________________________________________________________________________________ // namespace @@ -332,10 +310,14 @@ void TitleBarUpdate::impl_updateIcon(const css::uno::Reference< css::frame::XFra { try { - xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon; + css::uno::Reference< css::beans::XPropertySetInfo > const xPSI( xSet->getPropertySetInfo(), css::uno::UNO_SET_THROW ); + if ( xPSI->hasPropertyByName( CONTROLLER_PROPNAME_ICONID ) ) + xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon; } catch(const css::uno::Exception&) - {} + { + DBG_UNHANDLED_EXCEPTION(); + } } // c) if b) failed ... identify the used module and retrieve set icon from module config. diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index b9dd626cf06d..a2de01b9c333 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -103,6 +103,7 @@ #include <toolkit/awt/vclxwindow.hxx> #include <comphelper/processfactory.hxx> #include <unotools/moduleoptions.hxx> +#include <tools/diagnose_ex.h> #ifdef ENABLE_ASSERTIONS #ifndef _RTL_STRBUF_HXX_ @@ -2882,10 +2883,13 @@ void Frame::implts_setIconOnWindow() { try { - xSet->getPropertyValue( DECLARE_ASCII("IconId") )>>= nIcon; + css::uno::Reference< css::beans::XPropertySetInfo > const xPSI( xSet->getPropertySetInfo(), css::uno::UNO_SET_THROW ); + if ( xPSI->hasPropertyByName( CONTROLLER_PROPNAME_ICONID ) ) + xSet->getPropertyValue( CONTROLLER_PROPNAME_ICONID ) >>= nIcon; } - catch( css::beans::UnknownPropertyException& ) + catch( css::uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } diff --git a/framework/source/uifactory/windowcontentfactorymanager.cxx b/framework/source/uifactory/windowcontentfactorymanager.cxx index 352fc1ad21f7..1b510a294952 100644 --- a/framework/source/uifactory/windowcontentfactorymanager.cxx +++ b/framework/source/uifactory/windowcontentfactorymanager.cxx @@ -55,6 +55,7 @@ #include <rtl/ustrbuf.hxx> #include <cppuhelper/weak.hxx> #include <tools/urlobj.hxx> +#include <tools/diagnose_ex.h> #include <vcl/svapp.hxx> //_________________________________________________________________________________________________________________ @@ -242,11 +243,9 @@ throw (uno::Exception, uno::RuntimeException) { xWindow = xFactory->createInstanceWithArgumentsAndContext( Arguments, Context ); } - catch ( uno::RuntimeException& ) - { - } catch ( uno::Exception& ) { + DBG_UNHANDLED_EXCEPTION(); } } } |