summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
Diffstat (limited to 'core')
-rw-r--r--core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp3
-rw-r--r--core/fxcrt/fx_basic_wstring.cpp4
-rw-r--r--core/fxcrt/include/fx_string.h2
3 files changed, 7 insertions, 2 deletions
diff --git a/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp b/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
index 62f1357572..d3dc5257a3 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_object_unittest.cpp
@@ -204,9 +204,10 @@ TEST_F(PDFObjectsTest, GetUnicodeText) {
L"\t\n", L"space", L"", L"", L"abcdefghijklmnopqrstuvwxyz",
L""};
// Check for direct objects.
- for (size_t i = 0; i < m_DirectObjs.size(); ++i)
+ for (size_t i = 0; i < m_DirectObjs.size(); ++i) {
EXPECT_STREQ(direct_obj_results[i],
m_DirectObjs[i]->GetUnicodeText().c_str());
+ }
// Check indirect references.
for (const auto& it : m_RefObjs)
diff --git a/core/fxcrt/fx_basic_wstring.cpp b/core/fxcrt/fx_basic_wstring.cpp
index 069b9fa42d..1e8f1f3232 100644
--- a/core/fxcrt/fx_basic_wstring.cpp
+++ b/core/fxcrt/fx_basic_wstring.cpp
@@ -579,6 +579,10 @@ void CFX_WideString::FormatV(const FX_WCHAR* pFormat, va_list argList) {
va_end(argListSave);
}
+const FX_WCHAR* CFX_WideString::c_str() const {
+ return m_pData ? m_pData->m_String : L"";
+}
+
void CFX_WideString::Format(const FX_WCHAR* pFormat, ...) {
va_list argList;
va_start(argList, pFormat);
diff --git a/core/fxcrt/include/fx_string.h b/core/fxcrt/include/fx_string.h
index 10a70d9334..8041522472 100644
--- a/core/fxcrt/include/fx_string.h
+++ b/core/fxcrt/include/fx_string.h
@@ -496,7 +496,7 @@ class CFX_WideString {
// Explicit conversion to C-style wide string.
// Note: Any subsequent modification of |this| will invalidate the result.
- const FX_WCHAR* c_str() const { return m_pData ? m_pData->m_String : L""; }
+ const FX_WCHAR* c_str() const;
// Explicit conversion to CFX_WideStringC.
// Note: Any subsequent modification of |this| will invalidate the result.