summaryrefslogtreecommitdiff
path: root/core/fpdftext/cpdf_textpage.h
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2018-05-07 20:42:57 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-05-07 20:42:57 +0000
commit7a38ca461520ab6ad34dc1271a04c64dd71415c4 (patch)
treeed5f8dccff9994a01ac8e9dbd581b7ec9924c697 /core/fpdftext/cpdf_textpage.h
parente7207f33f8024b59fc85abb1b4594b0fbab5361b (diff)
downloadpdfium-7a38ca461520ab6ad34dc1271a04c64dd71415c4.tar.xz
Initialize CPDF_TextPage members in the header.
Change-Id: I667a3cd696d44692fa3d73bdee7c2f48d3039255 Reviewed-on: https://pdfium-review.googlesource.com/32152 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdftext/cpdf_textpage.h')
-rw-r--r--core/fpdftext/cpdf_textpage.h28
1 files changed, 11 insertions, 17 deletions
diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h
index 66ece911ed..eb3950f145 100644
--- a/core/fpdftext/cpdf_textpage.h
+++ b/core/fpdftext/cpdf_textpage.h
@@ -49,31 +49,26 @@ class FPDF_CHAR_INFO {
FPDF_CHAR_INFO();
~FPDF_CHAR_INFO();
- wchar_t m_Unicode;
- wchar_t m_Charcode;
- int32_t m_Flag;
- float m_FontSize;
+ wchar_t m_Unicode = 0;
+ wchar_t m_Charcode = 0;
+ int32_t m_Flag = 0;
+ float m_FontSize = 0;
CFX_PointF m_Origin;
CFX_FloatRect m_CharBox;
UnownedPtr<CPDF_TextObject> m_pTextObj;
CFX_Matrix m_Matrix;
};
-struct FPDF_SEGMENT {
- int m_Start;
- int m_nCount;
-};
-
class PAGECHAR_INFO {
public:
PAGECHAR_INFO();
PAGECHAR_INFO(const PAGECHAR_INFO&);
~PAGECHAR_INFO();
- int m_Index;
- int m_CharCode;
- wchar_t m_Unicode;
- int32_t m_Flag;
+ int m_Index = 0;
+ int m_CharCode = 0;
+ wchar_t m_Unicode = 0;
+ int32_t m_Flag = 0;
CFX_PointF m_Origin;
CFX_FloatRect m_CharBox;
UnownedPtr<CPDF_TextObject> m_pTextObj;
@@ -94,7 +89,6 @@ class CPDF_TextPage {
CPDF_TextPage(const CPDF_Page* pPage, FPDFText_Direction flags);
~CPDF_TextPage();
- // IPDF_TextPage:
void ParseTextPage();
bool IsParsed() const { return m_bIsParsed; }
int CharIndexFromTextIndex(int TextIndex) const;
@@ -106,7 +100,7 @@ class CPDF_TextPage {
WideString GetTextByRect(const CFX_FloatRect& rect) const;
// Returns string with the text from |m_TextBuf| that are covered by the input
- // range. |start| and |count| are in terms of the m_CharIndex, so the range
+ // range. |start| and |count| are in terms of the |m_CharIndex|, so the range
// will be converted into appropriate indices.
WideString GetPageText(int start, int count) const;
WideString GetAllPageText() const { return GetPageText(0, CountChars()); }
@@ -176,11 +170,11 @@ class CPDF_TextPage {
const FPDFText_Direction m_parserflag;
UnownedPtr<CPDF_TextObject> m_pPreTextObj;
CFX_Matrix m_perMatrix;
- bool m_bIsParsed;
+ bool m_bIsParsed = false;
CFX_Matrix m_DisplayMatrix;
std::vector<CFX_FloatRect> m_SelRects;
std::vector<PDFTEXT_Obj> m_LineObj;
- TextOrientation m_TextlineDir;
+ TextOrientation m_TextlineDir = TextOrientation::Unknown;
CFX_FloatRect m_CurlineRect;
};