diff options
Diffstat (limited to 'core/fpdftext')
-rw-r--r-- | core/fpdftext/cpdf_textpage.cpp | 6 | ||||
-rw-r--r-- | core/fpdftext/cpdf_textpage.h | 9 | ||||
-rw-r--r-- | core/fpdftext/cpdf_textpagefind.cpp | 2 | ||||
-rw-r--r-- | core/fpdftext/cpdf_textpagefind.h | 3 |
4 files changed, 11 insertions, 9 deletions
diff --git a/core/fpdftext/cpdf_textpage.cpp b/core/fpdftext/cpdf_textpage.cpp index 5a39281183..7a493c004d 100644 --- a/core/fpdftext/cpdf_textpage.cpp +++ b/core/fpdftext/cpdf_textpage.cpp @@ -248,10 +248,10 @@ std::vector<CFX_FloatRect> CPDF_TextPage::GetRectArray(int start, continue; } if (!pCurObj) - pCurObj = info_curchar.m_pTextObj; + pCurObj = info_curchar.m_pTextObj.Get(); if (pCurObj != info_curchar.m_pTextObj) { rectArray.push_back(rect); - pCurObj = info_curchar.m_pTextObj; + pCurObj = info_curchar.m_pTextObj.Get(); bFlagNewRect = true; } if (bFlagNewRect) { @@ -1250,7 +1250,7 @@ CPDF_TextPage::GenerateCharacter CPDF_TextPage::ProcessInsertObject( FindPreviousTextObject(); TextOrientation WritingMode = GetTextObjectWritingMode(pObj); if (WritingMode == TextOrientation::Unknown) - WritingMode = GetTextObjectWritingMode(m_pPreTextObj); + WritingMode = GetTextObjectWritingMode(m_pPreTextObj.Get()); CFX_FloatRect this_rect = pObj->GetRect(); CFX_FloatRect prev_rect = m_pPreTextObj->GetRect(); diff --git a/core/fpdftext/cpdf_textpage.h b/core/fpdftext/cpdf_textpage.h index d7e29edf3b..a18310667d 100644 --- a/core/fpdftext/cpdf_textpage.h +++ b/core/fpdftext/cpdf_textpage.h @@ -11,6 +11,7 @@ #include <vector> #include "core/fpdfapi/page/cpdf_pageobjectlist.h" +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_basic.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" @@ -57,7 +58,7 @@ class FPDF_CHAR_INFO { float m_FontSize; CFX_PointF m_Origin; CFX_FloatRect m_CharBox; - CPDF_TextObject* m_pTextObj; + CFX_UnownedPtr<CPDF_TextObject> m_pTextObj; CFX_Matrix m_Matrix; }; @@ -78,7 +79,7 @@ class PAGECHAR_INFO { int32_t m_Flag; CFX_PointF m_Origin; CFX_FloatRect m_CharBox; - CPDF_TextObject* m_pTextObj; + CFX_UnownedPtr<CPDF_TextObject> m_pTextObj; CFX_Matrix m_Matrix; }; @@ -162,14 +163,14 @@ class CPDF_TextPage { const CPDF_Font* pFont, int nItems) const; - const CPDF_Page* const m_pPage; + CFX_UnownedPtr<const CPDF_Page> const m_pPage; std::vector<uint16_t> m_CharIndex; std::deque<PAGECHAR_INFO> m_CharList; std::deque<PAGECHAR_INFO> m_TempCharList; CFX_WideTextBuf m_TextBuf; CFX_WideTextBuf m_TempTextBuf; const FPDFText_Direction m_parserflag; - CPDF_TextObject* m_pPreTextObj; + CFX_UnownedPtr<CPDF_TextObject> m_pPreTextObj; CFX_Matrix m_perMatrix; bool m_bIsParsed; CFX_Matrix m_DisplayMatrix; diff --git a/core/fpdftext/cpdf_textpagefind.cpp b/core/fpdftext/cpdf_textpagefind.cpp index a4f4a6e828..058c293ac1 100644 --- a/core/fpdftext/cpdf_textpagefind.cpp +++ b/core/fpdftext/cpdf_textpagefind.cpp @@ -237,7 +237,7 @@ bool CPDF_TextPageFind::FindPrev() { m_IsFind = false; return m_IsFind; } - CPDF_TextPageFind findEngine(m_pTextPage); + CPDF_TextPageFind findEngine(m_pTextPage.Get()); bool ret = findEngine.FindFirst(m_findWhat, m_flags); if (!ret) { m_IsFind = false; diff --git a/core/fpdftext/cpdf_textpagefind.h b/core/fpdftext/cpdf_textpagefind.h index dd509018bd..ed0620605a 100644 --- a/core/fpdftext/cpdf_textpagefind.h +++ b/core/fpdftext/cpdf_textpagefind.h @@ -9,6 +9,7 @@ #include <vector> +#include "core/fxcrt/cfx_unowned_ptr.h" #include "core/fxcrt/fx_coordinates.h" #include "core/fxcrt/fx_string.h" #include "core/fxcrt/fx_system.h" @@ -40,7 +41,7 @@ class CPDF_TextPageFind { private: std::vector<uint16_t> m_CharIndex; - const CPDF_TextPage* m_pTextPage; + CFX_UnownedPtr<const CPDF_TextPage> m_pTextPage; CFX_WideString m_strText; CFX_WideString m_findWhat; int m_flags; |