summaryrefslogtreecommitdiff
path: root/xfa/fgas/layout/fgas_rtfbreak.h
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-07 16:03:17 -0500
committerChromium commit bot <commit-bot@chromium.org>2017-03-08 13:44:54 +0000
commitf7fccbd0da7ac700e1342e18b2bd1fa82438f3fc (patch)
treeddb1da15fd6935ead6a825048bacd6f647c31657 /xfa/fgas/layout/fgas_rtfbreak.h
parent7b8e8c0cdd1bdc67a61e167883c72ad672529b84 (diff)
downloadpdfium-f7fccbd0da7ac700e1342e18b2bd1fa82438f3fc.tar.xz
Remove CFX_RTFPieceArray and use std::vector
This CL removes the CFX_RTFPieceArray typedef and updates the code to use a std::vector. Change-Id: I885038d432e700830958e37b8c03c5beceff012f Reviewed-on: https://pdfium-review.googlesource.com/2936 Reviewed-by: Nicolás Peña <npm@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org> Commit-Queue: dsinclair <dsinclair@chromium.org>
Diffstat (limited to 'xfa/fgas/layout/fgas_rtfbreak.h')
-rw-r--r--xfa/fgas/layout/fgas_rtfbreak.h25
1 files changed, 5 insertions, 20 deletions
diff --git a/xfa/fgas/layout/fgas_rtfbreak.h b/xfa/fgas/layout/fgas_rtfbreak.h
index 835430e919..125b06fe95 100644
--- a/xfa/fgas/layout/fgas_rtfbreak.h
+++ b/xfa/fgas/layout/fgas_rtfbreak.h
@@ -48,6 +48,7 @@ struct FX_RTFTEXTOBJ {
class CFX_RTFPiece {
public:
CFX_RTFPiece();
+ CFX_RTFPiece(const CFX_RTFPiece& other);
~CFX_RTFPiece();
int32_t GetEndPos() const {
@@ -75,20 +76,6 @@ class CFX_RTFPiece {
return ret;
}
- void Reset() {
- m_dwStatus = CFX_RTFBreakType::Piece;
- if (m_iWidth > -1)
- m_iStartPos += m_iWidth;
-
- m_iWidth = -1;
- m_iStartChar += m_iChars;
- m_iChars = 0;
- m_iBidiLevel = 0;
- m_iBidiPos = 0;
- m_iHorizontalScale = 100;
- m_iVerticalScale = 100;
- }
-
CFX_RTFBreakType m_dwStatus;
int32_t m_iStartPos;
int32_t m_iWidth;
@@ -105,8 +92,6 @@ class CFX_RTFPiece {
CFX_RetainPtr<CFX_Retainable> m_pUserData;
};
-typedef CFX_BaseArrayTemplate<CFX_RTFPiece> CFX_RTFPieceArray;
-
class CFX_RTFLine {
public:
CFX_RTFLine();
@@ -122,15 +107,15 @@ class CFX_RTFLine {
}
int32_t GetLineEnd() const { return m_iStart + m_iWidth; }
- void RemoveAll(bool bLeaveMemory) {
+ void Clear() {
m_LineChars.clear();
- m_LinePieces.RemoveAll(bLeaveMemory);
+ m_LinePieces.clear();
m_iWidth = 0;
m_iArabicChars = 0;
}
std::vector<CFX_RTFChar> m_LineChars;
- CFX_RTFPieceArray m_LinePieces;
+ std::vector<CFX_RTFPiece> m_LinePieces;
int32_t m_iStart;
int32_t m_iWidth;
int32_t m_iArabicChars;
@@ -157,7 +142,7 @@ class CFX_RTFBreak {
CFX_RTFBreakType EndBreak(CFX_RTFBreakType dwStatus);
int32_t CountBreakPieces() const;
- const CFX_RTFPiece* GetBreakPiece(int32_t index) const;
+ const CFX_RTFPiece* GetBreakPieceUnstable(int32_t index) const;
void ClearBreakPieces();
void Reset();