summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-27 11:22:20 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-27 11:22:20 -0700
commit15a62973b9b89c3e229cc0ab501c45967f91b325 (patch)
treed95505963de5d8640fb85067639b6fdaf159d1b6 /core/src/fpdfapi
parentef25d9995e494bd596ffea8fb8c09c2e48daa9a0 (diff)
downloadpdfium-15a62973b9b89c3e229cc0ab501c45967f91b325.tar.xz
Kill 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. R=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1101933003
Diffstat (limited to 'core/src/fpdfapi')
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp4
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp2
3 files changed, 4 insertions, 8 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index 9514065eeb..0bb66da209 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -436,10 +436,6 @@ CFX_WideString PDF_DecodeText(FX_LPCBYTE src_data, FX_DWORD src_len, CFX_CharMap
}
return result;
}
-CFX_WideString PDF_DecodeText(const CFX_ByteString& bstr, CFX_CharMap* pCharMap)
-{
- return PDF_DecodeText((FX_LPCBYTE)bstr.c_str(), bstr.GetLength(), pCharMap);
-}
CFX_ByteString PDF_EncodeText(FX_LPCWSTR pString, int len, CFX_CharMap* pCharMap)
{
if (len == -1) {
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
index db4d0dba43..5bacfd7393 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_fdf.cpp
@@ -141,7 +141,7 @@ void FPDF_FileSpec_SetWin32Path(CPDF_Object* pFileSpec, const CFX_WideString& fi
} else if (filepath.GetLength() > 1 && filepath[0] == '\\' && filepath[1] == '\\') {
result = ChangeSlash(filepath.c_str() + 1);
} else {
- result = ChangeSlash(filepath);
+ result = ChangeSlash(filepath.c_str());
}
if (pFileSpec->GetType() == PDFOBJ_STRING) {
pFileSpec->SetString(CFX_ByteString::FromUnicode(result));
@@ -173,7 +173,7 @@ CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec)
wsFileName = CFX_WideString::FromLocal(pFileSpec->GetString());
}
if (wsFileName[0] != '/') {
- return ChangeSlash(wsFileName);
+ return ChangeSlash(wsFileName.c_str());
}
if (wsFileName[2] == '/') {
CFX_WideString result;
@@ -184,7 +184,7 @@ CFX_WideString FPDF_FileSpec_GetWin32Path(const CPDF_Object* pFileSpec)
} else {
CFX_WideString result;
result += '\\';
- result += ChangeSlash(wsFileName);
+ result += ChangeSlash(wsFileName.c_str());
return result;
}
}
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
index 912af297f5..008349c61c 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_objects.cpp
@@ -375,7 +375,7 @@ void CPDF_Number::SetNumber(FX_FLOAT value)
m_Float = value;
}
CPDF_String::CPDF_String(const CFX_WideString& str) : CPDF_Object(PDFOBJ_STRING), m_bHex(FALSE) {
- m_String = PDF_EncodeText(str, str.GetLength());
+ m_String = PDF_EncodeText(str);
}
CPDF_Array::~CPDF_Array()
{