Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: fpdfsdk/src/javascript/Document.cpp

Issue 1417623005: Add type cast definitions for CPDF_Boolean. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "Document.h" 7 #include "Document.h"
8 8
9 #include "../../../third_party/base/numerics/safe_math.h" 9 #include "../../../third_party/base/numerics/safe_math.h"
10 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment. 10 #include "../../include/fsdk_mgr.h" // For CPDFDoc_Environment.
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 CFX_ByteString bsKey; 848 CFX_ByteString bsKey;
849 CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey); 849 CPDF_Object* pValueObj = pDictionary->GetNextElement(pos, bsKey);
850 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength()); 850 CFX_WideString wsKey = CFX_WideString::FromUTF8(bsKey, bsKey.GetLength());
851 if ((pValueObj->GetType() == PDFOBJ_STRING) || 851 if ((pValueObj->GetType() == PDFOBJ_STRING) ||
852 (pValueObj->GetType() == PDFOBJ_NAME)) 852 (pValueObj->GetType() == PDFOBJ_NAME))
853 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(), 853 FXJS_PutObjectString(isolate, pObj, wsKey.c_str(),
854 pValueObj->GetUnicodeText().c_str()); 854 pValueObj->GetUnicodeText().c_str());
855 if (pValueObj->GetType() == PDFOBJ_NUMBER) 855 if (pValueObj->GetType() == PDFOBJ_NUMBER)
856 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(), 856 FXJS_PutObjectNumber(isolate, pObj, wsKey.c_str(),
857 (float)pValueObj->GetNumber()); 857 (float)pValueObj->GetNumber());
858 if (pValueObj->GetType() == PDFOBJ_BOOLEAN) 858 if (pValueObj->IsBoolean())
Lei Zhang 2015/10/20 20:20:16 nit: add braces while you are here.
dsinclair 2015/10/20 20:38:07 Done.
859 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(), 859 FXJS_PutObjectBoolean(isolate, pObj, wsKey.c_str(),
860 (bool)pValueObj->GetInteger()); 860 (bool)pValueObj->GetInteger());
861 } 861 }
862 vp << pObj; 862 vp << pObj;
863 } 863 }
864 return TRUE; 864 return TRUE;
865 } 865 }
866 866
867 FX_BOOL Document::creationDate(IJS_Context* cc, 867 FX_BOOL Document::creationDate(IJS_Context* cc,
868 CJS_PropValue& vp, 868 CJS_PropValue& vp,
(...skipping 952 matching lines...) Expand 10 before | Expand all | Expand 10 after
1821 CFX_DWordArray DelArray; 1821 CFX_DWordArray DelArray;
1822 1822
1823 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { 1823 for (int j = DelArray.GetSize() - 1; j >= 0; j--) {
1824 m_DelayData.RemoveAt(DelArray[j]); 1824 m_DelayData.RemoveAt(DelArray[j]);
1825 } 1825 }
1826 } 1826 }
1827 1827
1828 CJS_Document* Document::GetCJSDoc() const { 1828 CJS_Document* Document::GetCJSDoc() const {
1829 return static_cast<CJS_Document*>(m_pJSObject); 1829 return static_cast<CJS_Document*>(m_pJSObject);
1830 } 1830 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698