summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/rtl/string.hxx32
-rw-r--r--include/rtl/ustring.hxx32
-rw-r--r--sal/rtl/strimp.hxx2
3 files changed, 65 insertions, 1 deletions
diff --git a/include/rtl/string.hxx b/include/rtl/string.hxx
index ca0d1d114053..57784885e773 100644
--- a/include/rtl/string.hxx
+++ b/include/rtl/string.hxx
@@ -114,6 +114,21 @@ public:
rtl_string_acquire( pData );
}
+#if defined LIBO_INTERNAL_ONLY
+ /**
+ Move constructor.
+
+ @param str a OString.
+ @since LibreOffice 5.2
+ */
+ OString( OString && str )
+ {
+ pData = str.pData;
+ str.pData = nullptr;
+ rtl_string_new( &str.pData );
+ }
+#endif
+
/**
New string from OString data.
@@ -281,6 +296,23 @@ public:
return *this;
}
+#if defined LIBO_INTERNAL_ONLY
+ /**
+ Move assign a new string.
+
+ @param str a OString.
+ @since LibreOffice 5.2
+ */
+ OString & operator=( OString && str )
+ {
+ rtl_string_release( pData );
+ pData = str.pData;
+ str.pData = nullptr;
+ rtl_string_new( &str.pData );
+ return *this;
+ }
+#endif
+
/**
@overload
This function accepts an ASCII string literal as its argument.
diff --git a/include/rtl/ustring.hxx b/include/rtl/ustring.hxx
index 2337e322c6d4..3ede5973d016 100644
--- a/include/rtl/ustring.hxx
+++ b/include/rtl/ustring.hxx
@@ -130,6 +130,21 @@ public:
rtl_uString_acquire( pData );
}
+#if defined LIBO_INTERNAL_ONLY
+ /**
+ Move constructor.
+
+ @param str a OUString.
+ @since LibreOffice 5.2
+ */
+ OUString( OUString && str )
+ {
+ pData = str.pData;
+ str.pData = nullptr;
+ rtl_uString_new( &str.pData );
+ }
+#endif
+
/**
New string from OUString data.
@@ -386,6 +401,23 @@ public:
return *this;
}
+#if defined LIBO_INTERNAL_ONLY
+ /**
+ Move assign a new string.
+
+ @param str a OString.
+ @since LibreOffice 5.2
+ */
+ OUString & operator=( OUString && str )
+ {
+ rtl_uString_release( pData );
+ pData = str.pData;
+ str.pData = nullptr;
+ rtl_uString_new( &str.pData );
+ return *this;
+ }
+#endif
+
/**
Assign a new string from an 8-Bit string literal that is expected to contain only
characters in the ASCII set (i.e. first 128 characters). This operator
diff --git a/sal/rtl/strimp.hxx b/sal/rtl/strimp.hxx
index b7589cde2f28..5583a82f2249 100644
--- a/sal/rtl/strimp.hxx
+++ b/sal/rtl/strimp.hxx
@@ -33,7 +33,7 @@
/* ======================================================================= */
/*
- * refCount is opaqueincludes 2 bit-fields;
+ * refCount is opaque and includes 2 bit-fields;
* MSB: 'interned' - is stored in the intern hash
* MSB-1: 'static' - is a const / static string,
* do no ref counting