summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-08-12 07:15:14 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-08-15 16:22:30 +0000
commitae9c5cacce885fd6622689ecc8aab7571fb23938 (patch)
treee3dd356022e3521519321f6583492f5a40702ef3
parent5688d624690e1fdc3cbbbbf23a5b475f40818728 (diff)
downloadpdfium-ae9c5cacce885fd6622689ecc8aab7571fb23938.tar.xz
Remove CPWL_EditImpl_UndoItem.
This base class does not do anything useful. Change-Id: Ib8c44c1778cdc992abb66177ea534bda0f1f15d3 Reviewed-on: https://pdfium-review.googlesource.com/10851 Reviewed-by: dsinclair <dsinclair@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
-rw-r--r--fpdfsdk/pwl/cpwl_edit_impl.cpp25
-rw-r--r--fpdfsdk/pwl/cpwl_edit_impl.h43
2 files changed, 15 insertions, 53 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp
index b962e6d937..bb5725b42e 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp
@@ -273,27 +273,6 @@ void CPWL_EditImpl_Undo::Reset() {
m_nCurUndoPos = 0;
}
-CPWL_EditImpl_UndoItem::CPWL_EditImpl_UndoItem()
- : m_bFirst(true), m_bLast(true) {}
-
-CPWL_EditImpl_UndoItem::~CPWL_EditImpl_UndoItem() {}
-
-CFX_WideString CPWL_EditImpl_UndoItem::GetUndoTitle() const {
- return CFX_WideString();
-}
-
-void CPWL_EditImpl_UndoItem::SetFirst(bool bFirst) {
- m_bFirst = bFirst;
-}
-
-void CPWL_EditImpl_UndoItem::SetLast(bool bLast) {
- m_bLast = bLast;
-}
-
-bool CPWL_EditImpl_UndoItem::IsLast() {
- return m_bLast;
-}
-
CFXEU_InsertWord::CFXEU_InsertWord(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
const CPVT_WordPlace& wpNewPlace,
@@ -477,7 +456,7 @@ CFXEU_InsertText::CFXEU_InsertText(CPWL_EditImpl* pEdit,
CFXEU_InsertText::~CFXEU_InsertText() {}
void CFXEU_InsertText::Redo() {
- if (m_pEdit && IsLast()) {
+ if (m_pEdit) {
m_pEdit->SelectNone();
m_pEdit->SetCaret(m_wpOld);
m_pEdit->InsertText(m_swText, m_nCharset, false, true);
@@ -1929,7 +1908,7 @@ int32_t CPWL_EditImpl::GetCharSetFromUnicode(uint16_t word,
}
void CPWL_EditImpl::AddEditUndoItem(
- std::unique_ptr<CPWL_EditImpl_UndoItem> pEditUndoItem) {
+ std::unique_ptr<IFX_Edit_UndoItem> pEditUndoItem) {
m_Undo.AddItem(std::move(pEditUndoItem));
}
diff --git a/fpdfsdk/pwl/cpwl_edit_impl.h b/fpdfsdk/pwl/cpwl_edit_impl.h
index 48b94c1057..d65610dc43 100644
--- a/fpdfsdk/pwl/cpwl_edit_impl.h
+++ b/fpdfsdk/pwl/cpwl_edit_impl.h
@@ -129,26 +129,9 @@ class IFX_Edit_UndoItem {
virtual void Undo() = 0;
virtual void Redo() = 0;
- virtual CFX_WideString GetUndoTitle() const = 0;
};
-class CPWL_EditImpl_UndoItem : public IFX_Edit_UndoItem {
- public:
- CPWL_EditImpl_UndoItem();
- ~CPWL_EditImpl_UndoItem() override;
-
- CFX_WideString GetUndoTitle() const override;
-
- void SetFirst(bool bFirst);
- void SetLast(bool bLast);
- bool IsLast();
-
- private:
- bool m_bFirst;
- bool m_bLast;
-};
-
-class CFXEU_InsertWord : public CPWL_EditImpl_UndoItem {
+class CFXEU_InsertWord : public IFX_Edit_UndoItem {
public:
CFXEU_InsertWord(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
@@ -158,7 +141,7 @@ class CFXEU_InsertWord : public CPWL_EditImpl_UndoItem {
const CPVT_WordProps* pWordProps);
~CFXEU_InsertWord() override;
- // CPWL_EditImpl_UndoItem
+ // IFX_Edit_UndoItem:
void Redo() override;
void Undo() override;
@@ -172,7 +155,7 @@ class CFXEU_InsertWord : public CPWL_EditImpl_UndoItem {
CPVT_WordProps m_WordProps;
};
-class CFXEU_InsertReturn : public CPWL_EditImpl_UndoItem {
+class CFXEU_InsertReturn : public IFX_Edit_UndoItem {
public:
CFXEU_InsertReturn(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
@@ -181,7 +164,7 @@ class CFXEU_InsertReturn : public CPWL_EditImpl_UndoItem {
const CPVT_WordProps* pWordProps);
~CFXEU_InsertReturn() override;
- // CPWL_EditImpl_UndoItem
+ // IFX_Edit_UndoItem:
void Redo() override;
void Undo() override;
@@ -194,7 +177,7 @@ class CFXEU_InsertReturn : public CPWL_EditImpl_UndoItem {
CPVT_WordProps m_WordProps;
};
-class CFXEU_Backspace : public CPWL_EditImpl_UndoItem {
+class CFXEU_Backspace : public IFX_Edit_UndoItem {
public:
CFXEU_Backspace(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
@@ -205,7 +188,7 @@ class CFXEU_Backspace : public CPWL_EditImpl_UndoItem {
const CPVT_WordProps& WordProps);
~CFXEU_Backspace() override;
- // CPWL_EditImpl_UndoItem
+ // IFX_Edit_UndoItem:
void Redo() override;
void Undo() override;
@@ -220,7 +203,7 @@ class CFXEU_Backspace : public CPWL_EditImpl_UndoItem {
CPVT_WordProps m_WordProps;
};
-class CFXEU_Delete : public CPWL_EditImpl_UndoItem {
+class CFXEU_Delete : public IFX_Edit_UndoItem {
public:
CFXEU_Delete(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
@@ -232,7 +215,7 @@ class CFXEU_Delete : public CPWL_EditImpl_UndoItem {
bool bSecEnd);
~CFXEU_Delete() override;
- // CPWL_EditImpl_UndoItem
+ // IFX_Edit_UndoItem:
void Redo() override;
void Undo() override;
@@ -248,14 +231,14 @@ class CFXEU_Delete : public CPWL_EditImpl_UndoItem {
bool m_bSecEnd;
};
-class CFXEU_Clear : public CPWL_EditImpl_UndoItem {
+class CFXEU_Clear : public IFX_Edit_UndoItem {
public:
CFXEU_Clear(CPWL_EditImpl* pEdit,
const CPVT_WordRange& wrSel,
const CFX_WideString& swText);
~CFXEU_Clear() override;
- // CPWL_EditImpl_UndoItem
+ // IFX_Edit_UndoItem:
void Redo() override;
void Undo() override;
@@ -266,7 +249,7 @@ class CFXEU_Clear : public CPWL_EditImpl_UndoItem {
CFX_WideString m_swText;
};
-class CFXEU_InsertText : public CPWL_EditImpl_UndoItem {
+class CFXEU_InsertText : public IFX_Edit_UndoItem {
public:
CFXEU_InsertText(CPWL_EditImpl* pEdit,
const CPVT_WordPlace& wpOldPlace,
@@ -275,7 +258,7 @@ class CFXEU_InsertText : public CPWL_EditImpl_UndoItem {
int32_t charset);
~CFXEU_InsertText() override;
- // CPWL_EditImpl_UndoItem
+ // IFX_Edit_UndoItem:
void Redo() override;
void Undo() override;
@@ -445,7 +428,7 @@ class CPWL_EditImpl {
void SetCaretInfo();
void SetCaretOrigin();
- void AddEditUndoItem(std::unique_ptr<CPWL_EditImpl_UndoItem> pEditUndoItem);
+ void AddEditUndoItem(std::unique_ptr<IFX_Edit_UndoItem> pEditUndoItem);
private:
std::unique_ptr<CPDF_VariableText> m_pVT;