diff options
author | dsinclair <dsinclair@chromium.org> | 2016-05-18 06:09:33 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-05-18 06:09:33 -0700 |
commit | be9b8947d0090e20116822fe7caf5e7973d6b20a (patch) | |
tree | b88d67f0ed52956ad5d918110f449ecffa2f2a87 /xfa/fee/fde_txtedtengine.h | |
parent | 56286b311543331d02fee90b832d66389a307961 (diff) | |
download | pdfium-be9b8947d0090e20116822fe7caf5e7973d6b20a.tar.xz |
Pass objects instead of strings for undo/redo records.
Currently the Undo/Redo records are serialized as byte strings and stored
into a CFX_ByteStringArray. They are deserialized when used.
This CL removes the serialization and stores the objects in a deque of unique
pointers.
Review-Url: https://codereview.chromium.org/1980293004
Diffstat (limited to 'xfa/fee/fde_txtedtengine.h')
-rw-r--r-- | xfa/fee/fde_txtedtengine.h | 34 |
1 files changed, 11 insertions, 23 deletions
diff --git a/xfa/fee/fde_txtedtengine.h b/xfa/fee/fde_txtedtengine.h index 4671bf549a..585caa1eb6 100644 --- a/xfa/fee/fde_txtedtengine.h +++ b/xfa/fee/fde_txtedtengine.h @@ -20,12 +20,10 @@ class CFDE_TxtEdtDoRecord_DeleteRange; class IFDE_TxtEdtDoRecord { public: - static IFDE_TxtEdtDoRecord* Create(const CFX_ByteStringC& bsDoRecord); virtual ~IFDE_TxtEdtDoRecord() {} - virtual void Release() = 0; - virtual FX_BOOL Redo() = 0; - virtual FX_BOOL Undo() = 0; - virtual void Serialize(CFX_ByteString& bsDoRecord) const = 0; + + virtual FX_BOOL Redo() const = 0; + virtual FX_BOOL Undo() const = 0; }; class CFDE_TxtEdtEngine { @@ -74,8 +72,8 @@ class CFDE_TxtEdtEngine { int32_t GetSelRange(int32_t nIndex, int32_t& nStart); void ClearSelection(); - FX_BOOL Redo(const CFX_ByteStringC& bsRedo); - FX_BOOL Undo(const CFX_ByteStringC& bsUndo); + FX_BOOL Redo(const IFDE_TxtEdtDoRecord* pRecord); + FX_BOOL Undo(const IFDE_TxtEdtDoRecord* pRecord); int32_t StartLayout(); int32_t DoLayout(IFX_Pause* pPause); @@ -195,19 +193,14 @@ class CFDE_TxtEdtEngine { class CFDE_TxtEdtDoRecord_Insert : public IFDE_TxtEdtDoRecord { public: - CFDE_TxtEdtDoRecord_Insert(const CFX_ByteStringC& bsDoRecord); CFDE_TxtEdtDoRecord_Insert(CFDE_TxtEdtEngine* pEngine, int32_t nCaret, const FX_WCHAR* lpText, int32_t nLength); - virtual void Release(); - virtual FX_BOOL Undo(); - virtual FX_BOOL Redo(); - virtual void Serialize(CFX_ByteString& bsDoRecord) const; + ~CFDE_TxtEdtDoRecord_Insert() override; - protected: - ~CFDE_TxtEdtDoRecord_Insert(); - void Deserialize(const CFX_ByteStringC& bsDoRecord); + FX_BOOL Undo() const override; + FX_BOOL Redo() const override; private: CFDE_TxtEdtEngine* m_pEngine; @@ -217,20 +210,15 @@ class CFDE_TxtEdtDoRecord_Insert : public IFDE_TxtEdtDoRecord { class CFDE_TxtEdtDoRecord_DeleteRange : public IFDE_TxtEdtDoRecord { public: - CFDE_TxtEdtDoRecord_DeleteRange(const CFX_ByteStringC& bsDoRecord); CFDE_TxtEdtDoRecord_DeleteRange(CFDE_TxtEdtEngine* pEngine, int32_t nIndex, int32_t nCaret, const CFX_WideString& wsRange, FX_BOOL bSel = FALSE); - virtual void Release(); - virtual FX_BOOL Undo(); - virtual FX_BOOL Redo(); - virtual void Serialize(CFX_ByteString& bsDoRecord) const; + ~CFDE_TxtEdtDoRecord_DeleteRange() override; - protected: - ~CFDE_TxtEdtDoRecord_DeleteRange(); - void Deserialize(const CFX_ByteStringC& bsDoRecord); + FX_BOOL Undo() const override; + FX_BOOL Redo() const override; private: CFDE_TxtEdtEngine* m_pEngine; |