Library_merged.mk | 8 -- RepositoryExternal.mk | 16 ++--- codemaker/source/cppumaker/cpputype.cxx | 65 +++++++++++++++++++++++ codemaker/source/cppumaker/cpputype.hxx | 6 ++ forms/Library_frm.mk | 8 -- i18npool/CppunitTest_i18npool_test_textsearch.mk | 2 i18npool/Executable_gencoll_rule.mk | 8 -- i18npool/Executable_genindex_data.mk | 8 -- i18npool/Library_i18npool.mk | 7 -- i18npool/Library_i18nsearch.mk | 2 l10ntools/Executable_cfgex.mk | 2 l10ntools/Executable_helpex.mk | 2 l10ntools/Executable_localize.mk | 2 l10ntools/Executable_propex.mk | 2 l10ntools/Executable_renewpo.mk | 2 l10ntools/Executable_stringex.mk | 2 l10ntools/Executable_transex3.mk | 2 l10ntools/Executable_treex.mk | 2 l10ntools/Executable_uiex.mk | 2 l10ntools/Executable_ulfex.mk | 2 l10ntools/Executable_xrmex.mk | 2 lotuswordpro/Library_lwpft.mk | 7 -- 22 files changed, 93 insertions(+), 66 deletions(-)
New commits: commit eb0cfb3bf220892e4885945452930790f5e22000 Author: Michael Stahl <[email protected]> Date: Sun Dec 2 20:13:47 2012 +0100 cppumaker: do write exception specifications on --enable-dbgutil Exception specifications are useless for production code, but make for useful assertions in dbgutil builds (on platforms where they are enforced at runtime). Because we do not have API tests that exhaustively trigger all documented error conditions, much less the undocumented or wrongly handled error conditions that would cause the implementation to violate its API specification, there is likely some benefit in having these runtime-checked specifications in debug builds, in the hope that our various tests which may incidentally call various API methods, or general soffice usage, uncovers these bugs. Also, there may be some benefit to making API implementers more aware of the exception specifications, to quote Stephan's mail: To be able to programmatically react to an exception raised by a UNO method (which is the raison d'être of non-runtime UNO exceptions), the specification of that method must document the method's behavior with respect to raising that exception, and any implementation of the method must adhere to that specification. However, with that part of a UNO method's interface moved out of sight of a programmer writing a C++ implementation of that method, I fear that adherence to specification will degrade in practice. And that negatively affects an area where we do not shine anyway: reaction to errors. This partially reverts commits: 0295bd6b3f21dd648af6145ca23d90467f3cec73 155cd09b5eebe0c1eab0610a7f1f04f09de4b217 Change-Id: I9c7664c9f1b238f4f9501aacb065981236949440 diff --git a/codemaker/source/cppumaker/cpputype.cxx b/codemaker/source/cppumaker/cpputype.cxx index 3aba023..5b9721b 100644 --- a/codemaker/source/cppumaker/cpputype.cxx +++ b/codemaker/source/cppumaker/cpputype.cxx @@ -1483,6 +1483,7 @@ void InterfaceType::dumpAttributes(FileStream& o) o << "virtual "; dumpType(o, fieldType); o << " SAL_CALL get" << fieldName << "()"; + dumpAttributeExceptionSpecification(o, name, RT_MODE_ATTRIBUTE_GET); o << " = 0;\n"; if ((access & RT_ACCESS_READONLY) == 0) @@ -1493,6 +1494,7 @@ void InterfaceType::dumpAttributes(FileStream& o) o << "virtual void SAL_CALL set" << fieldName << "( "; dumpType(o, fieldType, byRef, byRef); o << " _" << fieldName.toAsciiLowerCase() << " )"; + dumpAttributeExceptionSpecification(o, name, RT_MODE_ATTRIBUTE_SET); o << " = 0;\n"; } } @@ -1510,6 +1512,7 @@ void InterfaceType::dumpMethods(FileStream& o) sal_Bool bRef = sal_False; sal_Bool bConst = sal_False; + sal_Bool bWithRunTimeExcp = sal_True; for (sal_uInt16 i=0; i < methodCount; i++) { @@ -1526,6 +1529,11 @@ void InterfaceType::dumpMethods(FileStream& o) m_reader.getMethodReturnTypeName(i), RTL_TEXTENCODING_UTF8); paramCount = m_reader.getMethodParameterCount(i); + if ( methodName.equals("acquire") || methodName.equals("release") ) + { + bWithRunTimeExcp = sal_False; + } + if (first) { first = sal_False; @@ -1578,6 +1586,7 @@ void InterfaceType::dumpMethods(FileStream& o) } o << " )"; } + dumpExceptionSpecification(o, i, bWithRunTimeExcp); o << " = 0;\n"; } } @@ -2207,6 +2216,62 @@ void InterfaceType::dumpMethodsCppuDecl(FileStream& o, StringSet* pFinishedTypes } } +void InterfaceType::dumpExceptionSpecification( + FileStream & out, sal_uInt32 methodIndex, bool runtimeException) +{ + // exception specifications are undesirable in production code, but make + // for useful assertions in debug builds (on platforms where they are + // enforced at runtime) +#ifndef DBG_UTIL + (void) out; + (void) methodIndex; + (void) runtimeException; +#else + out << " throw ("; + bool first = true; + if (methodIndex <= SAL_MAX_UINT16) { + sal_uInt16 count = m_reader.getMethodExceptionCount( + static_cast< sal_uInt16 >(methodIndex)); + for (sal_uInt16 i = 0; i < count; ++i) { + rtl::OUString name( + m_reader.getMethodExceptionTypeName( + static_cast< sal_uInt16 >(methodIndex), i)); + if ( name != "com/sun/star/uno/RuntimeException" ) + { + if (!first) { + out << ", "; + } + first = false; + out << scopedCppName( + rtl::OUStringToOString(name, RTL_TEXTENCODING_UTF8)); + } + } + } + if (runtimeException) { + if (!first) { + out << ", "; + } + out << "::com::sun::star::uno::RuntimeException"; + } + out << ")"; +#endif +} + +void InterfaceType::dumpAttributeExceptionSpecification( + FileStream & out, rtl::OUString const & name, RTMethodMode sort) +{ + sal_uInt16 methodCount = m_reader.getMethodCount(); + for (sal_uInt16 i = 0; i < methodCount; ++i) { + if (m_reader.getMethodFlags(i) == sort + && m_reader.getMethodName(i) == name) + { + dumpExceptionSpecification(out, i, true); + return; + } + } + dumpExceptionSpecification(out, 0xFFFFFFFF, true); +} + void InterfaceType::dumpExceptionTypeName( FileStream & out, char const * prefix, sal_uInt32 index, rtl::OUString name) { diff --git a/codemaker/source/cppumaker/cpputype.hxx b/codemaker/source/cppumaker/cpputype.hxx index 32728f6..b80b3d8 100644 --- a/codemaker/source/cppumaker/cpputype.hxx +++ b/codemaker/source/cppumaker/cpputype.hxx @@ -194,6 +194,12 @@ protected: bool m_isDeprecated; private: + void dumpExceptionSpecification( + FileStream & out, sal_uInt32 methodIndex, bool runtimeException); + + void dumpAttributeExceptionSpecification( + FileStream & out, rtl::OUString const & name, RTMethodMode sort); + void dumpExceptionTypeName( FileStream & out, char const * prefix, sal_uInt32 index, rtl::OUString name); commit 1658e4efac5fc851b322103ed40545fa263ae280 Author: Michael Stahl <[email protected]> Date: Sun Dec 2 18:56:17 2012 +0100 RepositoryExternal.mk: clean up awful icudata/icui18n duplication Change-Id: Ic4794d9a908b60220a4a849ff263eaa08776550c diff --git a/Library_merged.mk b/Library_merged.mk index 61de3a2..58e219c 100644 --- a/Library_merged.mk +++ b/Library_merged.mk @@ -45,6 +45,7 @@ $(eval $(call gb_Library_use_libraries,merged,\ $(eval $(call gb_Library_use_externals,merged,\ cups \ + icui18n \ icule \ icuuc \ jpeg \ @@ -121,13 +122,6 @@ $(eval $(call gb_Library_add_ldflags,merged,\ /ignore:4049 \ /ignore:4217 \ )) -$(eval $(call gb_Library_use_externals,merged,\ - icuin \ -)) -else -$(eval $(call gb_Library_use_externals,merged,\ - icui18n \ -)) endif ifeq ($(OS),MACOSX) diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk index 5ead103..2159be1 100644 --- a/RepositoryExternal.mk +++ b/RepositoryExternal.mk @@ -871,18 +871,15 @@ ifeq ($(OS)$(COM),WNTMSC) $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ icudt \ icuin \ - icule \ - icutu \ - icuuc \ )) -define gb_LinkTarget__use_icudt +define gb_LinkTarget__use_icudata $(call gb_LinkTarget_use_libraries,$(1),\ icudt \ ) endef -define gb_LinkTarget__use_icuin +define gb_LinkTarget__use_icui18n $(call gb_LinkTarget_use_libraries,$(1),\ icuin \ ) @@ -892,9 +889,6 @@ else $(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ icudata$(gb_ICU_suffix) \ icui18n$(gb_ICU_suffix) \ - icule$(gb_ICU_suffix) \ - icutu$(gb_ICU_suffix) \ - icuuc$(gb_ICU_suffix) \ )) define gb_LinkTarget__use_icudata @@ -911,6 +905,12 @@ $(call gb_LinkTarget_use_libraries,$(1),\ endef endif +$(eval $(call gb_Helper_register_libraries,PLAINLIBS_OOO, \ + icule$(gb_ICU_suffix) \ + icutu$(gb_ICU_suffix) \ + icuuc$(gb_ICU_suffix) \ +)) + define gb_LinkTarget__use_icule $(call gb_LinkTarget_use_libraries,$(1),\ icule$(gb_ICU_suffix) \ diff --git a/forms/Library_frm.mk b/forms/Library_frm.mk index e868031..4f60e8f 100644 --- a/forms/Library_frm.mk +++ b/forms/Library_frm.mk @@ -60,19 +60,11 @@ $(eval $(call gb_Library_use_libraries,frm,\ $(gb_UWINAPI) \ )) -ifeq ($(OS)$(COM),WNTMSC) -$(eval $(call gb_Library_use_externals,frm,\ - icuin \ - icuuc \ - libxml2 \ -)) -else $(eval $(call gb_Library_use_externals,frm,\ icui18n \ icuuc \ libxml2 \ )) -endif $(eval $(call gb_Library_set_componentfile,frm,forms/util/frm)) diff --git a/i18npool/CppunitTest_i18npool_test_textsearch.mk b/i18npool/CppunitTest_i18npool_test_textsearch.mk index b563ac1..2f6998f 100644 --- a/i18npool/CppunitTest_i18npool_test_textsearch.mk +++ b/i18npool/CppunitTest_i18npool_test_textsearch.mk @@ -26,7 +26,7 @@ $(eval $(call gb_CppunitTest_use_components,i18npool_test_textsearch,\ )) $(eval $(call gb_CppunitTest_use_externals,i18npool_test_textsearch,\ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ icuuc \ )) diff --git a/i18npool/Executable_gencoll_rule.mk b/i18npool/Executable_gencoll_rule.mk index d0ef67a..4974c63 100644 --- a/i18npool/Executable_gencoll_rule.mk +++ b/i18npool/Executable_gencoll_rule.mk @@ -38,19 +38,11 @@ $(eval $(call gb_Executable_use_libraries,gencoll_rule,\ $(gb_UWINAPI) \ )) -ifeq ($(OS)$(COM),WNTMSC) -$(eval $(call gb_Executable_use_externals,gencoll_rule,\ - icudt \ - icuin \ - icuuc \ -)) -else $(eval $(call gb_Executable_use_externals,gencoll_rule,\ icudata \ icui18n \ icuuc \ )) -endif $(eval $(call gb_Executable_add_exception_objects,gencoll_rule,\ i18npool/source/collator/gencoll_rule \ diff --git a/i18npool/Executable_genindex_data.mk b/i18npool/Executable_genindex_data.mk index 2c36e3e..0795b7b 100644 --- a/i18npool/Executable_genindex_data.mk +++ b/i18npool/Executable_genindex_data.mk @@ -37,19 +37,11 @@ $(eval $(call gb_Executable_use_libraries,genindex_data,\ $(gb_UWINAPI) \ )) -ifeq ($(OS),WNT) -$(eval $(call gb_Executable_use_externals,gencoll_rule,\ - icudt \ - icuin \ - icuuc \ -)) -else $(eval $(call gb_Executable_use_externals,genindex_data,\ icudata \ icui18n \ icuuc \ )) -endif $(eval $(call gb_Executable_add_exception_objects,genindex_data,\ i18npool/source/indexentry/genindex_data \ diff --git a/i18npool/Library_i18npool.mk b/i18npool/Library_i18npool.mk index 1e26716..183ea54 100644 --- a/i18npool/Library_i18npool.mk +++ b/i18npool/Library_i18npool.mk @@ -47,17 +47,10 @@ $(eval $(call gb_Library_use_libraries,i18npool,\ $(gb_UWINAPI) \ )) -ifeq ($(OS)$(COM),WNTMSC) -$(eval $(call gb_Library_use_externals,i18npool,\ - icuin \ - icuuc \ -)) -else $(eval $(call gb_Library_use_externals,i18npool,\ icui18n \ icuuc \ )) -endif $(eval $(call gb_Library_add_exception_objects,i18npool,\ i18npool/source/breakiterator/breakiterator_cjk \ diff --git a/i18npool/Library_i18nsearch.mk b/i18npool/Library_i18nsearch.mk index d59345e..7778077 100644 --- a/i18npool/Library_i18nsearch.mk +++ b/i18npool/Library_i18nsearch.mk @@ -39,7 +39,7 @@ $(eval $(call gb_Library_set_include,i18nsearch,\ $(eval $(call gb_Library_use_sdk_api,i18nsearch)) $(eval $(call gb_Library_use_externals,i18nsearch,\ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ icuuc \ )) diff --git a/l10ntools/Executable_cfgex.mk b/l10ntools/Executable_cfgex.mk index e8e1682..74ed3f8 100644 --- a/l10ntools/Executable_cfgex.mk +++ b/l10ntools/Executable_cfgex.mk @@ -51,7 +51,7 @@ $(eval $(call gb_Executable_add_exception_objects,cfgex,\ $(eval $(call gb_Executable_use_externals,cfgex,\ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/l10ntools/Executable_helpex.mk b/l10ntools/Executable_helpex.mk index 66d8707..4826176 100644 --- a/l10ntools/Executable_helpex.mk +++ b/l10ntools/Executable_helpex.mk @@ -53,7 +53,7 @@ $(eval $(call gb_Executable_add_exception_objects,helpex,\ $(eval $(call gb_Executable_use_externals,helpex,\ libxml2 \ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/l10ntools/Executable_localize.mk b/l10ntools/Executable_localize.mk index a810b6c..5e55eee 100644 --- a/l10ntools/Executable_localize.mk +++ b/l10ntools/Executable_localize.mk @@ -45,7 +45,7 @@ $(eval $(call gb_Executable_add_exception_objects,localize,\ $(eval $(call gb_Executable_use_externals,localize,\ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/l10ntools/Executable_propex.mk b/l10ntools/Executable_propex.mk index 06080c6..f97f7a1 100644 --- a/l10ntools/Executable_propex.mk +++ b/l10ntools/Executable_propex.mk @@ -30,7 +30,7 @@ $(eval $(call gb_Executable_add_exception_objects,propex,\ $(eval $(call gb_Executable_use_externals,propex,\ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim: set noet sw=4 ts=4: diff --git a/l10ntools/Executable_renewpo.mk b/l10ntools/Executable_renewpo.mk index db84a41..cfdb923 100644 --- a/l10ntools/Executable_renewpo.mk +++ b/l10ntools/Executable_renewpo.mk @@ -30,7 +30,7 @@ $(eval $(call gb_Executable_add_exception_objects,renewpo,\ $(eval $(call gb_Executable_use_externals,renewpo,\ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim: set noet sw=4 ts=4: diff --git a/l10ntools/Executable_stringex.mk b/l10ntools/Executable_stringex.mk index f42b36c..b053412 100644 --- a/l10ntools/Executable_stringex.mk +++ b/l10ntools/Executable_stringex.mk @@ -31,7 +31,7 @@ $(eval $(call gb_Executable_add_exception_objects,stringex,\ $(eval $(call gb_Executable_use_externals,stringex,\ libxml2 \ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim: set noet sw=4 ts=4: diff --git a/l10ntools/Executable_transex3.mk b/l10ntools/Executable_transex3.mk index 5568f93..baba40e 100644 --- a/l10ntools/Executable_transex3.mk +++ b/l10ntools/Executable_transex3.mk @@ -51,7 +51,7 @@ $(eval $(call gb_Executable_add_exception_objects,transex3,\ $(eval $(call gb_Executable_use_externals,transex3,\ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ libxml2 \ )) diff --git a/l10ntools/Executable_treex.mk b/l10ntools/Executable_treex.mk index af77c71..2cdb1b2 100644 --- a/l10ntools/Executable_treex.mk +++ b/l10ntools/Executable_treex.mk @@ -31,7 +31,7 @@ $(eval $(call gb_Executable_add_exception_objects,treex,\ $(eval $(call gb_Executable_use_externals,treex,\ libxml2 \ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim: set noet sw=4 ts=4: diff --git a/l10ntools/Executable_uiex.mk b/l10ntools/Executable_uiex.mk index 8a20512..5a8f23c 100644 --- a/l10ntools/Executable_uiex.mk +++ b/l10ntools/Executable_uiex.mk @@ -32,7 +32,7 @@ $(eval $(call gb_Executable_use_externals,uiex,\ libxslt \ boost_headers \ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim: set noet sw=4 ts=4: diff --git a/l10ntools/Executable_ulfex.mk b/l10ntools/Executable_ulfex.mk index 5f4a492..0ee4d44 100644 --- a/l10ntools/Executable_ulfex.mk +++ b/l10ntools/Executable_ulfex.mk @@ -48,7 +48,7 @@ $(eval $(call gb_Executable_add_exception_objects,ulfex,\ $(eval $(call gb_Executable_use_externals,ulfex,\ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/l10ntools/Executable_xrmex.mk b/l10ntools/Executable_xrmex.mk index 3dab334..bcad1b9 100644 --- a/l10ntools/Executable_xrmex.mk +++ b/l10ntools/Executable_xrmex.mk @@ -52,7 +52,7 @@ $(eval $(call gb_Executable_add_exception_objects,xrmex,\ $(eval $(call gb_Executable_use_externals,xrmex,\ libxml2 \ icuuc \ - $(if $(filter MSC,$(COM)),icuin,icui18n) \ + icui18n \ )) # vim:set shiftwidth=4 softtabstop=4 expandtab: diff --git a/lotuswordpro/Library_lwpft.mk b/lotuswordpro/Library_lwpft.mk index a521edc..d528c63 100644 --- a/lotuswordpro/Library_lwpft.mk +++ b/lotuswordpro/Library_lwpft.mk @@ -50,17 +50,10 @@ $(eval $(call gb_Library_use_libraries,lwpft,\ $(gb_UWINAPI) \ )) -ifeq ($(OS)$(COM),WNTMSC) -$(eval $(call gb_Library_use_externals,lwpft,\ - icuin \ - icuuc \ -)) -else $(eval $(call gb_Library_use_externals,lwpft,\ icui18n \ icuuc \ )) -endif $(eval $(call gb_Library_set_componentfile,lwpft,lotuswordpro/util/lwpfilter))
_______________________________________________ Libreoffice-commits mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
