[Libreoffice-commits] core.git: 3 commits - include/rtl odk/Package_odk_headers.mk
Stephan Bergmann (via logerrit)
logerrit at kemper.freedesktop.org
Sat Oct 12 13:35:22 UTC 2019
include/rtl/stringconcat.hxx | 24 +++++++++++-------------
odk/Package_odk_headers.mk | 1 -
2 files changed, 11 insertions(+), 14 deletions(-)
New commits:
commit bc02e34235c6f61422f7ea46d4c166d8486e97fe
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Sat Oct 12 08:33:43 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 12 15:34:00 2019 +0200
Use std::enable_if
Change-Id: Ib9b27e2715034ef3e81d041526b705786837c491
Reviewed-on: https://gerrit.libreoffice.org/80707
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index 466eb76746aa..595a0aa049c5 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -19,6 +19,7 @@
#include <cstddef>
#include <string>
#include <string_view>
+#include <type_traits>
#include <utility>
#include <string.h>
@@ -255,7 +256,7 @@ struct ToStringHelper< OUStringConcat< T1, T2 > >
template< typename T1, typename T2 >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOStringConcat && ToStringHelper< T2 >::allowOStringConcat >::Type operator+( const T1& left, const T2& right )
+typename std::enable_if_t< ToStringHelper< T1 >::allowOStringConcat && ToStringHelper< T2 >::allowOStringConcat, OStringConcat< T1, T2 > > operator+( const T1& left, const T2& right )
{
return OStringConcat< T1, T2 >( left, right );
}
@@ -264,7 +265,7 @@ typename libreoffice_internal::Enable< OStringConcat< T1, T2 >, ToStringHelper<
template< typename T, int N >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OStringConcat< T, const char[ N ] >, ToStringHelper< T >::allowOStringConcat >::Type operator+( const T& left, const char (&right)[ N ] )
+typename std::enable_if_t< ToStringHelper< T >::allowOStringConcat, OStringConcat< T, const char[ N ] > > operator+( const T& left, const char (&right)[ N ] )
{
return OStringConcat< T, const char[ N ] >( left, right );
}
@@ -272,7 +273,7 @@ typename libreoffice_internal::Enable< OStringConcat< T, const char[ N ] >, ToSt
template< typename T, int N >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OStringConcat< const char[ N ], T >, ToStringHelper< T >::allowOStringConcat >::Type operator+( const char (&left)[ N ], const T& right )
+typename std::enable_if_t< ToStringHelper< T >::allowOStringConcat, OStringConcat< const char[ N ], T > > operator+( const char (&left)[ N ], const T& right )
{
return OStringConcat< const char[ N ], T >( left, right );
}
@@ -280,7 +281,7 @@ typename libreoffice_internal::Enable< OStringConcat< const char[ N ], T >, ToSt
template< typename T, int N >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OStringConcat< T, char[ N ] >, ToStringHelper< T >::allowOStringConcat >::Type operator+( const T& left, char (&right)[ N ] )
+typename std::enable_if_t< ToStringHelper< T >::allowOStringConcat, OStringConcat< T, char[ N ] > > operator+( const T& left, char (&right)[ N ] )
{
return OStringConcat< T, char[ N ] >( left, right );
}
@@ -288,7 +289,7 @@ typename libreoffice_internal::Enable< OStringConcat< T, char[ N ] >, ToStringHe
template< typename T, int N >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OStringConcat< char[ N ], T >, ToStringHelper< T >::allowOStringConcat >::Type operator+( char (&left)[ N ], const T& right )
+typename std::enable_if_t< ToStringHelper< T >::allowOStringConcat, OStringConcat< char[ N ], T > > operator+( char (&left)[ N ], const T& right )
{
return OStringConcat< char[ N ], T >( left, right );
}
@@ -296,7 +297,7 @@ typename libreoffice_internal::Enable< OStringConcat< char[ N ], T >, ToStringHe
template< typename T1, typename T2 >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat >::Type operator+( const T1& left, const T2& right )
+typename std::enable_if_t< ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat, OUStringConcat< T1, T2 > > operator+( const T1& left, const T2& right )
{
return OUStringConcat< T1, T2 >( left, right );
}
@@ -304,7 +305,7 @@ typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper<
template< typename T1, typename T2 >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat && libreoffice_internal::ConstCharArrayDetector< T1, void >::ok >::Type operator+( T1& left, const T2& right )
+typename std::enable_if_t< ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat && libreoffice_internal::ConstCharArrayDetector< T1, void >::ok, OUStringConcat< T1, T2 > > operator+( T1& left, const T2& right )
{
return OUStringConcat< T1, T2 >( left, right );
}
@@ -312,7 +313,7 @@ typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper<
template< typename T1, typename T2 >
[[nodiscard]]
inline
-typename libreoffice_internal::Enable< OUStringConcat< T1, T2 >, ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat && libreoffice_internal::ConstCharArrayDetector< T2, void >::ok >::Type operator+( const T1& left, T2& right )
+typename std::enable_if_t< ToStringHelper< T1 >::allowOUStringConcat && ToStringHelper< T2 >::allowOUStringConcat && libreoffice_internal::ConstCharArrayDetector< T2, void >::ok, OUStringConcat< T1, T2 > > operator+( const T1& left, T2& right )
{
return OUStringConcat< T1, T2 >( left, right );
}
commit cabad92c1c24ac77ca8c2c97b365cf80a3c09344
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 11 17:19:14 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 12 15:33:37 2019 +0200
Remove unused ToStringHelper<char[N]>::addData sal_Unicode overload
...that was present ever since d87f5d30879aca73fff271c254589fc41a91fdd0
"support for fast O(U)String concatenation using operator+" but was likely a
typo/thinko
Change-Id: I0e56166d95f447a26dba9b456255b4ed339f1e2f
Reviewed-on: https://gerrit.libreoffice.org/80668
Reviewed-by: Luboš Luňák <l.lunak at collabora.com>
Tested-by: Jenkins
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index 049b5ab302ba..466eb76746aa 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -129,7 +129,6 @@ struct ToStringHelper< char[ N ] >
return sal::static_int_cast<int>(strlen( str ));
}
static char* addData( char* buffer, const char str[ N ] ) { return addDataCString( buffer, str ); }
- static sal_Unicode* addData( sal_Unicode* buffer, const char str[ N ] ) { return addDataLiteral( buffer, str, N - 1 ); }
static const bool allowOStringConcat = true;
static const bool allowOUStringConcat = false;
};
commit 7e75592add27d2585ca4189fba85dfae6879aeef
Author: Stephan Bergmann <sbergman at redhat.com>
AuthorDate: Fri Oct 11 17:16:48 2019 +0200
Commit: Stephan Bergmann <sbergman at redhat.com>
CommitDate: Sat Oct 12 15:33:16 2019 +0200
rtl/stringconcat.hxx is not part of the URE interface
(and #include's of it in include/rtl/*.hxx are already guarded with
LIBO_INTERNAL_ONLY)
Change-Id: I9224f71a244a69ef69406ea3a5879b66b3cae3a3
Reviewed-on: https://gerrit.libreoffice.org/80666
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/rtl/stringconcat.hxx b/include/rtl/stringconcat.hxx
index 2dbde557b7df..049b5ab302ba 100644
--- a/include/rtl/stringconcat.hxx
+++ b/include/rtl/stringconcat.hxx
@@ -10,6 +10,8 @@
#ifndef INCLUDED_RTL_STRINGCONCAT_HXX
#define INCLUDED_RTL_STRINGCONCAT_HXX
+// This file is only included from LIBO_INTERNAL_ONLY
+
#include "rtl/stringutils.hxx"
#include "rtl/string.h"
#include "rtl/ustring.h"
@@ -21,8 +23,6 @@
#include <string.h>
-#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
-
#if defined RTL_STRING_UNITTEST_CONCAT
extern bool rtl_string_unittest_invalid_concat;
#endif
@@ -480,5 +480,3 @@ struct ToStringHelper< OUStringNumber< T > >
} // namespace
#endif
-
-#endif
diff --git a/odk/Package_odk_headers.mk b/odk/Package_odk_headers.mk
index 40e0fb83d0f8..cc52b9719f9a 100644
--- a/odk/Package_odk_headers.mk
+++ b/odk/Package_odk_headers.mk
@@ -136,7 +136,6 @@ $(eval $(call gb_Package_add_files_with_dir,odk_headers,$(SDKDIRNAME)/include,\
rtl/strbuf.hxx \
rtl/string.h \
rtl/string.hxx \
- rtl/stringconcat.hxx \
rtl/stringutils.hxx \
rtl/tencinfo.h \
rtl/textcvt.h \
More information about the Libreoffice-commits
mailing list