cid#1371226 Missing move assignment operator
Change-Id: I915b24d8f546f156b85ad18ad0418903fa3ce1ba
This commit is contained in:
@@ -27,9 +27,11 @@ public:
|
||||
SharedString( rtl_uString* pData, rtl_uString* pDataIgnoreCase );
|
||||
explicit SharedString( const OUString& rStr );
|
||||
SharedString( const SharedString& r );
|
||||
SharedString( SharedString&& r );
|
||||
~SharedString();
|
||||
|
||||
SharedString& operator= ( const SharedString& r );
|
||||
SharedString& operator= ( SharedString&& r );
|
||||
|
||||
bool operator== ( const SharedString& r ) const;
|
||||
bool operator!= ( const SharedString& r ) const;
|
||||
|
@@ -44,6 +44,12 @@ SharedString::SharedString( const SharedString& r ) : mpData(r.mpData), mpDataIg
|
||||
rtl_uString_acquire(mpDataIgnoreCase);
|
||||
}
|
||||
|
||||
SharedString::SharedString( SharedString&& r ) : mpData(r.mpData), mpDataIgnoreCase(r.mpDataIgnoreCase)
|
||||
{
|
||||
r.mpData = nullptr;
|
||||
r.mpDataIgnoreCase = nullptr;
|
||||
}
|
||||
|
||||
SharedString::~SharedString()
|
||||
{
|
||||
if (mpData)
|
||||
@@ -70,6 +76,22 @@ SharedString& SharedString::operator= ( const SharedString& r )
|
||||
return *this;
|
||||
}
|
||||
|
||||
SharedString& SharedString::operator= ( SharedString&& r )
|
||||
{
|
||||
if (mpData)
|
||||
rtl_uString_release(mpData);
|
||||
if (mpDataIgnoreCase)
|
||||
rtl_uString_release(mpDataIgnoreCase);
|
||||
|
||||
mpData = r.mpData;
|
||||
mpDataIgnoreCase = r.mpDataIgnoreCase;
|
||||
|
||||
r.mpData = nullptr;
|
||||
r.mpDataIgnoreCase = nullptr;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool SharedString::operator== ( const SharedString& r ) const
|
||||
{
|
||||
// Only compare case sensitive strings.
|
||||
|
Reference in New Issue
Block a user