summaryrefslogtreecommitdiff
path: root/core/fxcrt/widestring.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcrt/widestring.cpp')
-rw-r--r--core/fxcrt/widestring.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/core/fxcrt/widestring.cpp b/core/fxcrt/widestring.cpp
index 25f253ea11..cde1973d26 100644
--- a/core/fxcrt/widestring.cpp
+++ b/core/fxcrt/widestring.cpp
@@ -441,9 +441,16 @@ const WideString& WideString::operator=(const WideStringView& stringSrc) {
return *this;
}
-const WideString& WideString::operator=(const WideString& stringSrc) {
- if (m_pData != stringSrc.m_pData)
- m_pData = stringSrc.m_pData;
+const WideString& WideString::operator=(const WideString& that) {
+ if (m_pData != that.m_pData)
+ m_pData = that.m_pData;
+
+ return *this;
+}
+
+const WideString& WideString::operator=(WideString&& that) {
+ if (m_pData != that.m_pData)
+ m_pData = std::move(that.m_pData);
return *this;
}
@@ -662,6 +669,10 @@ void WideString::Concat(const wchar_t* pSrcData, size_t nSrcLen) {
m_pData.Swap(pNewData);
}
+intptr_t WideString::ReferenceCountForTesting() const {
+ return m_pData ? m_pData->m_nRefs : 0;
+}
+
ByteString WideString::UTF8Encode() const {
return FX_UTF8Encode(AsStringView());
}