From 51709bea3ce113df7d36a5fe6415036e26fc3236 Mon Sep 17 00:00:00 2001 From: tsepez Date: Thu, 8 Dec 2016 10:55:57 -0800 Subject: Replace CFX_WideStringArray with std::vector Minimalist changes with the tidying of the code to use better loop iterators as a follow-up. Review-Url: https://codereview.chromium.org/2556963004 --- xfa/fde/css/fde_cssstyleselector.cpp | 8 +++++--- xfa/fde/css/fde_cssstyleselector.h | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'xfa/fde/css') diff --git a/xfa/fde/css/fde_cssstyleselector.cpp b/xfa/fde/css/fde_cssstyleselector.cpp index 1bcd161f0c..117afcc7ab 100644 --- a/xfa/fde/css/fde_cssstyleselector.cpp +++ b/xfa/fde/css/fde_cssstyleselector.cpp @@ -9,6 +9,7 @@ #include #include +#include "third_party/base/stl_util.h" #include "xfa/fde/css/fde_csscache.h" #include "xfa/fde/css/fde_cssdeclaration.h" #include "xfa/fde/css/fde_cssstylesheet.h" @@ -1749,7 +1750,8 @@ IFDE_CSSParagraphStyle* CFDE_CSSComputedStyle::GetParagraphStyles() { bool CFDE_CSSComputedStyle::GetCustomStyle(const CFX_WideStringC& wsName, CFX_WideString& wsValue) const { - for (int32_t i = m_CustomProperties.GetSize() - 2; i > -1; i -= 2) { + for (int32_t i = pdfium::CollectionSize(m_CustomProperties) - 2; + i > -1; i -= 2) { if (wsName == m_CustomProperties[i]) { wsValue = m_CustomProperties[i + 1]; return true; @@ -1895,8 +1897,8 @@ void CFDE_CSSComputedStyle::SetLetterSpacing( void CFDE_CSSComputedStyle::AddCustomStyle(const CFX_WideString& wsName, const CFX_WideString& wsValue) { - m_CustomProperties.Add(wsName); - m_CustomProperties.Add(wsValue); + m_CustomProperties.push_back(wsName); + m_CustomProperties.push_back(wsValue); } CFDE_CSSInheritedData::CFDE_CSSInheritedData() { diff --git a/xfa/fde/css/fde_cssstyleselector.h b/xfa/fde/css/fde_cssstyleselector.h index 0096b7a34a..81566a93b1 100644 --- a/xfa/fde/css/fde_cssstyleselector.h +++ b/xfa/fde/css/fde_cssstyleselector.h @@ -414,7 +414,7 @@ class CFDE_CSSComputedStyle : public IFDE_CSSComputedStyle, IFX_MemoryAllocator* const m_pAllocator; CFDE_CSSInheritedData m_InheritedData; CFDE_CSSNonInheritedData m_NonInheritedData; - CFX_WideStringArray m_CustomProperties; + std::vector m_CustomProperties; }; #endif // XFA_FDE_CSS_FDE_CSSSTYLESELECTOR_H_ -- cgit v1.2.3