[Libreoffice-commits] .: sal/inc sfx2/inc
Libreoffice Gerrit user
logerrit at kemper.freedesktop.org
Tue Dec 11 07:12:59 PST 2012
sal/inc/rtl/ustrbuf.hxx | 5 ++---
sal/inc/sal/types.h | 18 ++++++++++++++++++
sfx2/inc/sfx2/docfile.hxx | 2 +-
3 files changed, 21 insertions(+), 4 deletions(-)
New commits:
commit 20b720ba3790d657ea3112fde0678c262908a1b6
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Tue Dec 11 16:00:00 2012 +0100
Introduce SAL_DELETE
Change-Id: I7ac7392646ea34fb2e6a9f15990aca05a2c1e484
diff --git a/sal/inc/rtl/ustrbuf.hxx b/sal/inc/rtl/ustrbuf.hxx
index d48245b..2095cd5 100644
--- a/sal/inc/rtl/ustrbuf.hxx
+++ b/sal/inc/rtl/ustrbuf.hxx
@@ -29,6 +29,7 @@
#include <rtl/ustrbuf.h>
#include <rtl/ustring.hxx>
#include <rtl/stringutils.hxx>
+#include <sal/types.h>
#ifdef RTL_FAST_STRING
#include <rtl/stringconcat.hxx>
@@ -574,7 +575,6 @@ public:
sal_Unicode sz[RTL_USTR_MAX_VALUEOFBOOLEAN];
return append( sz, rtl_ustr_valueOfBoolean( sz, b ) );
}
-#ifdef HAVE_CXX11_DELETE
#ifndef HAVE_SFINAE_ANONYMOUS_BROKEN
// Pointer can be automatically converted to bool, which is unwanted here.
// Explicitly delete all pointer append() overloads to prevent this
@@ -582,8 +582,7 @@ public:
template< typename T >
typename internal::Enable< void,
!internal::CharPtrDetector< T* >::ok && !internal::SalUnicodePtrDetector< T* >::ok >::Type
- append( T* ) = delete;
-#endif
+ append( T* ) SAL_DELETE;
#endif
// This overload is needed because OUString has a ctor from rtl_uString*, but
diff --git a/sal/inc/sal/types.h b/sal/inc/sal/types.h
index bc9b2ef..46f6003 100644
--- a/sal/inc/sal/types.h
+++ b/sal/inc/sal/types.h
@@ -23,6 +23,10 @@
#include <sal/config.h>
#include <sal/macros.h>
+#if defined LIBO_INTERNAL_ONLY
+#include <config_global.h>
+#endif
+
/* Grab __SIZEOFxxx constants from typesconfig tool on Unix */
#if defined UNX
#include <sal/typesizes.h>
@@ -395,6 +399,20 @@ namespace com { namespace sun { namespace star { } } }
*/
namespace css = ::com::sun::star;
+/** C++11 "= delete" feature.
+
+ With HAVE_CXX11_DELETE, calling a deleted function will cause a compile-time
+ error, while otherwise it will only cause a link-time error as the declared
+ function is not defined.
+
+ @since LibreOffice 4.1
+*/
+#if defined HAVE_CXX11_DELETE
+#define SAL_DELETE = delete
+#else
+#define SAL_DELETE
+#endif
+
#endif /* __cplusplus */
#ifdef __cplusplus
diff --git a/sfx2/inc/sfx2/docfile.hxx b/sfx2/inc/sfx2/docfile.hxx
index f989fde..43675fa 100644
--- a/sfx2/inc/sfx2/docfile.hxx
+++ b/sfx2/inc/sfx2/docfile.hxx
@@ -94,7 +94,7 @@ public:
// original overload have been adapted (in platform
// specific code etc.):
SfxMedium(String const &, StreamMode, void *)
- /* = delete */;
+ SAL_DELETE;
SfxMedium( const ::com::sun::star::uno::Reference< ::com::sun::star::embed::XStorage >& xStorage,
const String& rBaseURL,
More information about the Libreoffice-commits
mailing list