summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2017-01-08 16:55:08 +0000
committerStephan Bergmann <sbergman@redhat.com>2017-01-09 09:05:41 +0000
commite497d4d49033239869a3ad9f7c388e4c2acc3401 (patch)
tree68bfedfdf0fea57da15c3971c37363d876cbebf6
parent5aa8569b8412f86ff4c1e00d9cefeeaac9bc3c7c (diff)
coverity#1371227 Missing move assignment operator
Change-Id: I2de6b5e2910ff570c08e662769d5e6ee188825a7 Reviewed-on: https://gerrit.libreoffice.org/32843 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
-rw-r--r--include/rtl/byteseq.h6
-rw-r--r--include/rtl/byteseq.hxx18
2 files changed, 24 insertions, 0 deletions
diff --git a/include/rtl/byteseq.h b/include/rtl/byteseq.h
index 3c057454f4da..ef003026ab51 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 041b8bc361a8..122d1bc611ba 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 );