From ef2b74990f4f2a82e279ef5b8a911d89be1e83e2 Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Mon, 20 Nov 2017 20:47:28 +0000 Subject: Convert CXFA_BindItemsData::Get* to return strings This CL changes the CXFA_BindItemsData to return the WideString values instead of taking out params. Change-Id: Ic756da02121c4ce40a123b887cc774045cbfaa8e Reviewed-on: https://pdfium-review.googlesource.com/18811 Reviewed-by: Ryan Harrison Commit-Queue: dsinclair --- xfa/fxfa/cxfa_ffdocview.cpp | 9 +++------ xfa/fxfa/parser/cxfa_binditemsdata.cpp | 12 ++++++------ xfa/fxfa/parser/cxfa_binditemsdata.h | 7 ++++--- 3 files changed, 13 insertions(+), 15 deletions(-) diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 928bc1e0d4..e2a0adcc34 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp @@ -710,8 +710,7 @@ void CXFA_FFDocView::RunBindItems() { CXFA_BindItemsData bindItemsData(item); CFXJSE_Engine* pScriptContext = pWidgetNode->GetDocument()->GetScriptContext(); - WideString wsRef; - bindItemsData.GetRef(wsRef); + WideString wsRef = bindItemsData.GetRef(); uint32_t dwStyle = XFA_RESOLVENODE_Children | XFA_RESOLVENODE_Properties | XFA_RESOLVENODE_Siblings | XFA_RESOLVENODE_Parent | XFA_RESOLVENODE_ALL; @@ -722,10 +721,8 @@ void CXFA_FFDocView::RunBindItems() { if (rs.dwFlags != XFA_RESOLVENODE_RSTYPE_Nodes || rs.objects.empty()) continue; - WideString wsValueRef; - WideString wsLabelRef; - bindItemsData.GetValueRef(wsValueRef); - bindItemsData.GetLabelRef(wsLabelRef); + WideString wsValueRef = bindItemsData.GetValueRef(); + WideString wsLabelRef = bindItemsData.GetLabelRef(); const bool bUseValue = wsLabelRef.IsEmpty() || wsLabelRef == wsValueRef; const bool bLabelUseContent = wsLabelRef.IsEmpty() || wsLabelRef == L"$"; const bool bValueUseContent = wsValueRef.IsEmpty() || wsValueRef == L"$"; diff --git a/xfa/fxfa/parser/cxfa_binditemsdata.cpp b/xfa/fxfa/parser/cxfa_binditemsdata.cpp index 3f0614fd6f..7640314f06 100644 --- a/xfa/fxfa/parser/cxfa_binditemsdata.cpp +++ b/xfa/fxfa/parser/cxfa_binditemsdata.cpp @@ -11,16 +11,16 @@ CXFA_BindItemsData::CXFA_BindItemsData(CXFA_Node* pNode) : CXFA_DataData(pNode) {} -void CXFA_BindItemsData::GetLabelRef(WideString& wsLabelRef) { - wsLabelRef = m_pNode->JSNode()->GetCData(XFA_Attribute::LabelRef); +WideString CXFA_BindItemsData::GetLabelRef() { + return m_pNode->JSNode()->GetCData(XFA_Attribute::LabelRef); } -void CXFA_BindItemsData::GetValueRef(WideString& wsValueRef) { - wsValueRef = m_pNode->JSNode()->GetCData(XFA_Attribute::ValueRef); +WideString CXFA_BindItemsData::GetValueRef() { + return m_pNode->JSNode()->GetCData(XFA_Attribute::ValueRef); } -void CXFA_BindItemsData::GetRef(WideString& wsRef) { - wsRef = m_pNode->JSNode()->GetCData(XFA_Attribute::Ref); +WideString CXFA_BindItemsData::GetRef() { + return m_pNode->JSNode()->GetCData(XFA_Attribute::Ref); } bool CXFA_BindItemsData::SetConnection(const WideString& wsConnection) { diff --git a/xfa/fxfa/parser/cxfa_binditemsdata.h b/xfa/fxfa/parser/cxfa_binditemsdata.h index f9b506a993..4e59fa1657 100644 --- a/xfa/fxfa/parser/cxfa_binditemsdata.h +++ b/xfa/fxfa/parser/cxfa_binditemsdata.h @@ -16,9 +16,10 @@ class CXFA_BindItemsData : public CXFA_DataData { public: explicit CXFA_BindItemsData(CXFA_Node* pNode); - void GetLabelRef(WideString& wsLabelRef); - void GetValueRef(WideString& wsValueRef); - void GetRef(WideString& wsRef); + WideString GetLabelRef(); + WideString GetValueRef(); + WideString GetRef(); + bool SetConnection(const WideString& wsConnection); }; -- cgit v1.2.3