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

Unified Diff: xfa/src/fxfa/src/app/xfa_ffdochandler.cpp

Issue 1636873004: XFA: Fix DOS newlines (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: All of them Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_ffdochandler.h ('k') | xfa/src/fxfa/src/app/xfa_ffdocview.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
diff --git a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
index 502da6d14ac0d77dfb50215dd941fc4bc7fc6f5c..c5f6ba6e62816cd82899a1a256d2f65506bd8b64 100644
--- a/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
+++ b/xfa/src/fxfa/src/app/xfa_ffdochandler.cpp
@@ -1,109 +1,109 @@
-// Copyright 2014 PDFium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-
-#include "xfa/src/foxitlib.h"
-#include "xfa/src/fxfa/src/common/xfa_common.h"
-#include "xfa_ffdochandler.h"
-#include "xfa_ffdoc.h"
-CXFA_FFDocHandler::CXFA_FFDocHandler() {}
-CXFA_FFDocHandler::~CXFA_FFDocHandler() {}
-void CXFA_FFDocHandler::ReleaseDoc(IXFA_Doc* hDoc) {
- delete hDoc; // virtual dtor.
-}
-IXFA_DocProvider* CXFA_FFDocHandler::GetDocProvider(IXFA_Doc* hDoc) {
- return static_cast<CXFA_FFDoc*>(hDoc)->GetDocProvider();
-}
-FX_DWORD CXFA_FFDocHandler::GetDocType(IXFA_Doc* hDoc) {
- return static_cast<CXFA_FFDoc*>(hDoc)->GetDocType();
-}
-int32_t CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc) {
- return static_cast<CXFA_FFDoc*>(hDoc)->StartLoad();
-}
-int32_t CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause* pPause) {
- return static_cast<CXFA_FFDoc*>(hDoc)->DoLoad(pPause);
-}
-void CXFA_FFDocHandler::StopLoad(IXFA_Doc* hDoc) {
- static_cast<CXFA_FFDoc*>(hDoc)->StopLoad();
-}
-
-IXFA_DocView* CXFA_FFDocHandler::CreateDocView(IXFA_Doc* hDoc,
- FX_DWORD dwView) {
- return static_cast<CXFA_FFDoc*>(hDoc)->CreateDocView(dwView);
-}
-int32_t CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc) {
- return 0;
-}
-void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc,
- int32_t iPackage,
- CFX_WideStringC& wsPackage) {}
-IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(
- IXFA_Doc* hDoc,
- const CFX_WideStringC& wsPackage) {
- return static_cast<CXFA_FFDoc*>(hDoc)->GetPackageData(wsPackage);
-}
-FX_BOOL CXFA_FFDocHandler::SavePackage(IXFA_Doc* hDoc,
- const CFX_WideStringC& wsPackage,
- IFX_FileWrite* pFile,
- IXFA_ChecksumContext* pCSContext) {
- return static_cast<CXFA_FFDoc*>(hDoc)
- ->SavePackage(wsPackage, pFile, pCSContext);
-}
-FX_BOOL CXFA_FFDocHandler::CloseDoc(IXFA_Doc* hDoc) {
- return static_cast<CXFA_FFDoc*>(hDoc)->CloseDoc();
-}
-
-FX_BOOL CXFA_FFDocHandler::ImportData(IXFA_Doc* hDoc,
- IFX_FileRead* pStream,
- FX_BOOL bXDP) {
- return static_cast<CXFA_FFDoc*>(hDoc)->ImportData(pStream, bXDP);
-}
-void CXFA_FFDocHandler::SetJSERuntime(IXFA_Doc* hDoc, FXJSE_HRUNTIME hRuntime) {
- static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc()->InitScriptContext(hRuntime);
-}
-FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(IXFA_Doc* hDoc) {
- CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
- if (!pXFADoc) {
- return NULL;
- }
- IXFA_ScriptContext* pScriptContext = pXFADoc->GetScriptContext();
- if (!pScriptContext) {
- return NULL;
- }
- return pScriptContext->GetJSValueFromMap(pXFADoc->GetRoot());
-}
-XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(IXFA_Doc* hDoc) {
- CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
- if (!pXFADoc) {
- return XFA_ATTRIBUTEENUM_Unknown;
- }
- CXFA_Node* pForm = (CXFA_Node*)pXFADoc->GetXFANode(XFA_HASHCODE_Form);
- if (!pForm) {
- return XFA_ATTRIBUTEENUM_Unknown;
- }
- CXFA_Node* pSubForm = pForm->GetFirstChildByClass(XFA_ELEMENT_Subform);
- if (!pSubForm) {
- return XFA_ATTRIBUTEENUM_Unknown;
- }
- return pSubForm->GetEnum(XFA_ATTRIBUTE_RestoreState);
-}
-FX_BOOL CXFA_FFDocHandler::RunDocScript(IXFA_Doc* hDoc,
- XFA_SCRIPTTYPE eScriptType,
- const CFX_WideStringC& wsScript,
- FXJSE_HVALUE hRetValue,
- FXJSE_HVALUE hThisObject) {
- CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
- if (!pXFADoc) {
- return FALSE;
- }
- IXFA_ScriptContext* pScriptContext = pXFADoc->GetScriptContext();
- if (!pScriptContext) {
- return FALSE;
- }
- return pScriptContext->RunScript(
- (XFA_SCRIPTLANGTYPE)eScriptType, wsScript, hRetValue,
- hThisObject ? (CXFA_Object*)FXJSE_Value_ToObject(hThisObject, NULL)
- : NULL);
-}
+// Copyright 2014 PDFium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
+
+#include "xfa/src/foxitlib.h"
+#include "xfa/src/fxfa/src/common/xfa_common.h"
+#include "xfa_ffdochandler.h"
+#include "xfa_ffdoc.h"
+CXFA_FFDocHandler::CXFA_FFDocHandler() {}
+CXFA_FFDocHandler::~CXFA_FFDocHandler() {}
+void CXFA_FFDocHandler::ReleaseDoc(IXFA_Doc* hDoc) {
+ delete hDoc; // virtual dtor.
+}
+IXFA_DocProvider* CXFA_FFDocHandler::GetDocProvider(IXFA_Doc* hDoc) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->GetDocProvider();
+}
+FX_DWORD CXFA_FFDocHandler::GetDocType(IXFA_Doc* hDoc) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->GetDocType();
+}
+int32_t CXFA_FFDocHandler::StartLoad(IXFA_Doc* hDoc) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->StartLoad();
+}
+int32_t CXFA_FFDocHandler::DoLoad(IXFA_Doc* hDoc, IFX_Pause* pPause) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->DoLoad(pPause);
+}
+void CXFA_FFDocHandler::StopLoad(IXFA_Doc* hDoc) {
+ static_cast<CXFA_FFDoc*>(hDoc)->StopLoad();
+}
+
+IXFA_DocView* CXFA_FFDocHandler::CreateDocView(IXFA_Doc* hDoc,
+ FX_DWORD dwView) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->CreateDocView(dwView);
+}
+int32_t CXFA_FFDocHandler::CountPackages(IXFA_Doc* hDoc) {
+ return 0;
+}
+void CXFA_FFDocHandler::GetPackageName(IXFA_Doc* hDoc,
+ int32_t iPackage,
+ CFX_WideStringC& wsPackage) {}
+IFDE_XMLElement* CXFA_FFDocHandler::GetPackageData(
+ IXFA_Doc* hDoc,
+ const CFX_WideStringC& wsPackage) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->GetPackageData(wsPackage);
+}
+FX_BOOL CXFA_FFDocHandler::SavePackage(IXFA_Doc* hDoc,
+ const CFX_WideStringC& wsPackage,
+ IFX_FileWrite* pFile,
+ IXFA_ChecksumContext* pCSContext) {
+ return static_cast<CXFA_FFDoc*>(hDoc)
+ ->SavePackage(wsPackage, pFile, pCSContext);
+}
+FX_BOOL CXFA_FFDocHandler::CloseDoc(IXFA_Doc* hDoc) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->CloseDoc();
+}
+
+FX_BOOL CXFA_FFDocHandler::ImportData(IXFA_Doc* hDoc,
+ IFX_FileRead* pStream,
+ FX_BOOL bXDP) {
+ return static_cast<CXFA_FFDoc*>(hDoc)->ImportData(pStream, bXDP);
+}
+void CXFA_FFDocHandler::SetJSERuntime(IXFA_Doc* hDoc, FXJSE_HRUNTIME hRuntime) {
+ static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc()->InitScriptContext(hRuntime);
+}
+FXJSE_HVALUE CXFA_FFDocHandler::GetXFAScriptObject(IXFA_Doc* hDoc) {
+ CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
+ if (!pXFADoc) {
+ return NULL;
+ }
+ IXFA_ScriptContext* pScriptContext = pXFADoc->GetScriptContext();
+ if (!pScriptContext) {
+ return NULL;
+ }
+ return pScriptContext->GetJSValueFromMap(pXFADoc->GetRoot());
+}
+XFA_ATTRIBUTEENUM CXFA_FFDocHandler::GetRestoreState(IXFA_Doc* hDoc) {
+ CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
+ if (!pXFADoc) {
+ return XFA_ATTRIBUTEENUM_Unknown;
+ }
+ CXFA_Node* pForm = (CXFA_Node*)pXFADoc->GetXFANode(XFA_HASHCODE_Form);
+ if (!pForm) {
+ return XFA_ATTRIBUTEENUM_Unknown;
+ }
+ CXFA_Node* pSubForm = pForm->GetFirstChildByClass(XFA_ELEMENT_Subform);
+ if (!pSubForm) {
+ return XFA_ATTRIBUTEENUM_Unknown;
+ }
+ return pSubForm->GetEnum(XFA_ATTRIBUTE_RestoreState);
+}
+FX_BOOL CXFA_FFDocHandler::RunDocScript(IXFA_Doc* hDoc,
+ XFA_SCRIPTTYPE eScriptType,
+ const CFX_WideStringC& wsScript,
+ FXJSE_HVALUE hRetValue,
+ FXJSE_HVALUE hThisObject) {
+ CXFA_Document* pXFADoc = static_cast<CXFA_FFDoc*>(hDoc)->GetXFADoc();
+ if (!pXFADoc) {
+ return FALSE;
+ }
+ IXFA_ScriptContext* pScriptContext = pXFADoc->GetScriptContext();
+ if (!pScriptContext) {
+ return FALSE;
+ }
+ return pScriptContext->RunScript(
+ (XFA_SCRIPTLANGTYPE)eScriptType, wsScript, hRetValue,
+ hThisObject ? (CXFA_Object*)FXJSE_Value_ToObject(hThisObject, NULL)
+ : NULL);
+}
« no previous file with comments | « xfa/src/fxfa/src/app/xfa_ffdochandler.h ('k') | xfa/src/fxfa/src/app/xfa_ffdocview.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698