diff options
author | Tom Sepez <tsepez@chromium.org> | 2017-02-13 10:26:01 -0800 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-02-13 19:00:17 +0000 |
commit | f0b65545313f065790de7f91c02e5dd160753abd (patch) | |
tree | 747c55722c6b45a979d5c2894a259396a3189ed7 /xfa/fxfa/parser/cxfa_object.cpp | |
parent | 5fb0ad8adac5fcbf8c8f1965164f41d11c0af669 (diff) | |
download | pdfium-f0b65545313f065790de7f91c02e5dd160753abd.tar.xz |
Simplify FX_UTF8Encode variants.chromium/3012
Doing so reveals places where there are needless copies
and conversions.
Change-Id: I24a868d40aa63836f4167eaf4541964049df7916
Reviewed-on: https://pdfium-review.googlesource.com/2555
Commit-Queue: Tom Sepez <tsepez@chromium.org>
Reviewed-by: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fxfa/parser/cxfa_object.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_object.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/xfa/fxfa/parser/cxfa_object.cpp b/xfa/fxfa/parser/cxfa_object.cpp index 45e34424aa..c8cd354b48 100644 --- a/xfa/fxfa/parser/cxfa_object.cpp +++ b/xfa/fxfa/parser/cxfa_object.cpp @@ -42,9 +42,7 @@ void CXFA_Object::Script_ObjectClass_ClassName(CFXJSE_Value* pValue, ThrowInvalidPropertyException(); return; } - CFX_WideStringC className = GetClassName(); - pValue->SetString( - FX_UTF8Encode(className.c_str(), className.GetLength()).AsStringC()); + pValue->SetString(FX_UTF8Encode(GetClassName()).AsStringC()); } void CXFA_Object::ThrowInvalidPropertyException() const { @@ -71,6 +69,5 @@ void CXFA_Object::ThrowException(const FX_WCHAR* str, ...) const { va_start(arg_ptr, str); wsMessage.FormatV(str, arg_ptr); va_end(arg_ptr); - FXJSE_ThrowMessage( - FX_UTF8Encode(wsMessage.c_str(), wsMessage.GetLength()).AsStringC()); + FXJSE_ThrowMessage(wsMessage.UTF8Encode().AsStringC()); } |