Chromium Code Reviews| Index: xfa/fxfa/app/xfa_textlayout.h |
| diff --git a/xfa/fxfa/app/xfa_textlayout.h b/xfa/fxfa/app/xfa_textlayout.h |
| index c34f181746e59e09b55635d35d583f9bc42dc667..07d5a8f1dd230bc761ac88e1a19368eb398b3a14 100644 |
| --- a/xfa/fxfa/app/xfa_textlayout.h |
| +++ b/xfa/fxfa/app/xfa_textlayout.h |
| @@ -87,7 +87,7 @@ class CXFA_TextParser { |
| IFDE_CSSComputedStyle* CreateRootStyle(CXFA_TextProvider* pTextProvider); |
| IFDE_CSSComputedStyle* ComputeStyle(CFDE_XMLNode* pXMLNode, |
| IFDE_CSSComputedStyle* pParentStyle); |
| - FX_BOOL IsParsed() const { return m_pAllocator != NULL; } |
| + FX_BOOL IsParsed() const { return !!m_pAllocator; } |
| int32_t GetVAlign(CXFA_TextProvider* pTextProvider) const; |
| FX_FLOAT GetTabInterval(IFDE_CSSComputedStyle* pStyle) const; |
| @@ -134,7 +134,7 @@ class CXFA_TextParser { |
| void ParseTagInfo(CFDE_XMLNode* pXMLNode, CXFA_CSSTagProvider& tagProvider); |
| IFDE_CSSStyleSheet* LoadDefaultSheetStyle(); |
| IFDE_CSSComputedStyle* CreateStyle(IFDE_CSSComputedStyle* pParentStyle); |
| - IFX_MemoryAllocator* m_pAllocator; |
| + std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; |
| std::unique_ptr<CFDE_CSSStyleSelector> m_pSelector; |
| IFDE_CSSStyleSheet* m_pUASheet; |
| CFX_MapPtrTemplate<CFDE_XMLNode*, CXFA_TextParseContext*> |
| @@ -174,10 +174,10 @@ class CXFA_LoaderContext { |
| class CXFA_LinkUserData : public IFX_Unknown, public CFX_Target { |
| public: |
| CXFA_LinkUserData(IFX_MemoryAllocator* pAllocator, FX_WCHAR* pszText) |
| - : m_pAllocator(pAllocator), m_dwRefCount(1) { |
| - m_pszURLContent = pszText; |
| - } |
| - ~CXFA_LinkUserData() {} |
| + : m_pAllocator(pAllocator), m_dwRefCount(1), m_wsURLContent(pszText) {} |
| + |
| + ~CXFA_LinkUserData() override {} |
| + |
| virtual uint32_t Release() { |
| uint32_t dwRefCount = --m_dwRefCount; |
| if (dwRefCount <= 0) { |
| @@ -187,12 +187,12 @@ class CXFA_LinkUserData : public IFX_Unknown, public CFX_Target { |
| } |
| virtual uint32_t AddRef() { return ++m_dwRefCount; } |
| - const FX_WCHAR* GetLinkURL() { return m_pszURLContent.c_str(); } |
| + const FX_WCHAR* GetLinkURL() { return m_wsURLContent.c_str(); } |
| protected: |
| IFX_MemoryAllocator* m_pAllocator; |
| uint32_t m_dwRefCount; |
| - CFX_WideString m_pszURLContent; |
| + CFX_WideString m_wsURLContent; |
| }; |
| class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { |
| @@ -218,7 +218,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { |
| if (m_pStyle) |
| m_pStyle->AddRef(); |
| } |
| - ~CXFA_TextUserData() { |
| + ~CXFA_TextUserData() override { |
| if (m_pStyle) |
| m_pStyle->Release(); |
| if (m_pLinkData) |
| @@ -244,7 +244,7 @@ class CXFA_TextUserData : public IFX_Unknown, public CFX_Target { |
| class XFA_TextPiece : public CFX_Target { |
| public: |
| XFA_TextPiece() : pszText(nullptr), pFont(nullptr), pLinkData(nullptr) {} |
| - ~XFA_TextPiece() { |
| + ~XFA_TextPiece() override { |
| if (pLinkData) |
| pLinkData->Release(); |
| } |
| @@ -323,7 +323,8 @@ class CXFA_TextTabstopsContext { |
| class CXFA_TextLayout { |
| public: |
| CXFA_TextLayout(CXFA_TextProvider* pTextProvider); |
|
Lei Zhang
2016/05/20 23:08:41
explict? no?
Tom Sepez
2016/05/20 23:10:04
Done.
|
| - virtual ~CXFA_TextLayout(); |
| + ~CXFA_TextLayout(); |
| + |
| int32_t GetText(CFX_WideString& wsText); |
| FX_FLOAT GetLayoutHeight(); |
| FX_FLOAT StartLayout(FX_FLOAT fWidth = -1); |
| @@ -409,14 +410,14 @@ class CXFA_TextLayout { |
| CXFA_TextProvider* m_pTextProvider; |
| CXFA_Node* m_pTextDataNode; |
| FX_BOOL m_bRichText; |
| - IFX_MemoryAllocator* m_pAllocator; |
| - CFX_RTFBreak* m_pBreak; |
| - CXFA_LoaderContext* m_pLoader; |
| + std::unique_ptr<IFX_MemoryAllocator> m_pAllocator; |
| + std::unique_ptr<CFX_RTFBreak> m_pBreak; |
| + std::unique_ptr<CXFA_LoaderContext> m_pLoader; |
| int32_t m_iLines; |
| FX_FLOAT m_fMaxWidth; |
| CXFA_TextParser m_textParser; |
| CXFA_PieceLineArray m_pieceLines; |
| - CXFA_TextTabstopsContext* m_pTabstopContext; |
| + std::unique_ptr<CXFA_TextTabstopsContext> m_pTabstopContext; |
| FX_BOOL m_bBlockContinue; |
| }; |