Kaydet (Commit) e497d4d4 authored tarafından Caolán McNamara's avatar Caolán McNamara Kaydeden (comit) Stephan Bergmann

coverity#1371227 Missing move assignment operator

Change-Id: I2de6b5e2910ff570c08e662769d5e6ee188825a7
Reviewed-on: https://gerrit.libreoffice.org/32843Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarStephan Bergmann <sbergman@redhat.com>
üst 5aa8569b
...@@ -189,6 +189,9 @@ public: ...@@ -189,6 +189,9 @@ public:
@param rSeq another byte sequence @param rSeq another byte sequence
*/ */
inline ByteSequence( const ByteSequence & rSeq ); inline ByteSequence( const ByteSequence & rSeq );
#if defined LIBO_INTERNAL_ONLY
inline ByteSequence( ByteSequence && rSeq );
#endif
/** Copy constructor Creates a copy from the C-Handle. /** Copy constructor Creates a copy from the C-Handle.
@param pSequence another byte sequence handle @param pSequence another byte sequence handle
...@@ -232,6 +235,9 @@ public: ...@@ -232,6 +235,9 @@ public:
@return this sequence @return this sequence
*/ */
inline ByteSequence & SAL_CALL operator = ( const ByteSequence & rSeq ); 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. /** Gets the length of sequence.
......
...@@ -40,6 +40,14 @@ inline ByteSequence::ByteSequence( const ByteSequence & rSeq ) ...@@ -40,6 +40,14 @@ inline ByteSequence::ByteSequence( const ByteSequence & rSeq )
::rtl_byte_sequence_assign( &_pSequence, rSeq._pSequence ); ::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) inline ByteSequence::ByteSequence( sal_Sequence *pSequence)
: _pSequence( pSequence ) : _pSequence( pSequence )
{ {
...@@ -86,6 +94,16 @@ inline ByteSequence & ByteSequence::operator = ( const ByteSequence & rSeq ) ...@@ -86,6 +94,16 @@ inline ByteSequence & ByteSequence::operator = ( const ByteSequence & rSeq )
return *this; 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 inline bool ByteSequence::operator == ( const ByteSequence & rSeq ) const
{ {
return ::rtl_byte_sequence_equals( _pSequence, rSeq._pSequence ); return ::rtl_byte_sequence_equals( _pSequence, rSeq._pSequence );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment