From 2d0f6c26824cbf68eb8c5a7490d0bb74965c41b6 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Tue, 4 Sep 2012 19:07:18 +1000 Subject: Cache the CaseFolder object between FindText calls so that finding many instances of a common string in the document doesn't spend excessive time constructing case folder objects. --- src/Document.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/Document.h') diff --git a/src/Document.h b/src/Document.h index 30c6aee1c..36d670937 100644 --- a/src/Document.h +++ b/src/Document.h @@ -212,6 +212,7 @@ private: int refCount; CellBuffer cb; CharClassify charClass; + CaseFolder *pcf; char stylingMask; int endStyled; int styleClock; @@ -255,6 +256,7 @@ public: int SCI_METHOD Release(); virtual void Init(); + bool SetDBCSCodePage(int dbcsCodePage_); virtual void InsertLine(int line); virtual void RemoveLine(int line); @@ -355,8 +357,10 @@ public: int SCI_METHOD Length() const { return cb.Length(); } void Allocate(int newSize) { cb.Allocate(newSize); } bool MatchesWordOptions(bool word, bool wordStart, int pos, int length); + bool HasCaseFolder(void) const; + void SetCaseFolder(CaseFolder *pcf_); long FindText(int minPos, int maxPos, const char *search, bool caseSensitive, bool word, - bool wordStart, bool regExp, int flags, int *length, CaseFolder *pcf); + bool wordStart, bool regExp, int flags, int *length); const char *SubstituteByPosition(const char *text, int *length); int LinesTotal() const; -- cgit v1.2.3