From d1f843e7473263593fd153f1e3210761c29e5363 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 18 May 2016 15:07:21 -0700 Subject: Remove Release() from CFX_TxtBreak Review-Url: https://codereview.chromium.org/1988393002 --- xfa/fde/cfde_txtedtengine.cpp | 5 +--- xfa/fde/tto/fde_textout.cpp | 4 +--- xfa/fgas/layout/fgas_textbreak.h | 50 ++++++++++++++++++++-------------------- 3 files changed, 27 insertions(+), 32 deletions(-) diff --git a/xfa/fde/cfde_txtedtengine.cpp b/xfa/fde/cfde_txtedtengine.cpp index 9781d60bf8..a99d8087c5 100644 --- a/xfa/fde/cfde_txtedtengine.cpp +++ b/xfa/fde/cfde_txtedtengine.cpp @@ -48,10 +48,7 @@ CFDE_TxtEdtEngine::CFDE_TxtEdtEngine() CFDE_TxtEdtEngine::~CFDE_TxtEdtEngine() { delete m_pTxtBuf; - if (m_pTextBreak) { - m_pTextBreak->Release(); - m_pTextBreak = NULL; - } + delete m_pTextBreak; RemoveAllParags(); RemoveAllPages(); m_Param.pEventSink = NULL; diff --git a/xfa/fde/tto/fde_textout.cpp b/xfa/fde/tto/fde_textout.cpp index ca108de92c..3e14b9bf38 100644 --- a/xfa/fde/tto/fde_textout.cpp +++ b/xfa/fde/tto/fde_textout.cpp @@ -47,9 +47,7 @@ CFDE_TextOut::CFDE_TextOut() m_rtLogicClip.Reset(); } CFDE_TextOut::~CFDE_TextOut() { - if (m_pTxtBreak) { - m_pTxtBreak->Release(); - } + delete m_pTxtBreak; FX_Free(m_pCharWidths); FX_Free(m_pEllCharWidths); FX_Free(m_pCharPos); diff --git a/xfa/fgas/layout/fgas_textbreak.h b/xfa/fgas/layout/fgas_textbreak.h index 6d961f218a..b076f40289 100644 --- a/xfa/fgas/layout/fgas_textbreak.h +++ b/xfa/fgas/layout/fgas_textbreak.h @@ -224,7 +224,6 @@ class CFX_TxtBreak { CFX_TxtBreak(uint32_t dwPolicies); ~CFX_TxtBreak(); - void Release() { delete this; } void SetLineWidth(FX_FLOAT fLineWidth); void SetLinePos(FX_FLOAT fLinePos); uint32_t GetLayoutStyles() const { return m_dwLayoutStyles; } @@ -266,7 +265,31 @@ class CFX_TxtBreak { uint32_t AppendChar_Arabic(CFX_Char* pCurChar, int32_t iRotation); uint32_t AppendChar_Others(CFX_Char* pCurChar, int32_t iRotation); - protected: + private: + void SetBreakStatus(); + int32_t GetLineRotation(uint32_t dwStyles) const; + CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const; + CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const; + CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const; + uint32_t GetUnifiedCharType(uint32_t dwType) const; + void ResetArabicContext(); + void ResetContextCharStyles(); + void EndBreak_UpdateArabicShapes(); + FX_BOOL EndBreak_SplitLine(CFX_TxtLine* pNextLine, + FX_BOOL bAllChars, + uint32_t dwStatus); + void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus); + void EndBreak_Alignment(CFX_TPOArray& tpos, + FX_BOOL bAllChars, + uint32_t dwStatus); + int32_t GetBreakPos(CFX_TxtCharArray& ca, + int32_t& iEndPos, + FX_BOOL bAllChars = FALSE, + FX_BOOL bOnlyBrk = FALSE); + void SplitTextLine(CFX_TxtLine* pCurLine, + CFX_TxtLine* pNextLine, + FX_BOOL bAllChars = FALSE); + uint32_t m_dwPolicies; FX_BOOL m_bPagination; int32_t m_iLineWidth; @@ -306,29 +329,6 @@ class CFX_TxtBreak { int32_t m_iHorScale; int32_t m_iVerScale; int32_t m_iCharSpace; - void SetBreakStatus(); - int32_t GetLineRotation(uint32_t dwStyles) const; - CFX_TxtChar* GetLastChar(int32_t index, FX_BOOL bOmitChar = TRUE) const; - CFX_TxtLine* GetTxtLine(FX_BOOL bReady) const; - CFX_TxtPieceArray* GetTxtPieces(FX_BOOL bReady) const; - uint32_t GetUnifiedCharType(uint32_t dwType) const; - void ResetArabicContext(); - void ResetContextCharStyles(); - void EndBreak_UpdateArabicShapes(); - FX_BOOL EndBreak_SplitLine(CFX_TxtLine* pNextLine, - FX_BOOL bAllChars, - uint32_t dwStatus); - void EndBreak_BidiLine(CFX_TPOArray& tpos, uint32_t dwStatus); - void EndBreak_Alignment(CFX_TPOArray& tpos, - FX_BOOL bAllChars, - uint32_t dwStatus); - int32_t GetBreakPos(CFX_TxtCharArray& ca, - int32_t& iEndPos, - FX_BOOL bAllChars = FALSE, - FX_BOOL bOnlyBrk = FALSE); - void SplitTextLine(CFX_TxtLine* pCurLine, - CFX_TxtLine* pNextLine, - FX_BOOL bAllChars = FALSE); }; #endif // XFA_FGAS_LAYOUT_FGAS_TEXTBREAK_H_ -- cgit v1.2.3