summaryrefslogtreecommitdiff
path: root/fpdfsdk/src/javascript/Document.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-04-27 12:06:58 -0700
committerTom Sepez <tsepez@chromium.org>2015-04-27 12:06:58 -0700
commit4f7bc04ed64edbf72f49b2189f85bb88f0b547c7 (patch)
tree708c0cc04028015e2860f07e8e60780b34137094 /fpdfsdk/src/javascript/Document.cpp
parente5350eff5c5cfe4d01686a4c787d764bde5dd23c (diff)
downloadpdfium-4f7bc04ed64edbf72f49b2189f85bb88f0b547c7.tar.xz
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
Diffstat (limited to 'fpdfsdk/src/javascript/Document.cpp')
-rw-r--r--fpdfsdk/src/javascript/Document.cpp28
1 files changed, 14 insertions, 14 deletions
diff --git a/fpdfsdk/src/javascript/Document.cpp b/fpdfsdk/src/javascript/Document.cpp
index e6bcf82bfc..6396095ede 100644
--- a/fpdfsdk/src/javascript/Document.cpp
+++ b/fpdfsdk/src/javascript/Document.cpp
@@ -370,7 +370,7 @@ FX_BOOL Document::getNthFieldName(IFXJS_Context* cc, const CJS_Parameters& param
if (!pField)
return FALSE;
- vRet = pField->GetFullName();
+ vRet = pField->GetFullName().c_str();
return TRUE;
}
@@ -878,15 +878,15 @@ FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
JSFXObject pObj = JS_NewFxDynamicObj(*pRuntime, pContext, -1);
- JS_PutObjectString(isolate,pObj, L"Author", cwAuthor);
- JS_PutObjectString(isolate,pObj, L"Title", cwTitle);
- JS_PutObjectString(isolate,pObj, L"Subject", cwSubject);
- JS_PutObjectString(isolate,pObj, L"Keywords", cwKeywords);
- JS_PutObjectString(isolate,pObj, L"Creator", cwCreator);
- JS_PutObjectString(isolate,pObj, L"Producer", cwProducer);
- JS_PutObjectString(isolate,pObj, L"CreationDate", cwCreationDate);
- JS_PutObjectString(isolate,pObj, L"ModDate", cwModDate);
- JS_PutObjectString(isolate,pObj, L"Trapped", cwTrapped);
+ JS_PutObjectString(isolate, pObj, L"Author", cwAuthor.c_str());
+ JS_PutObjectString(isolate, pObj, L"Title", cwTitle.c_str());
+ JS_PutObjectString(isolate, pObj, L"Subject", cwSubject.c_str());
+ JS_PutObjectString(isolate, pObj, L"Keywords", cwKeywords.c_str());
+ JS_PutObjectString(isolate, pObj, L"Creator", cwCreator.c_str());
+ JS_PutObjectString(isolate, pObj, L"Producer", cwProducer.c_str());
+ JS_PutObjectString(isolate, pObj, L"CreationDate", cwCreationDate.c_str());
+ JS_PutObjectString(isolate, pObj, L"ModDate", cwModDate.c_str());
+ JS_PutObjectString(isolate, pObj, L"Trapped", cwTrapped.c_str());
// It's to be compatible to non-standard info dictionary.
FX_POSITION pos = pDictionary->GetStartPos();
@@ -896,11 +896,11 @@ FX_BOOL Document::info(IFXJS_Context* cc, CJS_PropValue& vp, CFX_WideString& sEr
CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey);
CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength());
if((pValueObj->GetType()==PDFOBJ_STRING) || (pValueObj->GetType()==PDFOBJ_NAME) )
- JS_PutObjectString(isolate,pObj, wsKey, pValueObj->GetUnicodeText());
+ JS_PutObjectString(isolate, pObj, wsKey.c_str(), pValueObj->GetUnicodeText().c_str());
if(pValueObj->GetType()==PDFOBJ_NUMBER)
- JS_PutObjectNumber(isolate,pObj, wsKey, (float)pValueObj->GetNumber());
+ JS_PutObjectNumber(isolate,pObj, wsKey.c_str(), (float)pValueObj->GetNumber());
if(pValueObj->GetType()==PDFOBJ_BOOLEAN)
- JS_PutObjectBoolean(isolate,pObj, wsKey, (bool)pValueObj->GetInteger());
+ JS_PutObjectBoolean(isolate,pObj, wsKey.c_str(), (bool)pValueObj->GetInteger());
}
vp << pObj;
@@ -1672,7 +1672,7 @@ FX_BOOL Document::getPageNthWord(IFXJS_Context* cc, const CJS_Parameters& params
swRet.TrimRight();
}
- vRet = swRet;
+ vRet = swRet.c_str();
return TRUE;
}