From f0b65545313f065790de7f91c02e5dd160753abd Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 13 Feb 2017 10:26:01 -0800 Subject: Simplify FX_UTF8Encode variants. 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 Reviewed-by: dsinclair --- xfa/fxfa/parser/cxfa_object.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'xfa/fxfa/parser/cxfa_object.cpp') 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()); } -- cgit v1.2.3