From 4a21114e3a95d3798c5027de33b8e90550fc0eb7 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 1 Mar 2017 14:41:25 -0800 Subject: Use std::deque for CFX_TPOArray They both encompass the same concept: a segmented array that can grow without copying. Change-Id: Ifc02207385b1bc106df41932c7b78ec2e9cc2146 Reviewed-on: https://pdfium-review.googlesource.com/2894 Reviewed-by: dsinclair Commit-Queue: dsinclair --- xfa/fgas/layout/fgas_textbreak.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'xfa/fgas/layout/fgas_textbreak.h') diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index cadfcf12bc..b64a2422eb 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -7,6 +7,7 @@ #ifndef XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ #define XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ +#include #include #include @@ -14,13 +15,13 @@ #include "core/fxge/cfx_renderdevice.h" #include "third_party/base/stl_util.h" #include "xfa/fgas/crt/fgas_utils.h" -#include "xfa/fgas/layout/fgas_unicode.h" class CFX_Char; class CFGAS_GEFont; class CFX_TxtChar; class CFX_TxtPiece; class IFX_TxtAccess; +struct FDE_TEXTEDITPIECE; #define FX_TXTBREAKPOLICY_None 0x00 #define FX_TXTBREAKPOLICY_Pagination 0x01 @@ -74,7 +75,12 @@ class IFX_TxtAccess; #define FX_TXTLINEALIGNMENT_HigherMask 0x0C #define FX_TXTBREAK_MinimumTabWidth 160000 -struct FDE_TEXTEDITPIECE; +struct FX_TPO { + int32_t index; + int32_t pos; + + bool operator<(const FX_TPO& that) const { return pos < that.pos; } +}; class IFX_TxtAccess { public: @@ -252,8 +258,8 @@ class CFX_TxtBreak { bool EndBreak_SplitLine(CFX_TxtLine* pNextLine, bool bAllChars, uint32_t dwStatus); - void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus); - void EndBreak_Alignment(CFX_TPOArray& tpos, + void EndBreak_BidiLine(std::deque* tpos, uint32_t dwStatus); + void EndBreak_Alignment(const std::deque& tpos, bool bAllChars, uint32_t dwStatus); int32_t GetBreakPos(std::vector& ca, -- cgit v1.2.3