[Libreoffice-commits] core.git: include/rtl
Caolán McNamara
caolanm at redhat.com
Mon Jan 9 09:06:10 UTC 2017
include/rtl/byteseq.h | 6 ++++++
include/rtl/byteseq.hxx | 18 ++++++++++++++++++
2 files changed, 24 insertions(+)
New commits:
commit e497d4d49033239869a3ad9f7c388e4c2acc3401
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Jan 8 16:55:08 2017 +0000
coverity#1371227 Missing move assignment operator
Change-Id: I2de6b5e2910ff570c08e662769d5e6ee188825a7
Reviewed-on: https://gerrit.libreoffice.org/32843
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/rtl/byteseq.h b/include/rtl/byteseq.h
index 3c05745..ef00302 100644
--- a/include/rtl/byteseq.h
+++ b/include/rtl/byteseq.h
@@ -189,6 +189,9 @@ public:
@param rSeq another byte sequence
*/
inline ByteSequence( const ByteSequence & rSeq );
+#if defined LIBO_INTERNAL_ONLY
+ inline ByteSequence( ByteSequence && rSeq );
+#endif
/** Copy constructor Creates a copy from the C-Handle.
@param pSequence another byte sequence handle
@@ -232,6 +235,9 @@ public:
@return this sequence
*/
inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq );
+#if defined LIBO_INTERNAL_ONLY
+ inline ByteSequence & SAL_CALL operator = ( ByteSequence && rSeq );
+#endif
/** Gets the length of sequence.
diff --git a/include/rtl/byteseq.hxx b/include/rtl/byteseq.hxx
index 041b8bc..122d1bc 100644
--- a/include/rtl/byteseq.hxx
+++ b/include/rtl/byteseq.hxx
@@ -40,6 +40,14 @@ inline ByteSequence::ByteSequence( const ByteSequence & rSeq )
::rtl_byte_sequence_assign( &_pSequence, rSeq._pSequence );
}
+#if defined LIBO_INTERNAL_ONLY
+inline ByteSequence::ByteSequence( ByteSequence && rSeq )
+ : _pSequence(rSeq._pSequence)
+{
+ rSeq._pSequence = nullptr;
+}
+#endif
+
inline ByteSequence::ByteSequence( sal_Sequence *pSequence)
: _pSequence( pSequence )
{
@@ -86,6 +94,16 @@ inline ByteSequence & ByteSequence::operator = ( const ByteSequence & rSeq )
return *this;
}
+#if defined LIBO_INTERNAL_ONLY
+inline ByteSequence & ByteSequence::operator = ( ByteSequence && rSeq )
+{
+ ::rtl_byte_sequence_release(_pSequence);
+ _pSequence = rSeq._pSequence;
+ rSeq._pSequence = nullptr;
+ return *this;
+}
+#endif
+
inline bool ByteSequence::operator == ( const ByteSequence & rSeq ) const
{
return ::rtl_byte_sequence_equals( _pSequence, rSeq._pSequence );
More information about the Libreoffice-commits
mailing list