From e0307861b8e55c9f44e947d8bf82b9c16ec9b963 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Thu, 29 Sep 2016 13:25:38 -0700 Subject: Move core/fpdftext/include to core/fpdftext BUG=pdfium:611 Review-Url: https://codereview.chromium.org/2383563002 --- core/fpdftext/cpdf_linkextract.cpp | 4 +- core/fpdftext/cpdf_linkextract.h | 46 ++++++++ core/fpdftext/cpdf_textpage.cpp | 2 +- core/fpdftext/cpdf_textpage.h | 181 ++++++++++++++++++++++++++++++ core/fpdftext/cpdf_textpagefind.cpp | 4 +- core/fpdftext/cpdf_textpagefind.h | 60 ++++++++++ core/fpdftext/fpdf_text_int_unittest.cpp | 2 +- core/fpdftext/include/cpdf_linkextract.h | 46 -------- core/fpdftext/include/cpdf_textpage.h | 181 ------------------------------ core/fpdftext/include/cpdf_textpagefind.h | 60 ---------- 10 files changed, 293 insertions(+), 293 deletions(-) create mode 100644 core/fpdftext/cpdf_linkextract.h create mode 100644 core/fpdftext/cpdf_textpage.h create mode 100644 core/fpdftext/cpdf_textpagefind.h delete mode 100644 core/fpdftext/include/cpdf_linkextract.h delete mode 100644 core/fpdftext/include/cpdf_textpage.h delete mode 100644 core/fpdftext/include/cpdf_textpagefind.h (limited to 'core') diff --git a/core/fpdftext/cpdf_linkextract.cpp b/core/fpdftext/cpdf_linkextract.cpp index 1677b67b55..021cc5e009 100644 --- a/core/fpdftext/cpdf_linkextract.cpp +++ b/core/fpdftext/cpdf_linkextract.cpp @@ -4,11 +4,11 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdftext/include/cpdf_linkextract.h" +#include "core/fpdftext/cpdf_linkextract.h" #include -#include "core/fpdftext/include/cpdf_textpage.h" +#include "core/fpdftext/cpdf_textpage.h" #include "core/fxcrt/include/fx_ext.h" #include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" diff --git a/core/fpdftext/cpdf_linkextract.h b/core/fpdftext/cpdf_linkextract.h new file mode 100644 index 0000000000..159b330f94 --- /dev/null +++ b/core/fpdftext/cpdf_linkextract.h @@ -0,0 +1,46 @@ +// 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_FPDFTEXT_CPDF_LINKEXTRACT_H_ +#define CORE_FPDFTEXT_CPDF_LINKEXTRACT_H_ + +#include + +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_TextPage; + +class CPDF_LinkExtract { + public: + explicit CPDF_LinkExtract(const CPDF_TextPage* pTextPage); + ~CPDF_LinkExtract(); + + void ExtractLinks(); + size_t CountLinks() const { return m_LinkArray.size(); } + CFX_WideString GetURL(size_t index) const; + std::vector GetRects(size_t index) const; + + protected: + void ParseLink(); + bool CheckWebLink(CFX_WideString& str); + bool CheckMailLink(CFX_WideString& str); + + private: + struct Link { + int m_Start; + int m_Count; + CFX_WideString m_strUrl; + }; + + const CPDF_TextPage* const m_pTextPage; + CFX_WideString m_strPageText; + std::vector m_LinkArray; +}; + +#endif // CORE_FPDFTEXT_CPDF_LINKEXTRACT_H_ diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index 44d5a198b0..4fdbc3129d 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -4,7 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdftext/include/cpdf_textpage.h" +#include "core/fpdftext/cpdf_textpage.h" #include #include diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h new file mode 100644 index 0000000000..46fcafa6c0 --- /dev/null +++ b/core/fpdftext/cpdf_textpage.h @@ -0,0 +1,181 @@ +// Copyright 2016 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_FPDFTEXT_CPDF_TEXTPAGE_H_ +#define CORE_FPDFTEXT_CPDF_TEXTPAGE_H_ + +#include +#include + +#include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" +#include "core/fxcrt/include/fx_basic.h" +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" + +class CPDF_Font; +class CPDF_FormObject; +class CPDF_Page; +class CPDF_TextObject; + +#define FPDFTEXT_MATCHCASE 0x00000001 +#define FPDFTEXT_MATCHWHOLEWORD 0x00000002 +#define FPDFTEXT_CONSECUTIVE 0x00000004 + +#define FPDFTEXT_CHAR_ERROR -1 +#define FPDFTEXT_CHAR_NORMAL 0 +#define FPDFTEXT_CHAR_GENERATED 1 +#define FPDFTEXT_CHAR_UNUNICODE 2 +#define FPDFTEXT_CHAR_HYPHEN 3 +#define FPDFTEXT_CHAR_PIECE 4 + +#define TEXT_SPACE_CHAR L' ' +#define TEXT_LINEFEED_CHAR L'\n' +#define TEXT_RETURN_CHAR L'\r' +#define TEXT_EMPTY L"" +#define TEXT_SPACE L" " +#define TEXT_RETURN_LINEFEED L"\r\n" +#define TEXT_LINEFEED L"\n" +#define TEXT_CHARRATIO_GAPDELTA 0.070 + +enum class FPDFText_MarkedContent { Pass = 0, Done, Delay }; + +enum class FPDFText_Direction { Left = -1, Right = 1 }; + +struct FPDF_CHAR_INFO { + FX_WCHAR m_Unicode; + FX_WCHAR m_Charcode; + int32_t m_Flag; + FX_FLOAT m_FontSize; + FX_FLOAT m_OriginX; + FX_FLOAT m_OriginY; + CFX_FloatRect m_CharBox; + CPDF_TextObject* m_pTextObj; + CFX_Matrix m_Matrix; +}; + +struct FPDF_SEGMENT { + int m_Start; + int m_nCount; +}; + +struct PAGECHAR_INFO { + int m_CharCode; + FX_WCHAR m_Unicode; + FX_FLOAT m_OriginX; + FX_FLOAT m_OriginY; + int32_t m_Flag; + CFX_FloatRect m_CharBox; + CPDF_TextObject* m_pTextObj; + CFX_Matrix m_Matrix; + int m_Index; +}; + +struct PDFTEXT_Obj { + CPDF_TextObject* m_pTextObj; + CFX_Matrix m_formMatrix; +}; + +class CPDF_TextPage { + public: + 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; + int TextIndexFromCharIndex(int CharIndex) const; + int CountChars() const; + void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; + std::vector GetRectArray(int start, int nCount) const; + int GetIndexAtPos(CFX_FloatPoint point, + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const; + int GetIndexAtPos(FX_FLOAT x, + FX_FLOAT y, + FX_FLOAT xTolerance, + FX_FLOAT yTolerance) const; + CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const; + CFX_WideString GetPageText(int start = 0, int nCount = -1) const; + int CountRects(int start, int nCount); + void GetRect(int rectIndex, + FX_FLOAT& left, + FX_FLOAT& top, + FX_FLOAT& right, + FX_FLOAT& bottom) const; + + static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, + const CFX_FloatRect& rect2); + + private: + enum class TextOrientation { + Unknown, + Horizontal, + Vertical, + }; + + enum class GenerateCharacter { + None, + Space, + LineBreak, + Hyphen, + }; + + FX_BOOL IsHyphen(FX_WCHAR curChar); + bool IsControlChar(const PAGECHAR_INFO& charInfo); + void ProcessObject(); + void ProcessFormObject(CPDF_FormObject* pFormObj, + const CFX_Matrix& formMatrix); + void ProcessTextObject(PDFTEXT_Obj pObj); + void ProcessTextObject(CPDF_TextObject* pTextObj, + const CFX_Matrix& formMatrix, + const CPDF_PageObjectList* pObjList, + CPDF_PageObjectList::const_iterator ObjPos); + GenerateCharacter ProcessInsertObject(const CPDF_TextObject* pObj, + const CFX_Matrix& formMatrix); + FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info); + FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, + const CPDF_PageObjectList* pObjList, + CPDF_PageObjectList::const_iterator ObjPos); + FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, + CPDF_TextObject* pTextObj2); + int GetCharWidth(uint32_t charCode, CPDF_Font* pFont) const; + void CloseTempLine(); + FPDFText_MarkedContent PreMarkedContent(PDFTEXT_Obj pObj); + void ProcessMarkedContent(PDFTEXT_Obj pObj); + void CheckMarkedContentObject(int32_t& start, int32_t& nCount) const; + void FindPreviousTextObject(); + void AddCharInfoByLRDirection(FX_WCHAR wChar, PAGECHAR_INFO info); + void AddCharInfoByRLDirection(FX_WCHAR wChar, PAGECHAR_INFO info); + TextOrientation GetTextObjectWritingMode( + const CPDF_TextObject* pTextObj) const; + TextOrientation FindTextlineFlowOrientation() const; + void AppendGeneratedCharacter(FX_WCHAR unicode, const CFX_Matrix& formMatrix); + + void SwapTempTextBuf(int32_t iCharListStartAppend, int32_t iBufStartAppend); + FX_BOOL IsRightToLeft(const CPDF_TextObject* pTextObj, + const CPDF_Font* pFont, + int nItems) const; + + const CPDF_Page* const m_pPage; + std::vector m_CharIndex; + std::deque m_CharList; + std::deque m_TempCharList; + CFX_WideTextBuf m_TextBuf; + CFX_WideTextBuf m_TempTextBuf; + const FPDFText_Direction m_parserflag; + CPDF_TextObject* m_pPreTextObj; + CFX_Matrix m_perMatrix; + bool m_bIsParsed; + CFX_Matrix m_DisplayMatrix; + CFX_ArrayTemplate m_Segments; + std::vector m_SelRects; + CFX_ArrayTemplate m_LineObj; + TextOrientation m_TextlineDir; + CFX_FloatRect m_CurlineRect; +}; + +#endif // CORE_FPDFTEXT_CPDF_TEXTPAGE_H_ diff --git a/core/fpdftext/cpdf_textpagefind.cpp b/core/fpdftext/cpdf_textpagefind.cpp index a67bdf15d5..03dd21b475 100644 --- a/core/fpdftext/cpdf_textpagefind.cpp +++ b/core/fpdftext/cpdf_textpagefind.cpp @@ -4,13 +4,13 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -#include "core/fpdftext/include/cpdf_textpagefind.h" +#include "core/fpdftext/cpdf_textpagefind.h" #include #include #include -#include "core/fpdftext/include/cpdf_textpage.h" +#include "core/fpdftext/cpdf_textpage.h" #include "core/fxcrt/include/fx_string.h" #include "core/fxcrt/include/fx_system.h" #include "third_party/base/stl_util.h" diff --git a/core/fpdftext/cpdf_textpagefind.h b/core/fpdftext/cpdf_textpagefind.h new file mode 100644 index 0000000000..2cc4c1e48c --- /dev/null +++ b/core/fpdftext/cpdf_textpagefind.h @@ -0,0 +1,60 @@ +// Copyright 2016 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_FPDFTEXT_CPDF_TEXTPAGEFIND_H_ +#define CORE_FPDFTEXT_CPDF_TEXTPAGEFIND_H_ + +#include + +#include "core/fxcrt/include/fx_coordinates.h" +#include "core/fxcrt/include/fx_string.h" +#include "core/fxcrt/include/fx_system.h" + +class CPDF_TextPage; + +class CPDF_TextPageFind { + public: + explicit CPDF_TextPageFind(const CPDF_TextPage* pTextPage); + ~CPDF_TextPageFind(); + + FX_BOOL FindFirst(const CFX_WideString& findwhat, + int flags, + int startPos = 0); + FX_BOOL FindNext(); + FX_BOOL FindPrev(); + int GetCurOrder() const; + int GetMatchedCount() const; + + protected: + void ExtractFindWhat(const CFX_WideString& findwhat); + FX_BOOL IsMatchWholeWord(const CFX_WideString& csPageText, + int startPos, + int endPos); + FX_BOOL ExtractSubString(CFX_WideString& rString, + const FX_WCHAR* lpszFullString, + int iSubString, + FX_WCHAR chSep); + CFX_WideString MakeReverse(const CFX_WideString& str); + int GetCharIndex(int index) const; + + private: + std::vector m_CharIndex; + const CPDF_TextPage* m_pTextPage; + CFX_WideString m_strText; + CFX_WideString m_findWhat; + int m_flags; + std::vector m_csFindWhatArray; + int m_findNextStart; + int m_findPreStart; + FX_BOOL m_bMatchCase; + FX_BOOL m_bMatchWholeWord; + int m_resStart; + int m_resEnd; + std::vector m_resArray; + FX_BOOL m_IsFind; +}; + +#endif // CORE_FPDFTEXT_CPDF_TEXTPAGEFIND_H_ diff --git a/core/fpdftext/fpdf_text_int_unittest.cpp b/core/fpdftext/fpdf_text_int_unittest.cpp index 0ee11d2d57..d7e48768bc 100644 --- a/core/fpdftext/fpdf_text_int_unittest.cpp +++ b/core/fpdftext/fpdf_text_int_unittest.cpp @@ -2,7 +2,7 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "core/fpdftext/include/cpdf_linkextract.h" +#include "core/fpdftext/cpdf_linkextract.h" #include "testing/gtest/include/gtest/gtest.h" diff --git a/core/fpdftext/include/cpdf_linkextract.h b/core/fpdftext/include/cpdf_linkextract.h deleted file mode 100644 index 5d471e0f1c..0000000000 --- a/core/fpdftext/include/cpdf_linkextract.h +++ /dev/null @@ -1,46 +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_FPDFTEXT_INCLUDE_CPDF_LINKEXTRACT_H_ -#define CORE_FPDFTEXT_INCLUDE_CPDF_LINKEXTRACT_H_ - -#include - -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_TextPage; - -class CPDF_LinkExtract { - public: - explicit CPDF_LinkExtract(const CPDF_TextPage* pTextPage); - ~CPDF_LinkExtract(); - - void ExtractLinks(); - size_t CountLinks() const { return m_LinkArray.size(); } - CFX_WideString GetURL(size_t index) const; - std::vector GetRects(size_t index) const; - - protected: - void ParseLink(); - bool CheckWebLink(CFX_WideString& str); - bool CheckMailLink(CFX_WideString& str); - - private: - struct Link { - int m_Start; - int m_Count; - CFX_WideString m_strUrl; - }; - - const CPDF_TextPage* const m_pTextPage; - CFX_WideString m_strPageText; - std::vector m_LinkArray; -}; - -#endif // CORE_FPDFTEXT_INCLUDE_CPDF_LINKEXTRACT_H_ diff --git a/core/fpdftext/include/cpdf_textpage.h b/core/fpdftext/include/cpdf_textpage.h deleted file mode 100644 index 64b1613e7e..0000000000 --- a/core/fpdftext/include/cpdf_textpage.h +++ /dev/null @@ -1,181 +0,0 @@ -// Copyright 2016 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_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ -#define CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ - -#include -#include - -#include "core/fpdfapi/fpdf_page/cpdf_pageobjectlist.h" -#include "core/fxcrt/include/fx_basic.h" -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" - -class CPDF_Font; -class CPDF_FormObject; -class CPDF_Page; -class CPDF_TextObject; - -#define FPDFTEXT_MATCHCASE 0x00000001 -#define FPDFTEXT_MATCHWHOLEWORD 0x00000002 -#define FPDFTEXT_CONSECUTIVE 0x00000004 - -#define FPDFTEXT_CHAR_ERROR -1 -#define FPDFTEXT_CHAR_NORMAL 0 -#define FPDFTEXT_CHAR_GENERATED 1 -#define FPDFTEXT_CHAR_UNUNICODE 2 -#define FPDFTEXT_CHAR_HYPHEN 3 -#define FPDFTEXT_CHAR_PIECE 4 - -#define TEXT_SPACE_CHAR L' ' -#define TEXT_LINEFEED_CHAR L'\n' -#define TEXT_RETURN_CHAR L'\r' -#define TEXT_EMPTY L"" -#define TEXT_SPACE L" " -#define TEXT_RETURN_LINEFEED L"\r\n" -#define TEXT_LINEFEED L"\n" -#define TEXT_CHARRATIO_GAPDELTA 0.070 - -enum class FPDFText_MarkedContent { Pass = 0, Done, Delay }; - -enum class FPDFText_Direction { Left = -1, Right = 1 }; - -struct FPDF_CHAR_INFO { - FX_WCHAR m_Unicode; - FX_WCHAR m_Charcode; - int32_t m_Flag; - FX_FLOAT m_FontSize; - FX_FLOAT m_OriginX; - FX_FLOAT m_OriginY; - CFX_FloatRect m_CharBox; - CPDF_TextObject* m_pTextObj; - CFX_Matrix m_Matrix; -}; - -struct FPDF_SEGMENT { - int m_Start; - int m_nCount; -}; - -struct PAGECHAR_INFO { - int m_CharCode; - FX_WCHAR m_Unicode; - FX_FLOAT m_OriginX; - FX_FLOAT m_OriginY; - int32_t m_Flag; - CFX_FloatRect m_CharBox; - CPDF_TextObject* m_pTextObj; - CFX_Matrix m_Matrix; - int m_Index; -}; - -struct PDFTEXT_Obj { - CPDF_TextObject* m_pTextObj; - CFX_Matrix m_formMatrix; -}; - -class CPDF_TextPage { - public: - 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; - int TextIndexFromCharIndex(int CharIndex) const; - int CountChars() const; - void GetCharInfo(int index, FPDF_CHAR_INFO* info) const; - std::vector GetRectArray(int start, int nCount) const; - int GetIndexAtPos(CFX_FloatPoint point, - FX_FLOAT xTolerance, - FX_FLOAT yTolerance) const; - int GetIndexAtPos(FX_FLOAT x, - FX_FLOAT y, - FX_FLOAT xTolerance, - FX_FLOAT yTolerance) const; - CFX_WideString GetTextByRect(const CFX_FloatRect& rect) const; - CFX_WideString GetPageText(int start = 0, int nCount = -1) const; - int CountRects(int start, int nCount); - void GetRect(int rectIndex, - FX_FLOAT& left, - FX_FLOAT& top, - FX_FLOAT& right, - FX_FLOAT& bottom) const; - - static FX_BOOL IsRectIntersect(const CFX_FloatRect& rect1, - const CFX_FloatRect& rect2); - - private: - enum class TextOrientation { - Unknown, - Horizontal, - Vertical, - }; - - enum class GenerateCharacter { - None, - Space, - LineBreak, - Hyphen, - }; - - FX_BOOL IsHyphen(FX_WCHAR curChar); - bool IsControlChar(const PAGECHAR_INFO& charInfo); - void ProcessObject(); - void ProcessFormObject(CPDF_FormObject* pFormObj, - const CFX_Matrix& formMatrix); - void ProcessTextObject(PDFTEXT_Obj pObj); - void ProcessTextObject(CPDF_TextObject* pTextObj, - const CFX_Matrix& formMatrix, - const CPDF_PageObjectList* pObjList, - CPDF_PageObjectList::const_iterator ObjPos); - GenerateCharacter ProcessInsertObject(const CPDF_TextObject* pObj, - const CFX_Matrix& formMatrix); - FX_BOOL GenerateCharInfo(FX_WCHAR unicode, PAGECHAR_INFO& info); - FX_BOOL IsSameAsPreTextObject(CPDF_TextObject* pTextObj, - const CPDF_PageObjectList* pObjList, - CPDF_PageObjectList::const_iterator ObjPos); - FX_BOOL IsSameTextObject(CPDF_TextObject* pTextObj1, - CPDF_TextObject* pTextObj2); - int GetCharWidth(uint32_t charCode, CPDF_Font* pFont) const; - void CloseTempLine(); - FPDFText_MarkedContent PreMarkedContent(PDFTEXT_Obj pObj); - void ProcessMarkedContent(PDFTEXT_Obj pObj); - void CheckMarkedContentObject(int32_t& start, int32_t& nCount) const; - void FindPreviousTextObject(); - void AddCharInfoByLRDirection(FX_WCHAR wChar, PAGECHAR_INFO info); - void AddCharInfoByRLDirection(FX_WCHAR wChar, PAGECHAR_INFO info); - TextOrientation GetTextObjectWritingMode( - const CPDF_TextObject* pTextObj) const; - TextOrientation FindTextlineFlowOrientation() const; - void AppendGeneratedCharacter(FX_WCHAR unicode, const CFX_Matrix& formMatrix); - - void SwapTempTextBuf(int32_t iCharListStartAppend, int32_t iBufStartAppend); - FX_BOOL IsRightToLeft(const CPDF_TextObject* pTextObj, - const CPDF_Font* pFont, - int nItems) const; - - const CPDF_Page* const m_pPage; - std::vector m_CharIndex; - std::deque m_CharList; - std::deque m_TempCharList; - CFX_WideTextBuf m_TextBuf; - CFX_WideTextBuf m_TempTextBuf; - const FPDFText_Direction m_parserflag; - CPDF_TextObject* m_pPreTextObj; - CFX_Matrix m_perMatrix; - bool m_bIsParsed; - CFX_Matrix m_DisplayMatrix; - CFX_ArrayTemplate m_Segments; - std::vector m_SelRects; - CFX_ArrayTemplate m_LineObj; - TextOrientation m_TextlineDir; - CFX_FloatRect m_CurlineRect; -}; - -#endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGE_H_ diff --git a/core/fpdftext/include/cpdf_textpagefind.h b/core/fpdftext/include/cpdf_textpagefind.h deleted file mode 100644 index 4950bd1113..0000000000 --- a/core/fpdftext/include/cpdf_textpagefind.h +++ /dev/null @@ -1,60 +0,0 @@ -// Copyright 2016 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_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ -#define CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ - -#include - -#include "core/fxcrt/include/fx_coordinates.h" -#include "core/fxcrt/include/fx_string.h" -#include "core/fxcrt/include/fx_system.h" - -class CPDF_TextPage; - -class CPDF_TextPageFind { - public: - explicit CPDF_TextPageFind(const CPDF_TextPage* pTextPage); - ~CPDF_TextPageFind(); - - FX_BOOL FindFirst(const CFX_WideString& findwhat, - int flags, - int startPos = 0); - FX_BOOL FindNext(); - FX_BOOL FindPrev(); - int GetCurOrder() const; - int GetMatchedCount() const; - - protected: - void ExtractFindWhat(const CFX_WideString& findwhat); - FX_BOOL IsMatchWholeWord(const CFX_WideString& csPageText, - int startPos, - int endPos); - FX_BOOL ExtractSubString(CFX_WideString& rString, - const FX_WCHAR* lpszFullString, - int iSubString, - FX_WCHAR chSep); - CFX_WideString MakeReverse(const CFX_WideString& str); - int GetCharIndex(int index) const; - - private: - std::vector m_CharIndex; - const CPDF_TextPage* m_pTextPage; - CFX_WideString m_strText; - CFX_WideString m_findWhat; - int m_flags; - std::vector m_csFindWhatArray; - int m_findNextStart; - int m_findPreStart; - FX_BOOL m_bMatchCase; - FX_BOOL m_bMatchWholeWord; - int m_resStart; - int m_resEnd; - std::vector m_resArray; - FX_BOOL m_IsFind; -}; - -#endif // CORE_FPDFTEXT_INCLUDE_CPDF_TEXTPAGEFIND_H_ -- cgit v1.2.3