summaryrefslogtreecommitdiff
path: root/core/src/fxcrt
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-27 11:47:29 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-27 11:47:29 -0700
commite6f11a7b95e26affba59a7057776a787056af8df (patch)
treeac7e527683debb15df04102b9fe333e552965909 /core/src/fxcrt
parentf7a7d7e07396c3a0fae617ed8f15f29fd491bc3a (diff)
downloadpdfium-e6f11a7b95e26affba59a7057776a787056af8df.tar.xz
Reduce usage of operator LPCWSTR from CFX_WideString().
This involves adding some explicit c_str() calls. Doing so flagged PDF_EncodeText() and FindOptionValue() as having suboptimal signatures, in that we are often throwing away a perfectly fine length and recomputing it. There are still some platform-specific code that needs the operator. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1101933003
Diffstat (limited to 'core/src/fxcrt')
-rw-r--r--core/src/fxcrt/fx_basic_wstring.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/src/fxcrt/fx_basic_wstring.cpp b/core/src/fxcrt/fx_basic_wstring.cpp
index dfdbef8bd6..e255aa0779 100644
--- a/core/src/fxcrt/fx_basic_wstring.cpp
+++ b/core/src/fxcrt/fx_basic_wstring.cpp
@@ -1062,13 +1062,13 @@ static CFX_ByteString _DefMap_GetByteString(CFX_CharMap* pCharMap, const CFX_Wid
{
int src_len = widestr.GetLength();
int codepage = pCharMap->m_GetCodePage ? pCharMap->m_GetCodePage() : 0;
- int dest_len = FXSYS_WideCharToMultiByte(codepage, 0, widestr, src_len, NULL, 0, NULL, NULL);
+ int dest_len = FXSYS_WideCharToMultiByte(codepage, 0, widestr.c_str(), src_len, NULL, 0, NULL, NULL);
if (dest_len == 0) {
return CFX_ByteString();
}
CFX_ByteString bytestr;
FX_LPSTR dest_buf = bytestr.GetBuffer(dest_len);
- FXSYS_WideCharToMultiByte(codepage, 0, widestr, src_len, dest_buf, dest_len, NULL, NULL);
+ FXSYS_WideCharToMultiByte(codepage, 0, widestr.c_str(), src_len, dest_buf, dest_len, NULL, NULL);
bytestr.ReleaseBuffer(dest_len);
return bytestr;
}