summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi
diff options
context:
space:
mode:
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, 8 insertions, 4 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
index 0bb66da209..9514065eeb 100644
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_decode.cpp
@@ -436,6 +436,10 @@ 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 5bacfd7393..db4d0dba43 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.c_str());
+ result = ChangeSlash(filepath);
}
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.c_str());
+ return ChangeSlash(wsFileName);
}
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.c_str());
+ result += ChangeSlash(wsFileName);
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 008349c61c..912af297f5 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);
+ m_String = PDF_EncodeText(str, str.GetLength());
}
CPDF_Array::~CPDF_Array()
{