diff options
author | Tom Sepez <tsepez@chromium.org> | 2016-03-22 16:05:18 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2016-03-22 16:05:18 -0700 |
commit | 3523c1f23e4c48850fcba5b1cb1bd8f311407e00 (patch) | |
tree | 3ff2258be9aa8c5ec145d77e6bb35a684e6986e5 /xfa/fxfa | |
parent | 34cc08341b5712c17b504a55aa090eaa59051890 (diff) | |
download | pdfium-3523c1f23e4c48850fcba5b1cb1bd8f311407e00.tar.xz |
Fix parsing of double dot operators for FormCalc
Patch by cherycherian.
patch from issue 1810153003 at patchset 1 (http://crrev.com/1810153003#ps1)
FormCalc expressions containing double-dot operators in SOM expressions
were failing since XFA_ResolveNodes_AnyChild was always stripping the
leading character.
Roll testing/corpus to d671154 to pick up the test.
BUG=pdfium:434
TBR=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1821413002 .
Diffstat (limited to 'xfa/fxfa')
-rw-r--r-- | xfa/fxfa/parser/xfa_script_resolveprocessor.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp index b40d714ec9..cb5c039f75 100644 --- a/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp +++ b/xfa/fxfa/parser/xfa_script_resolveprocessor.cpp @@ -52,6 +52,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) { return XFA_ResolveNodes_NumberSign(rnd); case '*': return XFA_ResolveNodes_Asterisk(rnd); + // TODO(dsinclair@chromium.org): We could probably remove this. case '.': return XFA_ResolveNodes_AnyChild(rnd); default: @@ -85,7 +86,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes(CXFA_ResolveNodesData& rnd) { } int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_AnyChild( CXFA_ResolveNodesData& rnd) { - CFX_WideString wsName = rnd.m_wsName.Right(rnd.m_wsName.GetLength() - 1); + CFX_WideString wsName = rnd.m_wsName; CFX_WideString wsCondition = rnd.m_wsCondition; CXFA_Node* findNode = NULL; CXFA_NodeArray siblings; @@ -546,7 +547,7 @@ int32_t CXFA_ResolveProcessor::XFA_ResolveNodes_GetFilter( continue; } if (nNameCount == 0) { - pNameBuf[nNameCount++] = wCur; + rnd.m_dwStyles |= XFA_RESOLVENODE_AnyChild; continue; } FX_WCHAR wLookahead = nStart < iLength ? pSrc[nStart] : 0; |