summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config_host/config_global.h.in1
-rw-r--r--configure.ac17
-rw-r--r--dbaccess/source/ui/dlg/DbAdminImpl.cxx36
-rw-r--r--dbaccess/source/ui/querydesign/QueryDesignView.cxx2
-rw-r--r--extensions/source/dbpilots/gridwizard.cxx2
-rw-r--r--fpicker/source/office/commonpicker.cxx16
-rw-r--r--include/rtl/string.hxx14
-rw-r--r--include/rtl/ustring.hxx25
-rw-r--r--sal/qa/rtl/strings/test_oustring_concat.cxx10
-rw-r--r--svtools/source/dialogs/addresstemplate.cxx10
-rw-r--r--svx/source/form/fmsrccfg.cxx8
-rw-r--r--toolkit/source/controls/formattedcontrol.cxx6
12 files changed, 100 insertions, 47 deletions
diff --git a/config_host/config_global.h.in b/config_host/config_global.h.in
index 72e3f3c9814d..c7c5987cd19d 100644
--- a/config_host/config_global.h.in
+++ b/config_host/config_global.h.in
@@ -14,6 +14,7 @@ Any change in this header will cause a rebuild of almost everything.
#define HAVE_CXX11_CONSTEXPR 0
#define HAVE_CXX14_CONSTEXPR 0
+#define HAVE_CXX11_REF_QUALIFIER 0
#define HAVE_CXX14_SIZED_DEALLOCATION 0
#define HAVE_GCC_BUILTIN_ATOMIC 0
/* _Pragma */
diff --git a/configure.ac b/configure.ac
index cf52e9d46ad5..2f064eb8acd3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6335,6 +6335,23 @@ if test "$cxx14_constexpr" = yes; then
AC_DEFINE([HAVE_CXX14_CONSTEXPR])
fi
+AC_MSG_CHECKING([whether $CXX supports C++11 ref-qualifier])
+save_CXXFLAGS=$CXXFLAGS
+CXXFLAGS="$CXXFLAGS $CXXFLAGS_CXX11"
+AC_LANG_PUSH([C++])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+ struct S {
+ void f() &;
+ void f() &&;
+ };
+ ]])], [cxx11_ref_qualifier=yes], [cxx11_ref_qualifier=no])
+AC_LANG_POP([C++])
+CXXFLAGS=$save_CXXFLAGS
+AC_MSG_RESULT([$cxx11_ref_qualifier])
+if test "$cxx11_ref_qualifier" = yes; then
+ AC_DEFINE([HAVE_CXX11_REF_QUALIFIER])
+fi
+
AC_MSG_CHECKING([whether $CXX supports C++14 sized deallocation])
if test "$CROSS_COMPILING" = TRUE; then
cxx14_sized_deallocation=no
diff --git a/dbaccess/source/ui/dlg/DbAdminImpl.cxx b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
index 8455001ff916..2ec9b1b90fbb 100644
--- a/dbaccess/source/ui/dlg/DbAdminImpl.cxx
+++ b/dbaccess/source/ui/dlg/DbAdminImpl.cxx
@@ -917,11 +917,10 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
}
else {
OSL_FAIL(
- ( OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" )
- += OString( translatePropertyId( _nId ) )
- += OString( " should be no string)!" )
- ).getStr()
- );
+ OString(
+ "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value ("
+ + translatePropertyId(_nId)
+ + " should be no string)!").getStr());
}
break;
@@ -947,11 +946,10 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
}
else {
OSL_FAIL(
- ( OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" )
- += OString( translatePropertyId( _nId ) )
- += OString( " should be no boolean)!" )
- ).getStr()
- );
+ OString(
+ "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value ("
+ + translatePropertyId(_nId)
+ + " should be no boolean)!").getStr());
}
break;
@@ -964,11 +962,10 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
}
else {
OSL_FAIL(
- ( OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" )
- += OString( translatePropertyId( _nId ) )
- += OString( " should be no int)!" )
- ).getStr()
- );
+ OString(
+ "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value ("
+ + translatePropertyId(_nId)
+ + " should be no int)!").getStr());
}
break;
@@ -997,11 +994,10 @@ void ODbDataSourceAdministrationHelper::implTranslateProperty( SfxItemSet& _rSet
}
else {
OSL_FAIL(
- ( OString( "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value (" )
- += OString( translatePropertyId( _nId ) )
- += OString( " should be no string sequence)!" )
- ).getStr()
- );
+ OString(
+ "ODbDataSourceAdministrationHelper::implTranslateProperty: invalid property value ("
+ + translatePropertyId(_nId)
+ + " should be no string sequence)!").getStr());
}
break;
diff --git a/dbaccess/source/ui/querydesign/QueryDesignView.cxx b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
index 9312308a47ba..6d1907a77959 100644
--- a/dbaccess/source/ui/querydesign/QueryDesignView.cxx
+++ b/dbaccess/source/ui/querydesign/QueryDesignView.cxx
@@ -2758,7 +2758,7 @@ void OQueryDesignView::fillValidFields(const OUString& sAliasName, ComboBox* pFi
for(;aStrIter != aStrEnd;++aStrIter)
{
if (bAllTables || aStrIter->toChar() == '*')
- pFieldList->InsertEntry(OUString(strCurrentPrefix) += *aStrIter);
+ pFieldList->InsertEntry(strCurrentPrefix + *aStrIter);
else
pFieldList->InsertEntry(*aStrIter);
}
diff --git a/extensions/source/dbpilots/gridwizard.cxx b/extensions/source/dbpilots/gridwizard.cxx
index d79c06c3bc80..91b0d21b4072 100644
--- a/extensions/source/dbpilots/gridwizard.cxx
+++ b/extensions/source/dbpilots/gridwizard.cxx
@@ -203,7 +203,7 @@ namespace dbp
// the data field the column should be bound to
xColumn->setPropertyValue(s_sDataFieldProperty, makeAny(*pFormFieldName));
// the label
- xColumn->setPropertyValue(s_sLabelProperty, makeAny(OUString(*pFormFieldName) += *pColumnLabelPostfix));
+ xColumn->setPropertyValue(s_sLabelProperty, makeAny(*pFormFieldName + *pColumnLabelPostfix));
// the width (<void/> => column will be auto-sized)
xColumn->setPropertyValue(s_sWidthProperty, Any());
diff --git a/fpicker/source/office/commonpicker.cxx b/fpicker/source/office/commonpicker.cxx
index 9546ab79e772..1e84b11d17e9 100644
--- a/fpicker/source/office/commonpicker.cxx
+++ b/fpicker/source/office/commonpicker.cxx
@@ -450,21 +450,19 @@ namespace svt
else
{
OSL_FAIL(
- ( OString( "OCommonPicker::initialize: unknown argument type at position " )
- += OString::number( pArguments - _rArguments.getConstArray() )
- ).getStr()
- );
+ OString(
+ "OCommonPicker::initialize: unknown argument type at position "
+ + OString::number(pArguments - _rArguments.getConstArray())).getStr());
continue;
}
bool bKnownSetting =
implHandleInitializationArgument( sSettingName, aSettingValue );
DBG_ASSERT( bKnownSetting,
- ( OString( "OCommonPicker::initialize: unknown argument \"" )
- += OString( sSettingName.getStr(), sSettingName.getLength(), osl_getThreadTextEncoding() )
- += OString( "\"!" )
- ).getStr()
- );
+ OString(
+ "OCommonPicker::initialize: unknown argument \""
+ + OString(sSettingName.getStr(), sSettingName.getLength(), osl_getThreadTextEncoding())
+ + "\"!").getStr() );
}
}
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index 2caafc2369c7..ad143f5ae047 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -33,6 +33,7 @@
#include <rtl/stringutils.hxx>
#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
+#include <config_global.h>
#include <rtl/stringconcat.hxx>
#endif
@@ -309,10 +310,16 @@ public:
@param str a OString.
*/
OString & operator+=( const OString & str )
+#if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER
+ &
+#endif
{
rtl_string_newConcat( &pData, pData, str.pData );
return *this;
}
+#if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER
+ void operator+=(OString const &) && = delete;
+#endif
#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@@ -321,6 +328,9 @@ public:
*/
template< typename T1, typename T2 >
OString& operator+=( const OStringConcat< T1, T2 >& c )
+#if HAVE_CXX11_REF_QUALIFIER
+ &
+#endif
{
sal_Int32 l = c.length();
if( l == 0 )
@@ -332,6 +342,10 @@ public:
pData->length = l;
return *this;
}
+#if HAVE_CXX11_REF_QUALIFIER
+ template<typename T1, typename T2> void operator +=(
+ OStringConcat<T1, T2> const &) && = delete;
+#endif
#endif
/**
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index ee96da1722fc..398dd93fbfd3 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -34,6 +34,7 @@
#include <sal/log.hxx>
#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
+#include <config_global.h>
#include <rtl/stringconcat.hxx>
#endif
@@ -419,10 +420,16 @@ public:
@param str a OUString.
*/
OUString & operator+=( const OUString & str )
+#if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER
+ &
+#endif
{
rtl_uString_newConcat( &pData, pData, str.pData );
return *this;
}
+#if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER
+ void operator+=(OUString const &) && = delete;
+#endif
/** Append an ASCII string literal to this string.
@@ -432,7 +439,11 @@ public:
*/
template<typename T>
typename libreoffice_internal::ConstCharArrayDetector<T, OUString &>::Type
- operator +=(T & literal) {
+ operator +=(T & literal)
+#if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER
+ &
+#endif
+ {
assert(
libreoffice_internal::ConstCharArrayDetector<T>::isValid(literal));
rtl_uString_newConcatAsciiL(
@@ -441,6 +452,11 @@ public:
libreoffice_internal::ConstCharArrayDetector<T>::length);
return *this;
}
+#if defined LIBO_INTERNAL_ONLY && HAVE_CXX11_REF_QUALIFIER
+ template<typename T>
+ typename libreoffice_internal::ConstCharArrayDetector<T, OUString &>::Type
+ operator +=(T &) && = delete;
+#endif
#ifdef LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@@ -449,6 +465,9 @@ public:
*/
template< typename T1, typename T2 >
OUString& operator+=( const OUStringConcat< T1, T2 >& c )
+#if HAVE_CXX11_REF_QUALIFIER
+ &
+#endif
{
sal_Int32 l = c.length();
if( l == 0 )
@@ -460,6 +479,10 @@ public:
pData->length = l;
return *this;
}
+#if HAVE_CXX11_REF_QUALIFIER
+ template<typename T1, typename T2> void operator +=(
+ OUStringConcat<T1, T2> const &) && = delete;
+#endif
#endif
/**
diff --git a/sal/qa/rtl/strings/test_oustring_concat.cxx b/sal/qa/rtl/strings/test_oustring_concat.cxx
index 977229691702..3bc69e17cfe8 100644
--- a/sal/qa/rtl/strings/test_oustring_concat.cxx
+++ b/sal/qa/rtl/strings/test_oustring_concat.cxx
@@ -75,8 +75,14 @@ void test::oustring::StringConcat::checkConcat()
void test::oustring::StringConcat::checkConcatAsciiL()
{
- CPPUNIT_ASSERT_EQUAL(OUString("foo"), OUString("foo") += "");
- CPPUNIT_ASSERT_EQUAL(OUString("foobar"), OUString("foo") += "bar");
+ {
+ OUString s("foo");
+ CPPUNIT_ASSERT_EQUAL(OUString("foo"), s += "");
+ }
+ {
+ OUString s("foo");
+ CPPUNIT_ASSERT_EQUAL(OUString("foobar"), s += "bar");
+ }
}
void test::oustring::StringConcat::checkEnsureCapacity()
diff --git a/svtools/source/dialogs/addresstemplate.cxx b/svtools/source/dialogs/addresstemplate.cxx
index 9c6da2def304..1f19223ff404 100644
--- a/svtools/source/dialogs/addresstemplate.cxx
+++ b/svtools/source/dialogs/addresstemplate.cxx
@@ -183,11 +183,11 @@ public:
}
else
{
- OSL_FAIL( ( OString("AssigmentTransientData::AssigmentTransientData: unknown programmatic name (")
- += OString(pFields->ProgrammaticName.getStr(), pFields->ProgrammaticName.getLength(), RTL_TEXTENCODING_ASCII_US)
- += OString(")!")
- ).getStr()
- );
+ OSL_FAIL(
+ OString(
+ "AssigmentTransientData::AssigmentTransientData: unknown programmatic name ("
+ + OString(pFields->ProgrammaticName.getStr(), pFields->ProgrammaticName.getLength(), RTL_TEXTENCODING_ASCII_US)
+ + ")!").getStr());
}
}
}
diff --git a/svx/source/form/fmsrccfg.cxx b/svx/source/form/fmsrccfg.cxx
index f644f2d6fce9..ca58fe62c2fa 100644
--- a/svx/source/form/fmsrccfg.cxx
+++ b/svx/source/form/fmsrccfg.cxx
@@ -135,11 +135,9 @@ namespace svxform
}
OSL_FAIL(
- ( OString( "lcl_implMapIntValue: could not convert the integer value " )
- += OString::number( _nValue )
- += OString( " !" )
- ).getStr()
- );
+ OString(
+ "lcl_implMapIntValue: could not convert the integer value "
+ + OString::number(_nValue) + " !").getStr());
static const sal_Char* s_pDummy = "";
// just as a fallback ....
return s_pDummy;
diff --git a/toolkit/source/controls/formattedcontrol.cxx b/toolkit/source/controls/formattedcontrol.cxx
index ef8393bbae7b..5cd650da2d6b 100644
--- a/toolkit/source/controls/formattedcontrol.cxx
+++ b/toolkit/source/controls/formattedcontrol.cxx
@@ -363,9 +363,9 @@ namespace toolkit
}
throw IllegalArgumentException(
- ( OUString("Unable to convert the given value for the property ")
- += GetPropertyName((sal_uInt16)nPropId) )
- += " (double, integer, or string expected).",
+ ("Unable to convert the given value for the property "
+ + GetPropertyName((sal_uInt16)nPropId)
+ + " (double, integer, or string expected)."),
static_cast< XPropertySet* >(this),
1);
}