summaryrefslogtreecommitdiff
path: root/core/fpdftext/cpdf_textpagefind.h
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdftext/cpdf_textpagefind.h')
-rw-r--r--core/fpdftext/cpdf_textpagefind.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/core/fpdftext/cpdf_textpagefind.h b/core/fpdftext/cpdf_textpagefind.h
index ed0620605a..cf8d3d1702 100644
--- a/core/fpdftext/cpdf_textpagefind.h
+++ b/core/fpdftext/cpdf_textpagefind.h
@@ -13,6 +13,7 @@
#include "core/fxcrt/fx_coordinates.h"
#include "core/fxcrt/fx_string.h"
#include "core/fxcrt/fx_system.h"
+#include "third_party/base/optional.h"
class CPDF_TextPage;
@@ -21,7 +22,9 @@ class CPDF_TextPageFind {
explicit CPDF_TextPageFind(const CPDF_TextPage* pTextPage);
~CPDF_TextPageFind();
- bool FindFirst(const CFX_WideString& findwhat, int flags, int startPos = 0);
+ bool FindFirst(const CFX_WideString& findwhat,
+ int flags,
+ pdfium::Optional<FX_STRSIZE> startPos);
bool FindNext();
bool FindPrev();
int GetCurOrder() const;
@@ -30,13 +33,12 @@ class CPDF_TextPageFind {
protected:
void ExtractFindWhat(const CFX_WideString& findwhat);
bool IsMatchWholeWord(const CFX_WideString& csPageText,
- int startPos,
- int endPos);
+ FX_STRSIZE startPos,
+ FX_STRSIZE endPos);
bool ExtractSubString(CFX_WideString& rString,
const wchar_t* lpszFullString,
int iSubString,
wchar_t chSep);
- CFX_WideString MakeReverse(const CFX_WideString& str);
int GetCharIndex(int index) const;
private:
@@ -46,8 +48,8 @@ class CPDF_TextPageFind {
CFX_WideString m_findWhat;
int m_flags;
std::vector<CFX_WideString> m_csFindWhatArray;
- int m_findNextStart;
- int m_findPreStart;
+ pdfium::Optional<FX_STRSIZE> m_findNextStart;
+ pdfium::Optional<FX_STRSIZE> m_findPreStart;
bool m_bMatchCase;
bool m_bMatchWholeWord;
int m_resStart;