diff options
author | tsepez <tsepez@chromium.org> | 2016-04-14 15:32:35 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-14 15:32:35 -0700 |
commit | 70c5520270ab41b71e8ae8d2e888b9ba25383190 (patch) | |
tree | edfa22ea2a5eec835fa13394b034b416fe58312d /xfa/fxfa/app/xfa_ffdocview.cpp | |
parent | ff242e0b62173718a6e98aee1306ac48f6372572 (diff) | |
download | pdfium-70c5520270ab41b71e8ae8d2e888b9ba25383190.tar.xz |
Pass CFX_WideString to CXFA_FFDocView::GetWidgetByName.
Avoids downgrade followed by duplication of existing strings.
Review URL: https://codereview.chromium.org/1891673003
Diffstat (limited to 'xfa/fxfa/app/xfa_ffdocview.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_ffdocview.cpp | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/xfa/fxfa/app/xfa_ffdocview.cpp b/xfa/fxfa/app/xfa_ffdocview.cpp index daa5fd6277..4f818e0dd7 100644 --- a/xfa/fxfa/app/xfa_ffdocview.cpp +++ b/xfa/fxfa/app/xfa_ffdocview.cpp @@ -491,25 +491,25 @@ int32_t CXFA_FFDocView::ExecEventActivityByDeepFirst(CXFA_Node* pFormNode, iRet |= XFA_ProcessEvent(this, pWidgetAcc, &eParam); return iRet; } -CXFA_FFWidget* CXFA_FFDocView::GetWidgetByName(const CFX_WideStringC& wsName, + +CXFA_FFWidget* CXFA_FFDocView::GetWidgetByName(const CFX_WideString& wsName, CXFA_FFWidget* pRefWidget) { - CXFA_WidgetAcc* pRefAcc = pRefWidget ? pRefWidget->GetDataAcc() : NULL; - if (CXFA_WidgetAcc* pAcc = GetWidgetAccByName(wsName, pRefAcc)) { - return pAcc->GetNextWidget(NULL); - } - return NULL; + CXFA_WidgetAcc* pRefAcc = pRefWidget ? pRefWidget->GetDataAcc() : nullptr; + CXFA_WidgetAcc* pAcc = GetWidgetAccByName(wsName, pRefAcc); + return pAcc ? pAcc->GetNextWidget(nullptr) : nullptr; } + CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName( - const CFX_WideStringC& wsName, + const CFX_WideString& wsName, CXFA_WidgetAcc* pRefWidgetAcc) { CFX_WideString wsExpression; uint32_t dwStyle = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent; CXFA_ScriptContext* pScriptContext = m_pDoc->GetXFADoc()->GetScriptContext(); if (!pScriptContext) { - return NULL; + return nullptr; } - CXFA_Node* refNode = NULL; + CXFA_Node* refNode = nullptr; if (pRefWidgetAcc) { refNode = pRefWidgetAcc->GetNode(); wsExpression = wsName; @@ -520,7 +520,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName( int32_t iRet = pScriptContext->ResolveObjects( refNode, wsExpression.AsStringC(), resoveNodeRS, dwStyle); if (iRet < 1) { - return NULL; + return nullptr; } if (resoveNodeRS.dwFlags == XFA_RESOVENODE_RSTYPE_Nodes) { CXFA_Node* pNode = resoveNodeRS.nodes[0]->AsNode(); @@ -528,7 +528,7 @@ CXFA_WidgetAcc* CXFA_FFDocView::GetWidgetAccByName( return (CXFA_WidgetAcc*)pNode->GetWidgetData(); } } - return NULL; + return nullptr; } void CXFA_FFDocView::OnPageEvent(CXFA_ContainerLayoutItem* pSender, |