diff options
author | tsepez <tsepez@chromium.org> | 2016-04-14 15:46:27 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-04-14 15:46:27 -0700 |
commit | 6f167c3ea2f8093170cae12a3de4ded76ac521ce (patch) | |
tree | 76ad1435272c22f677b4af2ec6b246d604aef3ce /xfa/fxfa/parser/cxfa_widgetdata.cpp | |
parent | 70c5520270ab41b71e8ae8d2e888b9ba25383190 (diff) | |
download | pdfium-6f167c3ea2f8093170cae12a3de4ded76ac521ce.tar.xz |
Change string argument type to GetFormatDataValue.
Avoid string duplication, since the first thing these routines
do is allocate a new string from the static string argument.
Review URL: https://codereview.chromium.org/1889983002
Diffstat (limited to 'xfa/fxfa/parser/cxfa_widgetdata.cpp')
-rw-r--r-- | xfa/fxfa/parser/cxfa_widgetdata.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/xfa/fxfa/parser/cxfa_widgetdata.cpp b/xfa/fxfa/parser/cxfa_widgetdata.cpp index 16380011fe..e75eef8916 100644 --- a/xfa/fxfa/parser/cxfa_widgetdata.cpp +++ b/xfa/fxfa/parser/cxfa_widgetdata.cpp @@ -820,7 +820,7 @@ void CXFA_WidgetData::SetItemState(int32_t nIndex, if (iSel < 0) { CFX_WideString wsSaveText = wsSaveTextArray[nIndex]; CFX_WideString wsFormatText(wsSaveText); - GetFormatDataValue(wsSaveText.AsStringC(), wsFormatText); + GetFormatDataValue(wsSaveText, wsFormatText); m_pNode->SetContent(wsSaveText, wsFormatText, bNotify, bScriptModify, bSyncData); } @@ -850,7 +850,7 @@ void CXFA_WidgetData::SetSelectedItems(CFX_Int32Array& iSelArray, } CFX_WideString wsFormat(wsValue); if (GetChoiceListOpen() != XFA_ATTRIBUTEENUM_MultiSelect) - GetFormatDataValue(wsValue.AsStringC(), wsFormat); + GetFormatDataValue(wsValue, wsFormat); m_pNode->SetContent(wsValue, wsFormat, bNotify, bScriptModify, bSyncData); } @@ -1559,7 +1559,7 @@ FX_BOOL CXFA_WidgetData::GetValue(CFX_WideString& wsValue, } FX_BOOL CXFA_WidgetData::GetNormalizeDataValue( - const CFX_WideStringC& wsValue, + const CFX_WideString& wsValue, CFX_WideString& wsNormalizeValue) { wsNormalizeValue = wsValue; if (wsValue.IsEmpty()) @@ -1583,7 +1583,7 @@ FX_BOOL CXFA_WidgetData::GetNormalizeDataValue( return FALSE; } -FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideStringC& wsValue, +FX_BOOL CXFA_WidgetData::GetFormatDataValue(const CFX_WideString& wsValue, CFX_WideString& wsFormatedValue) { wsFormatedValue = wsValue; if (wsValue.IsEmpty()) @@ -1738,8 +1738,7 @@ void CXFA_WidgetData::SyncValue(const CFX_WideString& wsValue, CFX_WideString wsFormatValue(wsValue); CXFA_WidgetData* pContainerWidgetData = m_pNode->GetContainerWidgetData(); if (pContainerWidgetData) - pContainerWidgetData->GetFormatDataValue(wsValue.AsStringC(), - wsFormatValue); + pContainerWidgetData->GetFormatDataValue(wsValue, wsFormatValue); m_pNode->SetContent(wsValue, wsFormatValue, bNotify); } |