Merge to XFA: Reduce usage of operator LPCWSTR from CFX_WideString().

Original Review URL: https://codereview.chromium.org/1101933003
TBR=brucedawson@chromium.org

Review URL: https://codereview.chromium.org/1108903002
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index c8edcf6..6b24366 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -11,7 +11,6 @@
 #include "../../include/javascript/JS_Value.h"
 #include "../../include/javascript/Field.h"
 #include "../../include/javascript/JS_EventHandler.h"
-//#include "../include/JS_ResMgr.h"
 #include "../../include/javascript/JS_Context.h"
 #include "../../include/javascript/JS_Runtime.h"
 #include "../../include/javascript/Document.h"
@@ -259,7 +258,7 @@
 				FX_BOOL bFormated = FALSE;
 				CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
 				if (bFormated)
-					pWidget->ResetAppearance(sValue, FALSE);
+					pWidget->ResetAppearance(sValue.c_str(), FALSE);
 				else
 					pWidget->ResetAppearance(NULL, FALSE);
 			}
@@ -316,7 +315,7 @@
 				FX_BOOL bFormated = FALSE;
 				CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
 				if (bFormated)
-					pWidget->ResetAppearance(sValue, FALSE);
+					pWidget->ResetAppearance(sValue.c_str(), FALSE);
 				else
 					pWidget->ResetAppearance(NULL, FALSE);
 			}
@@ -3127,7 +3126,7 @@
 
 				double dRet;
 				FX_BOOL bDot;
-				if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
+				if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
 				{
 					if (bDot)
 						vp << dRet;
@@ -3148,9 +3147,9 @@
 					for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++)
 					{
 						iIndex = pFormField->GetSelectedIndex(i);
-						ElementValue = pFormField->GetOptionValue(iIndex);
+						ElementValue = pFormField->GetOptionValue(iIndex).c_str();
 						if (FXSYS_wcslen(ElementValue.ToCFXWideString().c_str()) == 0)
-							ElementValue = pFormField->GetOptionLabel(iIndex);
+							ElementValue = pFormField->GetOptionLabel(iIndex).c_str();
 						ValueArray.SetElement(i, ElementValue);
 					}
 					vp << ValueArray;
@@ -3161,7 +3160,7 @@
 				
 					double dRet;
 					FX_BOOL bDot;
-					if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
+					if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
 					{
 						if (bDot)
 							vp << dRet;
@@ -3182,10 +3181,9 @@
 					if (pFormField->GetControl(i)->IsChecked())
 					{
 						CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
-						
 						double dRet;
 						FX_BOOL bDot;
-						if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
+						if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
 						{
 							if (bDot)
 								vp << dRet;
@@ -3391,11 +3389,11 @@
 	if (!pFormControl)return FALSE;
 	
 	if (nface == 0)
-		vRet = pFormControl->GetNormalCaption();
+		vRet = pFormControl->GetNormalCaption().c_str();
 	else if (nface == 1)
-		vRet = pFormControl->GetDownCaption();
+		vRet = pFormControl->GetDownCaption().c_str();
 	else if (nface == 2)
-		vRet = pFormControl->GetRolloverCaption();
+		vRet = pFormControl->GetRolloverCaption().c_str();
 	else
 		return FALSE;
 
@@ -3685,12 +3683,12 @@
 		{
 			CFX_WideString strval = pFormField->GetOptionValue(nIdx);
 			if (strval.IsEmpty())
-				vRet = pFormField->GetOptionLabel(nIdx);
+				vRet = pFormField->GetOptionLabel(nIdx).c_str();
 			else
-				vRet = strval;
+				vRet = strval.c_str();
 		}
 		else
-			vRet = pFormField->GetOptionLabel(nIdx);
+			vRet = pFormField->GetOptionLabel(nIdx).c_str();
 	}
 	else
 		return FALSE;