summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Field.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-27 11:31:26 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-27 11:31:26 -0700
commitf7a7d7e07396c3a0fae617ed8f15f29fd491bc3a (patch)
tree53e22c58375eb36abe97f5b8f2631b4eba111fbc /fpdfsdk/src/javascript/Field.cpp
parent15a62973b9b89c3e229cc0ab501c45967f91b325 (diff)
downloadpdfium-f7a7d7e07396c3a0fae617ed8f15f29fd491bc3a.tar.xz
Revert "Kill operator LPCWSTR from CFX_WideString()."
This reverts commit 15a62973b9b89c3e229cc0ab501c45967f91b325. Reason for revert: broke build on windows, mac. I must have missed some platform-specific conversions. TBR=brucedawson@chromium.org Review URL: https://codereview.chromium.org/1108883002
Diffstat (limited to 'fpdfsdk/src/javascript/Field.cpp')
-rw-r--r--fpdfsdk/src/javascript/Field.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/fpdfsdk/src/javascript/Field.cpp b/fpdfsdk/src/javascript/Field.cpp
index 7476fa5728..e5572da3e6 100644
--- a/fpdfsdk/src/javascript/Field.cpp
+++ b/fpdfsdk/src/javascript/Field.cpp
@@ -11,6 +11,7 @@
#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"
@@ -258,7 +259,7 @@ void Field::UpdateFormField(CPDFSDK_Document* pDocument, CPDF_FormField* pFormFi
FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
if (bFormated)
- pWidget->ResetAppearance(sValue.c_str(), FALSE);
+ pWidget->ResetAppearance(sValue, FALSE);
else
pWidget->ResetAppearance(NULL, FALSE);
}
@@ -315,7 +316,7 @@ void Field::UpdateFormControl(CPDFSDK_Document* pDocument, CPDF_FormControl* pFo
FX_BOOL bFormated = FALSE;
CFX_WideString sValue = pWidget->OnFormat(0, bFormated);
if (bFormated)
- pWidget->ResetAppearance(sValue.c_str(), FALSE);
+ pWidget->ResetAppearance(sValue, FALSE);
else
pWidget->ResetAppearance(NULL, FALSE);
}
@@ -3126,7 +3127,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
double dRet;
FX_BOOL bDot;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
{
if (bDot)
vp << dRet;
@@ -3147,9 +3148,9 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
for (int i = 0, sz = pFormField->CountSelectedItems(); i < sz; i++)
{
iIndex = pFormField->GetSelectedIndex(i);
- ElementValue = pFormField->GetOptionValue(iIndex).c_str();
+ ElementValue = pFormField->GetOptionValue(iIndex);
if (FXSYS_wcslen(ElementValue.ToCFXWideString().c_str()) == 0)
- ElementValue = pFormField->GetOptionLabel(iIndex).c_str();
+ ElementValue = pFormField->GetOptionLabel(iIndex);
ValueArray.SetElement(i, ElementValue);
}
vp << ValueArray;
@@ -3160,7 +3161,7 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
double dRet;
FX_BOOL bDot;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
{
if (bDot)
vp << dRet;
@@ -3181,9 +3182,10 @@ FX_BOOL Field::value(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sErro
if (pFormField->GetControl(i)->IsChecked())
{
CFX_WideString swValue = pFormField->GetControl(i)->GetExportValue();
+
double dRet;
FX_BOOL bDot;
- if (CJS_PublicMethods::ConvertStringToNumber(swValue.c_str(), dRet, bDot))
+ if (CJS_PublicMethods::ConvertStringToNumber(swValue,dRet,bDot))
{
if (bDot)
vp << dRet;
@@ -3389,11 +3391,11 @@ FX_BOOL Field::buttonGetCaption(IFXJS_Context* cc, const CJS_Parameters& params,
if (!pFormControl)return FALSE;
if (nface == 0)
- vRet = pFormControl->GetNormalCaption().c_str();
+ vRet = pFormControl->GetNormalCaption();
else if (nface == 1)
- vRet = pFormControl->GetDownCaption().c_str();
+ vRet = pFormControl->GetDownCaption();
else if (nface == 2)
- vRet = pFormControl->GetRolloverCaption().c_str();
+ vRet = pFormControl->GetRolloverCaption();
else
return FALSE;
@@ -3683,12 +3685,12 @@ FX_BOOL Field::getItemAt(IFXJS_Context* cc, const CJS_Parameters& params, CJS_Va
{
CFX_WideString strval = pFormField->GetOptionValue(nIdx);
if (strval.IsEmpty())
- vRet = pFormField->GetOptionLabel(nIdx).c_str();
+ vRet = pFormField->GetOptionLabel(nIdx);
else
- vRet = strval.c_str();
+ vRet = strval;
}
else
- vRet = pFormField->GetOptionLabel(nIdx).c_str();
+ vRet = pFormField->GetOptionLabel(nIdx);
}
else
return FALSE;