[Libreoffice-commits] core.git: 4 commits - include/osl include/sal odk/docs stoc/source

Stephan Bergmann sbergman at redhat.com
Thu Nov 28 04:16:04 PST 2013


 include/osl/diagnose.hxx                                          |    4 -
 include/sal/types.h                                               |   40 ++++++----
 odk/docs/cpp/Doxyfile                                             |   10 +-
 stoc/source/uriproc/ExternalUriReferenceTranslator.cxx            |    9 --
 stoc/source/uriproc/UriReferenceFactory.cxx                       |    7 -
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx |    9 --
 stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx |    8 --
 stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx          |    9 --
 8 files changed, 37 insertions(+), 59 deletions(-)

New commits:
commit 64f57612e3010594a8a72532cabfd0ff5fb39dff
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Nov 28 11:12:36 2013 +0100

    Catching std::bad_alloc in UNO implementations no longer necessary
    
    ...since 0bc89aac4c64bb833e387657f680e194c26aef97 "cppumaker: Allow UNO
    interface functions to throw std::exception."
    
    Change-Id: Ia28f02ea10d45267fd951e80da01ffdfdb420885

diff --git a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
index 32d1553..f314d15 100644
--- a/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
+++ b/stoc/source/uriproc/ExternalUriReferenceTranslator.cxx
@@ -40,8 +40,6 @@
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
 
-#include <new>
-
 namespace {
 
 class Translator: public cppu::WeakImplHelper2<
@@ -201,12 +199,7 @@ css::uno::Reference< css::uno::XInterface > create(
     css::uno::Reference< css::uno::XComponentContext > const & context)
     SAL_THROW((css::uno::Exception))
 {
-    try {
-        return static_cast< cppu::OWeakObject * >(new Translator(context));
-    } catch (std::bad_alloc &) {
-        throw css::uno::RuntimeException(
-            OUString("std::bad_alloc"), 0);
-    }
+    return static_cast< cppu::OWeakObject * >(new Translator(context));
 }
 
 OUString getImplementationName() {
diff --git a/stoc/source/uriproc/UriReferenceFactory.cxx b/stoc/source/uriproc/UriReferenceFactory.cxx
index 13e5453..903e2c0 100644
--- a/stoc/source/uriproc/UriReferenceFactory.cxx
+++ b/stoc/source/uriproc/UriReferenceFactory.cxx
@@ -23,7 +23,6 @@
 #include <cassert>
 #include <cstdlib>
 #include <exception>
-#include <new>
 #include <vector>
 
 #include "com/sun/star/lang/WrappedTargetRuntimeException.hpp"
@@ -641,11 +640,7 @@ css::uno::Reference< css::uno::XInterface > create(
     css::uno::Reference< css::uno::XComponentContext > const & context)
     SAL_THROW((css::uno::Exception))
 {
-    try {
-        return static_cast< cppu::OWeakObject * >(new Factory(context));
-    } catch (std::bad_alloc &) {
-        throw css::uno::RuntimeException("std::bad_alloc", 0);
-    }
+    return static_cast< cppu::OWeakObject * >(new Factory(context));
 }
 
 OUString getImplementationName() {
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
index 1b3034e..ad4008d 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTexpand.cxx
@@ -22,7 +22,6 @@
 #include "stocservices.hxx"
 
 #include <exception>
-#include <new>
 
 #include "com/sun/star/lang/IllegalArgumentException.hpp"
 #include "com/sun/star/lang/XServiceInfo.hpp"
@@ -222,13 +221,7 @@ css::uno::Reference< css::uno::XInterface > create(
     SAL_THROW((css::uno::Exception))
 {
     //TODO: single instance
-    try {
-        return static_cast< ::cppu::OWeakObject * >(new Parser);
-    } catch (::std::bad_alloc &) {
-        throw css::uno::RuntimeException(
-            OUString("std::bad_alloc"),
-            css::uno::Reference< css::uno::XInterface >());
-    }
+    return static_cast< ::cppu::OWeakObject * >(new Parser);
 }
 
 OUString getImplementationName() {
diff --git a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
index 2326574..da17cbc 100644
--- a/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
+++ b/stoc/source/uriproc/UriSchemeParser_vndDOTsunDOTstarDOTscript.cxx
@@ -42,7 +42,6 @@
 #include "sal/types.h"
 
 #include <exception>
-#include <new>
 
 namespace {
 
@@ -446,12 +445,7 @@ css::uno::Reference< css::uno::XInterface > create(
     SAL_THROW((css::uno::Exception))
 {
     //TODO: single instance
-    try {
-        return static_cast< cppu::OWeakObject * >(new Parser);
-    } catch (std::bad_alloc &) {
-        throw css::uno::RuntimeException(
-            OUString("std::bad_alloc"), 0);
-    }
+    return static_cast< cppu::OWeakObject * >(new Parser);
 }
 
 OUString getImplementationName() {
diff --git a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
index f8234f2..3b7883f 100644
--- a/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
+++ b/stoc/source/uriproc/VndSunStarPkgUrlReferenceFactory.cxx
@@ -42,8 +42,6 @@
 #include "rtl/ustring.hxx"
 #include "sal/types.h"
 
-#include <new>
-
 namespace {
 
 class Factory: public cppu::WeakImplHelper2<
@@ -130,12 +128,7 @@ css::uno::Reference< css::uno::XInterface > create(
     css::uno::Reference< css::uno::XComponentContext > const & context)
     SAL_THROW((css::uno::Exception))
 {
-    try {
-        return static_cast< cppu::OWeakObject * >(new Factory(context));
-    } catch (std::bad_alloc &) {
-        throw css::uno::RuntimeException(
-            OUString("std::bad_alloc"), 0);
-    }
+    return static_cast< cppu::OWeakObject * >(new Factory(context));
 }
 
 OUString getImplementationName() {
commit 40ad0e8f6c5cecc01b47763457a1d1676a1fbc76
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Nov 28 10:58:14 2013 +0100

    Declare SAL_THROW as documentation-only and deprecated
    
    ...which it effectively had been already anyway.
    
    Change-Id: I6c9ae34f59e8bd44a6be38e6e719ad0a96773c1c

diff --git a/include/sal/types.h b/include/sal/types.h
index ff6bc28..5778914 100644
--- a/include/sal/types.h
+++ b/include/sal/types.h
@@ -355,26 +355,36 @@ typedef struct _sal_Sequence
 #pragma pack(pop)
 #endif
 
-/** Definition of function throw clause macros.  These have been introduced
-    to reduce code size by balancing out compiler bugs.
+#if defined __cplusplus
+
+/** Exception specification documentation.
 
-    These macros are ONLY for function declarations,
-    use common C++ throw statement for throwing exceptions, e.g.
-    throw RuntimeException();
+    The original intent of this macro was to control whether or not actual
+    exception specifications are emitted, based on how much they impact code
+    size etc. in a specific scenario.  But it ended up always being disabled
+    (except for MSVC, which effectively ignored it even though being enabled),
+    and used in ways that would make enabling it illegal (e.g., in the
+    cppu::ComponentFactoryFunc typedef, or with necessarily incomplete
+    com::sun::star::uno::RuntimeException in com/sun/star/uno/Reference.h), so
+    has officially been demoted to pure documentation now.
 
-    SAL_THROW()          should be used for all C++ functions, e.g. SAL_THROW(())
-    SAL_THROW_EXTERN_C() should be used for all C functions
+    @deprecated do not use in new code.
+*/
+#define SAL_THROW(x)
+
+/** Nothrow specification for C functions.
+
+    This is a macro so it can expand to nothing in C code.
 */
-#ifdef __cplusplus
-#if defined(__GNUC__) || defined(__SUNPRO_CC) || defined(__sgi)
-#define SAL_THROW( exc )
-#else /* MSVC, all other */
-#define SAL_THROW( exc ) throw exc
-#endif /* __GNUC__, __SUNPRO_CC */
 #define SAL_THROW_EXTERN_C() throw ()
-#else /* ! __cplusplus */
-/* SAL_THROW() must not be used in C headers, only SAL_THROW_EXTERN_C() is defined */
+
+#else
+
+/* SAL_THROW() must not be used in C code, only SAL_THROW_EXTERN_C() is defined
+   there:
+*/
 #define SAL_THROW_EXTERN_C()
+
 #endif
 
 #ifdef __cplusplus
diff --git a/odk/docs/cpp/Doxyfile b/odk/docs/cpp/Doxyfile
index f48bcdd..30346e0 100644
--- a/odk/docs/cpp/Doxyfile
+++ b/odk/docs/cpp/Doxyfile
@@ -36,5 +36,4 @@ PREDEFINED = \
     __cplusplus \
     SAL_CALL= \
     SAL_DEPRECATED_INTERNAL(x)= \
-    SAL_DEPRECATED(x)= \
-    "SAL_THROW(x)=throw x"
+    SAL_DEPRECATED(x)=
commit 072eb61acbb9dbe01a45170c3d63e02869df1f07
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Nov 28 10:24:41 2013 +0100

    detabify Doxyfile
    
    Change-Id: I2f7afe172221dce2de4f5d9cbef84de95ab6078c

diff --git a/odk/docs/cpp/Doxyfile b/odk/docs/cpp/Doxyfile
index 26c8893..f48bcdd 100644
--- a/odk/docs/cpp/Doxyfile
+++ b/odk/docs/cpp/Doxyfile
@@ -32,8 +32,9 @@ ALIASES = "derive=\par Derive: \n"
 
 MACRO_EXPANSION = YES
 EXPAND_ONLY_PREDEF = YES
-PREDEFINED = __cplusplus \
-	SAL_CALL= \
-	SAL_DEPRECATED_INTERNAL(x)= \
-	SAL_DEPRECATED(x)= \
-	"SAL_THROW(x)=throw x"
+PREDEFINED = \
+    __cplusplus \
+    SAL_CALL= \
+    SAL_DEPRECATED_INTERNAL(x)= \
+    SAL_DEPRECATED(x)= \
+    "SAL_THROW(x)=throw x"
commit c0afa5b7ff135b1173f1cb55c564e88a82e702c4
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Thu Nov 28 10:09:49 2013 +0100

    Don't let Doxygen document the #define BOOST_NO_0X_HDR_TYPEINDEX
    
    Change-Id: I3df112c840ccac71fb34d39900b3be3630b9c5a6

diff --git a/include/osl/diagnose.hxx b/include/osl/diagnose.hxx
index 5ae21d7..b46584a 100644
--- a/include/osl/diagnose.hxx
+++ b/include/osl/diagnose.hxx
@@ -19,6 +19,8 @@
 #ifndef INCLUDED_OSL_DIAGNOSE_HXX
 #define INCLUDED_OSL_DIAGNOSE_HXX
 
+/// @cond INTERNAL
+
 #include <sal/config.h>
 
 #include <functional>
@@ -39,8 +41,6 @@
 #include <sal/saldllapi.h>
 #include <sal/types.h>
 
-/// @cond INTERNAL
-
 namespace osl {
 namespace detail {
 


More information about the Libreoffice-commits mailing list