From 6e59fb5fda71eb527568a58d9c948b5f76c9bdc2 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 18 Jan 2018 19:03:58 +0000 Subject: Remove more unneeded includes and code from headers. Change-Id: I0a07dbc9850bef2184ed35ff04b08385fc1bdd17 Reviewed-on: https://pdfium-review.googlesource.com/22891 Commit-Queue: Lei Zhang Reviewed-by: dsinclair --- xfa/fgas/font/cfgas_fontmgr.h | 4 ++-- xfa/fgas/font/cfgas_gefont.h | 1 - xfa/fgas/layout/cfx_break.cpp | 1 + xfa/fgas/layout/cfx_break.h | 3 ++- xfa/fgas/layout/cfx_rtfbreak.cpp | 1 + xfa/fgas/layout/cfx_rtfbreak.h | 2 +- xfa/fwl/cfwl_themebackground.h | 1 - xfa/fwl/cfwl_widget.h | 2 +- xfa/fwl/ifwl_themeprovider.h | 3 ++- xfa/fwl/theme/cfwl_widgettp.cpp | 8 ++++++++ xfa/fwl/theme/cfwl_widgettp.h | 7 +++---- xfa/fxfa/cxfa_ffapp.h | 9 +++++---- xfa/fxfa/cxfa_textlayout.cpp | 1 + xfa/fxfa/cxfa_textlayout.h | 9 +++++---- xfa/fxfa/cxfa_textparser.h | 2 +- xfa/fxfa/cxfa_textpiece.cpp | 1 + xfa/fxfa/cxfa_textpiece.h | 2 +- 17 files changed, 35 insertions(+), 22 deletions(-) (limited to 'xfa') diff --git a/xfa/fgas/font/cfgas_fontmgr.h b/xfa/fgas/font/cfgas_fontmgr.h index 94e446c077..445b318a26 100644 --- a/xfa/fgas/font/cfgas_fontmgr.h +++ b/xfa/fgas/font/cfgas_fontmgr.h @@ -18,13 +18,13 @@ #include "core/fxcrt/fx_extension.h" #include "core/fxcrt/observable.h" #include "core/fxcrt/retain_ptr.h" -#include "core/fxge/cfx_fontmapper.h" #include "core/fxge/fx_freetype.h" #include "core/fxge/ifx_systemfontinfo.h" #include "xfa/fgas/font/cfgas_pdffontmgr.h" -class CFX_FontSourceEnum_File; class CFGAS_GEFont; +class CFX_FontMapper; +class CFX_FontSourceEnum_File; #if _FX_PLATFORM_ == _FX_PLATFORM_WINDOWS_ struct FX_FONTMATCHPARAMS { diff --git a/xfa/fgas/font/cfgas_gefont.h b/xfa/fgas/font/cfgas_gefont.h index d14554758b..646562d9ee 100644 --- a/xfa/fgas/font/cfgas_gefont.h +++ b/xfa/fgas/font/cfgas_gefont.h @@ -18,7 +18,6 @@ #include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fgas/font/cfgas_pdffontmgr.h" -class CFGAS_FontMgr; class CFX_UnicodeEncoding; class CFGAS_GEFont : public Retainable { diff --git a/xfa/fgas/layout/cfx_break.cpp b/xfa/fgas/layout/cfx_break.cpp index 6e1103cf65..0f52a2d274 100644 --- a/xfa/fgas/layout/cfx_break.cpp +++ b/xfa/fgas/layout/cfx_break.cpp @@ -10,6 +10,7 @@ #include #include "third_party/base/stl_util.h" +#include "xfa/fgas/font/cfgas_gefont.h" namespace { diff --git a/xfa/fgas/layout/cfx_break.h b/xfa/fgas/layout/cfx_break.h index 322fa2be8e..789220d9da 100644 --- a/xfa/fgas/layout/cfx_break.h +++ b/xfa/fgas/layout/cfx_break.h @@ -10,9 +10,10 @@ #include #include "core/fxcrt/retain_ptr.h" -#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fgas/layout/cfx_breakline.h" +class CFGAS_GEFont; + struct FX_TPO { bool operator<(const FX_TPO& that) const { return pos < that.pos; } diff --git a/xfa/fgas/layout/cfx_rtfbreak.cpp b/xfa/fgas/layout/cfx_rtfbreak.cpp index 761bd2fc03..3ef0ef2624 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.cpp +++ b/xfa/fgas/layout/cfx_rtfbreak.cpp @@ -10,6 +10,7 @@ #include "core/fxcrt/fx_arabic.h" #include "core/fxcrt/fx_bidi.h" +#include "core/fxge/cfx_renderdevice.h" #include "third_party/base/stl_util.h" #include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fgas/layout/cfx_linebreak.h" diff --git a/xfa/fgas/layout/cfx_rtfbreak.h b/xfa/fgas/layout/cfx_rtfbreak.h index 5a3f4313b5..67052d23ad 100644 --- a/xfa/fgas/layout/cfx_rtfbreak.h +++ b/xfa/fgas/layout/cfx_rtfbreak.h @@ -13,11 +13,11 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_unicode.h" #include "core/fxcrt/retain_ptr.h" -#include "core/fxge/cfx_renderdevice.h" #include "xfa/fgas/layout/cfx_break.h" #include "xfa/fxfa/cxfa_textuserdata.h" class CFGAS_GEFont; +class FXTEXT_CHARPOS; enum class CFX_RTFLineAlignment { Left = 0, diff --git a/xfa/fwl/cfwl_themebackground.h b/xfa/fwl/cfwl_themebackground.h index 33a0e857f2..85435aa524 100644 --- a/xfa/fwl/cfwl_themebackground.h +++ b/xfa/fwl/cfwl_themebackground.h @@ -7,7 +7,6 @@ #ifndef XFA_FWL_CFWL_THEMEBACKGROUND_H_ #define XFA_FWL_CFWL_THEMEBACKGROUND_H_ -#include "core/fxge/fx_dib.h" #include "xfa/fwl/cfwl_themepart.h" class CXFA_Graphics; diff --git a/xfa/fwl/cfwl_widget.h b/xfa/fwl/cfwl_widget.h index f4ff63ea29..27cb458b9e 100644 --- a/xfa/fwl/cfwl_widget.h +++ b/xfa/fwl/cfwl_widget.h @@ -12,7 +12,7 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/unowned_ptr.h" -#include "xfa/fde/cfde_textout.h" +#include "xfa/fde/cfde_data.h" #include "xfa/fwl/cfwl_event.h" #include "xfa/fwl/cfwl_themepart.h" #include "xfa/fwl/cfwl_widgetmgr.h" diff --git a/xfa/fwl/ifwl_themeprovider.h b/xfa/fwl/ifwl_themeprovider.h index 32dc901377..eba308597c 100644 --- a/xfa/fwl/ifwl_themeprovider.h +++ b/xfa/fwl/ifwl_themeprovider.h @@ -9,8 +9,9 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/retain_ptr.h" -#include "xfa/fgas/font/cfgas_gefont.h" +#include "core/fxge/fx_dib.h" +class CFGAS_GEFont; class CFWL_ThemeBackground; class CFWL_ThemePart; class CFWL_ThemeText; diff --git a/xfa/fwl/theme/cfwl_widgettp.cpp b/xfa/fwl/theme/cfwl_widgettp.cpp index 8a2754b4ad..3113d24546 100644 --- a/xfa/fwl/theme/cfwl_widgettp.cpp +++ b/xfa/fwl/theme/cfwl_widgettp.cpp @@ -57,6 +57,10 @@ void CFWL_WidgetTP::DrawText(CFWL_ThemeText* pParams) { pParams->m_rtPart); } +const RetainPtr& CFWL_WidgetTP::GetFont() const { + return m_pFDEFont; +} + void CFWL_WidgetTP::InitializeArrowColorData() { if (m_pColorData) return; @@ -286,6 +290,10 @@ bool CFWL_FontData::LoadFont(const WideStringView& wsFontFamily, return !!m_pFont; } +RetainPtr CFWL_FontData::GetFont() const { + return m_pFont; +} + CFWL_FontManager* CFWL_FontManager::s_FontManager = nullptr; CFWL_FontManager* CFWL_FontManager::GetInstance() { if (!s_FontManager) diff --git a/xfa/fwl/theme/cfwl_widgettp.h b/xfa/fwl/theme/cfwl_widgettp.h index 5f143fe7d9..7813c0825c 100644 --- a/xfa/fwl/theme/cfwl_widgettp.h +++ b/xfa/fwl/theme/cfwl_widgettp.h @@ -13,16 +13,15 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" -#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fwl/theme/cfwl_utils.h" #include "xfa/fxgraphics/cxfa_graphics.h" class CFDE_TextOut; +class CFGAS_FontMgr; class CFGAS_GEFont; class CFWL_ThemeBackground; class CFWL_ThemePart; class CFWL_ThemeText; -class CFGAS_FontMgr; class CFWL_Widget; #if _FX_PLATFORM_ != _FX_PLATFORM_WINDOWS_ @@ -39,7 +38,7 @@ class CFWL_WidgetTP { virtual void DrawBackground(CFWL_ThemeBackground* pParams); virtual void DrawText(CFWL_ThemeText* pParams); - const RetainPtr& GetFont() const { return m_pFDEFont; } + const RetainPtr& GetFont() const; protected: struct CColorData { @@ -112,7 +111,7 @@ class CFWL_FontData { bool LoadFont(const WideStringView& wsFontFamily, uint32_t dwFontStyles, uint16_t wCodePage); - RetainPtr GetFont() const { return m_pFont; } + RetainPtr GetFont() const; protected: WideString m_wsFamily; diff --git a/xfa/fxfa/cxfa_ffapp.h b/xfa/fxfa/cxfa_ffapp.h index f4bd9eb7a8..8ffd657897 100644 --- a/xfa/fxfa/cxfa_ffapp.h +++ b/xfa/fxfa/cxfa_ffapp.h @@ -14,16 +14,17 @@ #include "core/fpdfapi/parser/cpdf_stream_acc.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxcrt/unowned_ptr.h" -#include "xfa/fgas/font/cfgas_fontmgr.h" #include "xfa/fwl/cfwl_app.h" #include "xfa/fxfa/fxfa.h" -class CFWL_WidgetMgr; class CFGAS_DefaultFontManager; -class CXFA_FWLAdapterWidgetMgr; -class CXFA_FWLTheme; +class CFGAS_FontMgr; +class CFWL_WidgetMgr; +class CPDF_Document; class CXFA_FFDocHandler; class CXFA_FontMgr; +class CXFA_FWLAdapterWidgetMgr; +class CXFA_FWLTheme; class IFWL_AdapterTimerMgr; class CXFA_FFApp { diff --git a/xfa/fxfa/cxfa_textlayout.cpp b/xfa/fxfa/cxfa_textlayout.cpp index 9565bb3970..ebb9e8aa2c 100644 --- a/xfa/fxfa/cxfa_textlayout.cpp +++ b/xfa/fxfa/cxfa_textlayout.cpp @@ -20,6 +20,7 @@ #include "third_party/base/ptr_util.h" #include "third_party/base/stl_util.h" #include "xfa/fde/cfde_textout.h" +#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fxfa/cxfa_linkuserdata.h" #include "xfa/fxfa/cxfa_loadercontext.h" #include "xfa/fxfa/cxfa_pieceline.h" diff --git a/xfa/fxfa/cxfa_textlayout.h b/xfa/fxfa/cxfa_textlayout.h index 73aee36eef..40b64a7ca0 100644 --- a/xfa/fxfa/cxfa_textlayout.h +++ b/xfa/fxfa/cxfa_textlayout.h @@ -16,17 +16,18 @@ #include "xfa/fgas/layout/cfx_rtfbreak.h" #include "xfa/fxfa/cxfa_textparser.h" -class CFX_CSSComputedStyle; class CFDE_RenderDevice; -class CFX_XMLNode; +class CFX_CSSComputedStyle; +class CFX_RenderDevice; class CFX_RTFBreak; -class CXFA_LoaderContext; +class CFX_XMLNode; class CXFA_LinkUserData; +class CXFA_LoaderContext; class CXFA_Node; class CXFA_PieceLine; +class CXFA_TextPiece; class CXFA_TextProvider; class CXFA_TextTabstopsContext; -class CXFA_TextPiece; class CXFA_TextLayout { public: diff --git a/xfa/fxfa/cxfa_textparser.h b/xfa/fxfa/cxfa_textparser.h index 336e227221..cd2856e6df 100644 --- a/xfa/fxfa/cxfa_textparser.h +++ b/xfa/fxfa/cxfa_textparser.h @@ -14,9 +14,9 @@ #include "core/fxcrt/fx_system.h" #include "core/fxcrt/retain_ptr.h" #include "core/fxge/fx_dib.h" -#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fxfa/fxfa_basic.h" +class CFGAS_GEFont; class CFX_CSSComputedStyle; class CFX_CSSStyleSelector; class CFX_CSSStyleSheet; diff --git a/xfa/fxfa/cxfa_textpiece.cpp b/xfa/fxfa/cxfa_textpiece.cpp index 87a5e3fff2..d6a8d3abaf 100644 --- a/xfa/fxfa/cxfa_textpiece.cpp +++ b/xfa/fxfa/cxfa_textpiece.cpp @@ -6,6 +6,7 @@ #include "xfa/fxfa/cxfa_textpiece.h" +#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fxfa/cxfa_linkuserdata.h" CXFA_TextPiece::CXFA_TextPiece() {} diff --git a/xfa/fxfa/cxfa_textpiece.h b/xfa/fxfa/cxfa_textpiece.h index b4453b0f36..f3812f8e1e 100644 --- a/xfa/fxfa/cxfa_textpiece.h +++ b/xfa/fxfa/cxfa_textpiece.h @@ -12,9 +12,9 @@ #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxge/fx_dib.h" -#include "xfa/fgas/font/cfgas_gefont.h" #include "xfa/fxfa/fxfa_basic.h" +class CFGAS_GEFont; class CXFA_LinkUserData; class CXFA_TextPiece { -- cgit v1.2.3