From 067990ccf96ae962392a2dbacbfd8348dc4c7676 Mon Sep 17 00:00:00 2001 From: tsepez Date: Tue, 13 Sep 2016 06:46:40 -0700 Subject: Stop converting widestring -> c_str -> widestring in several places. Avoids a needless alloc and copy. Review-Url: https://codereview.chromium.org/2338553002 --- core/fpdfdoc/cpvt_generateap.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'core/fpdfdoc/cpvt_generateap.cpp') diff --git a/core/fpdfdoc/cpvt_generateap.cpp b/core/fpdfdoc/cpvt_generateap.cpp index 8c8cb9333c..741b2365f5 100644 --- a/core/fpdfdoc/cpvt_generateap.cpp +++ b/core/fpdfdoc/cpvt_generateap.cpp @@ -234,7 +234,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, vt.SetLimitChar(dwMaxLen); vt.Initialize(); - vt.SetText(swValue.c_str()); + vt.SetText(swValue); vt.RearrangeAll(); CFX_FloatRect rcContent = vt.GetContentRect(); CFX_FloatPoint ptOffset(0.0f, 0.0f); @@ -284,7 +284,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, vt.SetFontSize(fFontSize); vt.Initialize(); - vt.SetText(swValue.c_str()); + vt.SetText(swValue); vt.RearrangeAll(); CFX_FloatRect rcContent = vt.GetContentRect(); CFX_FloatPoint ptOffset = @@ -374,7 +374,7 @@ bool GenerateWidgetAP(CPDF_Document* pDoc, vt.SetFontSize(IsFloatZero(fFontSize) ? 12.0f : fFontSize); vt.Initialize(); - vt.SetText(swItem.c_str()); + vt.SetText(swItem); vt.RearrangeAll(); FX_FLOAT fItemHeight = vt.GetContentRect().Height(); if (bSelected) { @@ -516,7 +516,7 @@ CFX_ByteString GetPopupContentsString(CPDF_Document* pDoc, vt.SetMultiLine(TRUE); vt.Initialize(); - vt.SetText(swValue.c_str()); + vt.SetText(swValue); vt.RearrangeAll(); CFX_FloatPoint ptOffset(3.0f, -3.0f); CFX_ByteString sContent = CPVT_GenerateAP::GenerateEditAP( -- cgit v1.2.3