 Chromium Code Reviews
 Chromium Code Reviews Issue 1959253002:
  Remove unneeded CPVT classes. (try 2)  (Closed) 
  Base URL: https://pdfium.googlesource.com/pdfium@master
    
  
    Issue 1959253002:
  Remove unneeded CPVT classes. (try 2)  (Closed) 
  Base URL: https://pdfium.googlesource.com/pdfium@master| Index: core/fpdfdoc/csection.h | 
| diff --git a/core/fpdfdoc/csection.h b/core/fpdfdoc/csection.h | 
| index d8974cb02010af0e1ec1f92808d16f8adcb7abc1..43d7c66a1933c6a4286e911253c7eddca3e06b1d 100644 | 
| --- a/core/fpdfdoc/csection.h | 
| +++ b/core/fpdfdoc/csection.h | 
| @@ -7,8 +7,10 @@ | 
| #ifndef CORE_FPDFDOC_CSECTION_H_ | 
| #define CORE_FPDFDOC_CSECTION_H_ | 
| +#include <memory> | 
| +#include <vector> | 
| + | 
| #include "core/fpdfdoc/cpvt_sectioninfo.h" | 
| -#include "core/fpdfdoc/ctypeset.h" | 
| #include "core/fxcrt/include/fx_coordinates.h" | 
| #include "core/fxcrt/include/fx_system.h" | 
| @@ -21,7 +23,8 @@ struct CPVT_WordPlace; | 
| class CSection { | 
| public: | 
| explicit CSection(CPDF_VariableText* pVT); | 
| - virtual ~CSection(); | 
| + ~CSection(); | 
| + | 
| void ResetAll(); | 
| void ResetLineArray(); | 
| void ResetWordArray(); | 
| @@ -32,7 +35,7 @@ class CSection { | 
| void ClearWords(const CPVT_WordRange& PlaceRange); | 
| void ClearWord(const CPVT_WordPlace& place); | 
| CPVT_FloatRect Rearrange(); | 
| - CPVT_Size GetSectionSize(FX_FLOAT fFontSize); | 
| + CFX_PointF GetSectionSize(FX_FLOAT fFontSize); | 
| CPVT_WordPlace GetBeginWordPlace() const; | 
| CPVT_WordPlace GetEndWordPlace() const; | 
| CPVT_WordPlace GetPrevWordPlace(const CPVT_WordPlace& place) const; | 
| @@ -43,20 +46,24 @@ class CSection { | 
| const CPVT_WordPlace& lineplace) const; | 
| CPVT_WordPlace SearchWordPlace(FX_FLOAT fx, | 
| const CPVT_WordRange& range) const; | 
| + void ClearLeftWords(int32_t nWordIndex); | 
| + void ClearRightWords(int32_t nWordIndex); | 
| 
dsinclair
2016/05/16 14:12:27
ClearWordsBefore and ClearWordsAfter?
 | 
| + void ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex); | 
| 
dsinclair
2016/05/16 14:12:27
ClearWordsBetween?
 | 
| + | 
| + CPDF_VariableText* GetVT() { return m_pVT; } | 
| 
dsinclair
2016/05/16 14:12:27
nit: s/GetVT/GetVariableText
 | 
| + | 
| + bool IsWordArrayEmpty() const; | 
| + int32_t GetNumberOfWords() const; | 
| + const CPVT_WordInfo* GetWord(int32_t index) const; | 
| + CPVT_WordInfo* GetWord(int32_t index); | 
| CPVT_WordPlace SecPlace; | 
| 
dsinclair
2016/05/16 14:12:27
Can these be private now?
 | 
| CPVT_SectionInfo m_SecInfo; | 
| CLines m_LineArray; | 
| - CPVT_ArrayTemplate<CPVT_WordInfo*> m_WordArray; | 
| private: | 
| - friend class CTypeset; | 
| - | 
| - void ClearLeftWords(int32_t nWordIndex); | 
| - void ClearRightWords(int32_t nWordIndex); | 
| - void ClearMidWords(int32_t nBeginIndex, int32_t nEndIndex); | 
| - | 
| - CPDF_VariableText* m_pVT; | 
| + std::vector<std::unique_ptr<CPVT_WordInfo>> m_WordArray; | 
| + CPDF_VariableText* const m_pVT; | 
| 
dsinclair
2016/05/16 14:12:27
nit: s/m_pVT/m_pVariableText ?
 | 
| }; | 
| #endif // CORE_FPDFDOC_CSECTION_H_ |