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

Side by Side Diff: xfa/src/fxfa/src/parser/xfa_script_resolveprocessor.cpp

Issue 1635853002: XFA: Fix a bunch of pointless returns. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: nits Created 4 years, 10 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
« no previous file with comments | « xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "xfa/src/foxitlib.h" 7 #include "xfa/src/foxitlib.h"
8 #include "xfa/src/fxfa/src/common/xfa_utils.h" 8 #include "xfa/src/fxfa/src/common/xfa_utils.h"
9 #include "xfa/src/fxfa/src/common/xfa_object.h" 9 #include "xfa/src/fxfa/src/common/xfa_object.h"
10 #include "xfa/src/fxfa/src/common/xfa_document.h" 10 #include "xfa/src/fxfa/src/common/xfa_document.h"
(...skipping 697 matching lines...) Expand 10 before | Expand all | Expand 10 after
708 for (int32_t i = iFoundCount - 1; i >= 0; i--) { 708 for (int32_t i = iFoundCount - 1; i >= 0; i--) {
709 CXFA_Object* node = findNodes[i]; 709 CXFA_Object* node = findNodes[i];
710 FX_BOOL bRet = FALSE; 710 FX_BOOL bRet = FALSE;
711 FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime()); 711 FXJSE_HVALUE pRetValue = FXJSE_Value_Create(rnd.m_pSC->GetRuntime());
712 bRet = pContext->RunScript(eLangType, wsExpression, pRetValue, node); 712 bRet = pContext->RunScript(eLangType, wsExpression, pRetValue, node);
713 if (!bRet || !FXJSE_Value_ToBoolean(pRetValue)) { 713 if (!bRet || !FXJSE_Value_ToBoolean(pRetValue)) {
714 findNodes.RemoveAt(i); 714 findNodes.RemoveAt(i);
715 } 715 }
716 FXJSE_Value_Release(pRetValue); 716 FXJSE_Value_Release(pRetValue);
717 } 717 }
718 return;
719 } 718 }
719
720 void CXFA_ResolveProcessor::XFA_ResolveNode_FilterCondition( 720 void CXFA_ResolveProcessor::XFA_ResolveNode_FilterCondition(
721 CXFA_ResolveNodesData& rnd, 721 CXFA_ResolveNodesData& rnd,
722 CFX_WideString wsCondition) { 722 CFX_WideString wsCondition) {
723 CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes; 723 CXFA_NodeArray& findNodes = (CXFA_NodeArray&)rnd.m_Nodes;
724 int32_t iCurrIndex = 0; 724 int32_t iCurrIndex = 0;
725 const CXFA_NodeArray& array = rnd.m_pSC->GetUpObjectArray(); 725 const CXFA_NodeArray& array = rnd.m_pSC->GetUpObjectArray();
726 int32_t iSize = array.GetSize(); 726 int32_t iSize = array.GetSize();
727 if (iSize) { 727 if (iSize) {
728 CXFA_Node* curNode = array[iSize - 1]; 728 CXFA_Node* curNode = array[iSize - 1];
729 FX_BOOL bIsProperty = m_pNodeHelper->XFA_NodeIsProperty(curNode); 729 FX_BOOL bIsProperty = m_pNodeHelper->XFA_NodeIsProperty(curNode);
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
815 if (m_pNodeHelper->XFA_CreateNode_ForCondition(wsNextCondition)) { 815 if (m_pNodeHelper->XFA_CreateNode_ForCondition(wsNextCondition)) {
816 if (m_pNodeHelper->m_eLastCreateType == XFA_ELEMENT_DataGroup) { 816 if (m_pNodeHelper->m_eLastCreateType == XFA_ELEMENT_DataGroup) {
817 iIndex = 0; 817 iIndex = 0;
818 } else { 818 } else {
819 iIndex = iCount - 1; 819 iIndex = iCount - 1;
820 } 820 }
821 } else { 821 } else {
822 iIndex = iCount - 1; 822 iIndex = iCount - 1;
823 } 823 }
824 } 824 }
OLDNEW
« no previous file with comments | « xfa/src/fxfa/src/parser/xfa_layout_itemlayout.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698