From 1d95d654dde9380265be8d412141e03f7ba12da3 Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 8 Feb 2016 12:46:54 -0800 Subject: CPDF_TextStream::m_pObjArray is always NULL Also, use full path to include "text_int.h", as there are two of them; I suspect that fpdf_text_search was including the wrong one as the compiler didn't complain about a signature mismatch I had overlooked. In fact, rename the fxge file to avoid collision completely. R=thestig@chromium.org Review URL: https://codereview.chromium.org/1679743003 . --- core/src/fxge/agg/src/fx_agg_driver.cpp | 2 +- core/src/fxge/apple/fx_apple_platform.cpp | 2 +- core/src/fxge/apple/fx_quartz_device.cpp | 2 +- core/src/fxge/ge/fx_ge.cpp | 2 +- core/src/fxge/ge/fx_ge_font.cpp | 2 +- core/src/fxge/ge/fx_ge_fontmap.cpp | 2 +- core/src/fxge/ge/fx_ge_linux.cpp | 2 +- core/src/fxge/ge/fx_ge_ps.cpp | 3 +- core/src/fxge/ge/fx_ge_text.cpp | 2 +- core/src/fxge/ge/fx_text_int.h | 84 +++++++++++++++++++++++++++++++ core/src/fxge/ge/text_int.h | 84 ------------------------------- core/src/fxge/win32/fx_win32_device.cpp | 2 +- core/src/fxge/win32/fx_win32_print.cpp | 2 +- 13 files changed, 96 insertions(+), 95 deletions(-) create mode 100644 core/src/fxge/ge/fx_text_int.h delete mode 100644 core/src/fxge/ge/text_int.h (limited to 'core/src/fxge') diff --git a/core/src/fxge/agg/src/fx_agg_driver.cpp b/core/src/fxge/agg/src/fx_agg_driver.cpp index 6828531cba..50062541b1 100644 --- a/core/src/fxge/agg/src/fx_agg_driver.cpp +++ b/core/src/fxge/agg/src/fx_agg_driver.cpp @@ -11,7 +11,7 @@ #include "core/include/fxcodec/fx_codec.h" #include "core/include/fxge/fx_ge.h" #include "core/src/fxge/dib/dib_int.h" -#include "core/src/fxge/ge/text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #include "third_party/agg23/agg_conv_dash.h" #include "third_party/agg23/agg_conv_stroke.h" #include "third_party/agg23/agg_curves.h" diff --git a/core/src/fxge/apple/fx_apple_platform.cpp b/core/src/fxge/apple/fx_apple_platform.cpp index f0a23825b9..a448ae5050 100644 --- a/core/src/fxge/apple/fx_apple_platform.cpp +++ b/core/src/fxge/apple/fx_apple_platform.cpp @@ -14,7 +14,7 @@ #include "core/include/fxge/fx_ge_apple.h" #include "core/src/fxge/agg/include/fx_agg_driver.h" #include "core/src/fxge/dib/dib_int.h" -#include "core/src/fxge/ge/text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" void CFX_AggDeviceDriver::InitPlatform() { CQuartz2D& quartz2d = diff --git a/core/src/fxge/apple/fx_quartz_device.cpp b/core/src/fxge/apple/fx_quartz_device.cpp index 0b19438230..a7b0a9e082 100644 --- a/core/src/fxge/apple/fx_quartz_device.cpp +++ b/core/src/fxge/apple/fx_quartz_device.cpp @@ -9,7 +9,7 @@ #include "core/include/fxge/fx_ge.h" #include "core/src/fxge/agg/include/fx_agg_driver.h" #include "core/src/fxge/dib/dib_int.h" -#include "core/src/fxge/ge/text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_APPLE_ #include "apple_int.h" diff --git a/core/src/fxge/ge/fx_ge.cpp b/core/src/fxge/ge/fx_ge.cpp index f7787cf22c..d310a3f372 100644 --- a/core/src/fxge/ge/fx_ge.cpp +++ b/core/src/fxge/ge/fx_ge.cpp @@ -6,7 +6,7 @@ #include "core/include/fxge/fx_ge.h" -#include "text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" static CFX_GEModule* g_pGEModule = NULL; CFX_GEModule::CFX_GEModule(const char** pUserFontPaths) { diff --git a/core/src/fxge/ge/fx_ge_font.cpp b/core/src/fxge/ge/fx_ge_font.cpp index 56e178f985..672c28d86b 100644 --- a/core/src/fxge/ge/fx_ge_font.cpp +++ b/core/src/fxge/ge/fx_ge_font.cpp @@ -6,7 +6,7 @@ #include "core/include/fxge/fx_freetype.h" #include "core/include/fxge/fx_ge.h" -#include "text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #define EM_ADJUST(em, a) (em == 0 ? (a) : (a)*1000 / em) diff --git a/core/src/fxge/ge/fx_ge_fontmap.cpp b/core/src/fxge/ge/fx_ge_fontmap.cpp index be71f6bfac..f624d5abd6 100644 --- a/core/src/fxge/ge/fx_ge_fontmap.cpp +++ b/core/src/fxge/ge/fx_ge_fontmap.cpp @@ -10,7 +10,7 @@ #include "core/include/fxge/fx_freetype.h" #include "core/include/fxge/fx_ge.h" #include "core/src/fxge/fontdata/chromefontdata/chromefontdata.h" -#include "core/src/fxge/ge/text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #include "third_party/base/stl_util.h" #define GET_TT_SHORT(w) (FX_WORD)(((w)[0] << 8) | (w)[1]) diff --git a/core/src/fxge/ge/fx_ge_linux.cpp b/core/src/fxge/ge/fx_ge_linux.cpp index d581627b7e..8ad5ff0da2 100644 --- a/core/src/fxge/ge/fx_ge_linux.cpp +++ b/core/src/fxge/ge/fx_ge_linux.cpp @@ -6,7 +6,7 @@ #include "core/include/fxge/fx_ge.h" #include "core/src/fxge/agg/include/fx_agg_driver.h" -#include "text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #if _FXM_PLATFORM_ == _FXM_PLATFORM_LINUX_ class CFX_LinuxFontInfo : public CFX_FolderFontInfo { diff --git a/core/src/fxge/ge/fx_ge_ps.cpp b/core/src/fxge/ge/fx_ge_ps.cpp index f9fd8dea30..d6f6089033 100644 --- a/core/src/fxge/ge/fx_ge_ps.cpp +++ b/core/src/fxge/ge/fx_ge_ps.cpp @@ -5,8 +5,9 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com #include "core/include/fxge/fx_ge.h" + #include "core/include/fxcodec/fx_codec.h" -#include "text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" struct PSGlyph { CFX_Font* m_pFont; diff --git a/core/src/fxge/ge/fx_ge_text.cpp b/core/src/fxge/ge/fx_ge_text.cpp index 0ed0bbbbd6..7dbeac3316 100644 --- a/core/src/fxge/ge/fx_ge_text.cpp +++ b/core/src/fxge/ge/fx_ge_text.cpp @@ -7,7 +7,7 @@ #include "core/include/fxge/fx_ge.h" #include "core/include/fxge/fx_freetype.h" #include "core/include/fxcodec/fx_codec.h" -#include "text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #undef FX_GAMMA #undef FX_GAMMA_INVERSE diff --git a/core/src/fxge/ge/fx_text_int.h b/core/src/fxge/ge/fx_text_int.h new file mode 100644 index 0000000000..b568b61a54 --- /dev/null +++ b/core/src/fxge/ge/fx_text_int.h @@ -0,0 +1,84 @@ +// Copyright 2014 PDFium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com + +#ifndef CORE_SRC_FXGE_GE_FX_TEXT_INT_H_ +#define CORE_SRC_FXGE_GE_FX_TEXT_INT_H_ + +#include + +#include "core/include/fxge/fx_font.h" +#include "core/include/fxge/fx_freetype.h" + +struct _CFX_UniqueKeyGen { + void Generate(int count, ...); + FX_CHAR m_Key[128]; + int m_KeyLen; +}; +class CFX_SizeGlyphCache { + public: + CFX_SizeGlyphCache() {} + ~CFX_SizeGlyphCache(); + std::map m_GlyphMap; +}; +class CTTFontDesc { + public: + CTTFontDesc() { + m_Type = 0; + m_pFontData = NULL; + m_RefCount = 0; + } + ~CTTFontDesc(); + // ret < 0, releaseface not appropriate for this object. + // ret == 0, object released + // ret > 0, object still alive, other referrers. + int ReleaseFace(FXFT_Face face); + int m_Type; + union { + struct { + FX_BOOL m_bItalic; + FX_BOOL m_bBold; + FXFT_Face m_pFace; + } m_SingleFace; + struct { + FXFT_Face m_pFaces[16]; + } m_TTCFace; + }; + uint8_t* m_pFontData; + int m_RefCount; +}; + +#define CHARSET_FLAG_ANSI 1 +#define CHARSET_FLAG_SYMBOL 2 +#define CHARSET_FLAG_SHIFTJIS 4 +#define CHARSET_FLAG_BIG5 8 +#define CHARSET_FLAG_GB 16 +#define CHARSET_FLAG_KOREAN 32 + +class CFX_FontFaceInfo { + public: + CFX_FontFaceInfo(CFX_ByteString filePath, + CFX_ByteString faceName, + CFX_ByteString fontTables, + FX_DWORD fontOffset, + FX_DWORD fileSize) + : m_FilePath(filePath), + m_FaceName(faceName), + m_FontTables(fontTables), + m_FontOffset(fontOffset), + m_FileSize(fileSize), + m_Styles(0), + m_Charsets(0) {} + + const CFX_ByteString m_FilePath; + const CFX_ByteString m_FaceName; + const CFX_ByteString m_FontTables; + const FX_DWORD m_FontOffset; + const FX_DWORD m_FileSize; + FX_DWORD m_Styles; + FX_DWORD m_Charsets; +}; + +#endif // CORE_SRC_FXGE_GE_FX_TEXT_INT_H_ diff --git a/core/src/fxge/ge/text_int.h b/core/src/fxge/ge/text_int.h deleted file mode 100644 index 5a691671be..0000000000 --- a/core/src/fxge/ge/text_int.h +++ /dev/null @@ -1,84 +0,0 @@ -// Copyright 2014 PDFium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com - -#ifndef CORE_SRC_FXGE_GE_TEXT_INT_H_ -#define CORE_SRC_FXGE_GE_TEXT_INT_H_ - -#include - -#include "core/include/fxge/fx_font.h" -#include "core/include/fxge/fx_freetype.h" - -struct _CFX_UniqueKeyGen { - void Generate(int count, ...); - FX_CHAR m_Key[128]; - int m_KeyLen; -}; -class CFX_SizeGlyphCache { - public: - CFX_SizeGlyphCache() {} - ~CFX_SizeGlyphCache(); - std::map m_GlyphMap; -}; -class CTTFontDesc { - public: - CTTFontDesc() { - m_Type = 0; - m_pFontData = NULL; - m_RefCount = 0; - } - ~CTTFontDesc(); - // ret < 0, releaseface not appropriate for this object. - // ret == 0, object released - // ret > 0, object still alive, other referrers. - int ReleaseFace(FXFT_Face face); - int m_Type; - union { - struct { - FX_BOOL m_bItalic; - FX_BOOL m_bBold; - FXFT_Face m_pFace; - } m_SingleFace; - struct { - FXFT_Face m_pFaces[16]; - } m_TTCFace; - }; - uint8_t* m_pFontData; - int m_RefCount; -}; - -#define CHARSET_FLAG_ANSI 1 -#define CHARSET_FLAG_SYMBOL 2 -#define CHARSET_FLAG_SHIFTJIS 4 -#define CHARSET_FLAG_BIG5 8 -#define CHARSET_FLAG_GB 16 -#define CHARSET_FLAG_KOREAN 32 - -class CFX_FontFaceInfo { - public: - CFX_FontFaceInfo(CFX_ByteString filePath, - CFX_ByteString faceName, - CFX_ByteString fontTables, - FX_DWORD fontOffset, - FX_DWORD fileSize) - : m_FilePath(filePath), - m_FaceName(faceName), - m_FontTables(fontTables), - m_FontOffset(fontOffset), - m_FileSize(fileSize), - m_Styles(0), - m_Charsets(0) {} - - const CFX_ByteString m_FilePath; - const CFX_ByteString m_FaceName; - const CFX_ByteString m_FontTables; - const FX_DWORD m_FontOffset; - const FX_DWORD m_FileSize; - FX_DWORD m_Styles; - FX_DWORD m_Charsets; -}; - -#endif // CORE_SRC_FXGE_GE_TEXT_INT_H_ diff --git a/core/src/fxge/win32/fx_win32_device.cpp b/core/src/fxge/win32/fx_win32_device.cpp index c346d1bbc1..a7dd22f612 100644 --- a/core/src/fxge/win32/fx_win32_device.cpp +++ b/core/src/fxge/win32/fx_win32_device.cpp @@ -14,7 +14,7 @@ #include "core/include/fxge/fx_ge_win32.h" #include "core/src/fxge/agg/include/fx_agg_driver.h" #include "core/src/fxge/dib/dib_int.h" -#include "core/src/fxge/ge/text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #include "dwrite_int.h" #include "win32_int.h" diff --git a/core/src/fxge/win32/fx_win32_print.cpp b/core/src/fxge/win32/fx_win32_print.cpp index 0c00a7b3d9..fc7cd790a7 100644 --- a/core/src/fxge/win32/fx_win32_print.cpp +++ b/core/src/fxge/win32/fx_win32_print.cpp @@ -13,7 +13,7 @@ #include "core/include/fxge/fx_freetype.h" #include "core/include/fxge/fx_ge_win32.h" #include "core/src/fxge/dib/dib_int.h" -#include "core/src/fxge/ge/text_int.h" +#include "core/src/fxge/ge/fx_text_int.h" #include "win32_int.h" #define SIZETHRESHOLD 1000 -- cgit v1.2.3