Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Unified Diff: xfa/fee/fde_txtedtbuf.h

Issue 1927973003: Remove IFDE_TxtEdt interfaces where possible. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa.gyp ('k') | xfa/fee/fde_txtedtbuf.cpp » ('j') | xfa/fee/fde_txtedtparag.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fee/fde_txtedtbuf.h
diff --git a/xfa/fee/fde_txtedtbuf.h b/xfa/fee/fde_txtedtbuf.h
index 102217da87327a32af16de4e9d67665c71f5034b..710b0f2663ac4f8e60d3496d21df83a74d913436 100644
--- a/xfa/fee/fde_txtedtbuf.h
+++ b/xfa/fee/fde_txtedtbuf.h
@@ -7,10 +7,11 @@
#ifndef XFA_FEE_FDE_TXTEDTBUF_H_
#define XFA_FEE_FDE_TXTEDTBUF_H_
-#include "xfa/fee/ifde_txtedtbuf.h"
#include "xfa/fee/ifde_txtedtengine.h"
#include "xfa/fgas/crt/fgas_memory.h"
+#define FDE_DEFCHUNKLENGTH (1024)
Tom Sepez 2016/04/28 16:51:09 nit: why ()?
dsinclair 2016/04/28 17:35:56 Moved to an anonymous const inside the .cpp.
+
class IFX_CharIter;
class CFDE_TxtEdtBuf;
@@ -36,47 +37,43 @@ class CFDE_TxtEdtBufIter : public IFX_CharIter {
int32_t m_nIndex;
FX_WCHAR m_Alias;
};
-class CFDE_TxtEdtBuf : public IFDE_TxtEdtBuf {
+class CFDE_TxtEdtBuf {
+ public:
+ CFDE_TxtEdtBuf(int32_t nDefChunkSize = FDE_DEFCHUNKLENGTH);
+
+ void Release();
+ FX_BOOL SetChunkSize(int32_t nChunkSize);
+ int32_t GetChunkSize() const;
+ int32_t GetTextLength() const;
+ void SetText(const CFX_WideString& wsText);
+ void GetText(CFX_WideString& wsText) const;
+ FX_WCHAR GetCharByIndex(int32_t nIndex) const;
+ void GetRange(CFX_WideString& wsText,
+ int32_t nBegine,
+ int32_t nCount = -1) const;
Tom Sepez 2016/04/28 16:51:09 nit: sp. nBegin
dsinclair 2016/04/28 17:35:56 Done.
+
+ void Insert(int32_t nPos, const FX_WCHAR* lpText, int32_t nLength = 1);
+ void Delete(int32_t nIndex, int32_t nLength = 1);
+ void Clear(FX_BOOL bRelease = TRUE);
+
+ FX_BOOL Optimize(IFX_Pause* pPause = NULL);
Tom Sepez 2016/04/28 16:51:09 nit: nullptr
dsinclair 2016/04/28 17:35:56 Done.
+
+ protected:
+ ~CFDE_TxtEdtBuf();
+
+ private:
friend class CFDE_TxtEdtBufIter;
- struct _FDE_CHUNKHEADER {
+
+ struct FDE_CHUNKHEADER {
int32_t nUsed;
FX_WCHAR wChars[1];
};
- typedef _FDE_CHUNKHEADER FDE_CHUNKHEADER;
- typedef _FDE_CHUNKHEADER* FDE_LPCHUNKHEADER;
- struct _FDE_CHUNKPLACE {
+
+ struct FDE_CHUNKPLACE {
int32_t nChunkIndex;
int32_t nCharIndex;
};
- typedef _FDE_CHUNKPLACE FDE_CHUNKPLACE;
- typedef _FDE_CHUNKPLACE* FDE_LPCHUNKPLACE;
-
- public:
- CFDE_TxtEdtBuf(int32_t nDefChunkSize = FDE_DEFCHUNKLENGTH);
- virtual void Release();
- virtual FX_BOOL SetChunkSize(int32_t nChunkSize);
- virtual int32_t GetChunkSize() const;
- virtual int32_t GetTextLength() const;
- virtual void SetText(const CFX_WideString& wsText);
- virtual void GetText(CFX_WideString& wsText) const;
- virtual FX_WCHAR GetCharByIndex(int32_t nIndex) const;
- virtual void GetRange(CFX_WideString& wsText,
- int32_t nBegine,
- int32_t nCount = -1) const;
-
- virtual void Insert(int32_t nPos,
- const FX_WCHAR* lpText,
- int32_t nLength = 1);
- virtual void Delete(int32_t nIndex, int32_t nLength = 1);
- virtual void Clear(FX_BOOL bRelease = TRUE);
-
- virtual FX_BOOL Optimize(IFX_Pause* pPause = NULL);
-
- protected:
- virtual ~CFDE_TxtEdtBuf();
-
- private:
void ResetChunkBuffer(int32_t nDefChunkCount, int32_t nChunkSize);
int32_t CP2Index(const FDE_CHUNKPLACE& cp) const;
void Index2CP(int32_t nIndex, FDE_CHUNKPLACE& cp) const;
« no previous file with comments | « xfa.gyp ('k') | xfa/fee/fde_txtedtbuf.cpp » ('j') | xfa/fee/fde_txtedtparag.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698