diff options
author | Lei Zhang <thestig@chromium.org> | 2017-08-12 07:04:19 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-08-15 16:02:50 +0000 |
commit | 5688d624690e1fdc3cbbbbf23a5b475f40818728 (patch) | |
tree | 529079e7e8677d7ca305d4cf0dc0dd9b1bf96f3d /fpdfsdk/pwl | |
parent | 28549c91b9fb7bdc637466218348b0759e251456 (diff) | |
download | pdfium-5688d624690e1fdc3cbbbbf23a5b475f40818728.tar.xz |
Remove CPWL_EditImpl::EnableOprNotify().
It's redundant with SetOprNotify().
Change-Id: Iee2741744017ea6bd1b9839fc6395197c560f1e7
Reviewed-on: https://pdfium-review.googlesource.com/10850
Reviewed-by: dsinclair <dsinclair@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
Diffstat (limited to 'fpdfsdk/pwl')
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit.cpp | 3 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit_impl.cpp | 43 | ||||
-rw-r--r-- | fpdfsdk/pwl/cpwl_edit_impl.h | 6 |
3 files changed, 19 insertions, 33 deletions
diff --git a/fpdfsdk/pwl/cpwl_edit.cpp b/fpdfsdk/pwl/cpwl_edit.cpp index 4a19e70eb6..2f3f20b4dd 100644 --- a/fpdfsdk/pwl/cpwl_edit.cpp +++ b/fpdfsdk/pwl/cpwl_edit.cpp @@ -151,8 +151,7 @@ void CPWL_Edit::OnCreated() { m_rcOldWindow = GetWindowRect(); - m_pEdit->SetOprNotify(this); - m_pEdit->EnableOprNotify(true); + m_pEdit->SetOperationNotify(this); } void CPWL_Edit::SetParamByFlag() { diff --git a/fpdfsdk/pwl/cpwl_edit_impl.cpp b/fpdfsdk/pwl/cpwl_edit_impl.cpp index c59a74068d..b962e6d937 100644 --- a/fpdfsdk/pwl/cpwl_edit_impl.cpp +++ b/fpdfsdk/pwl/cpwl_edit_impl.cpp @@ -611,21 +611,14 @@ void CPWL_EditImpl::DrawEdit(CFX_RenderDevice* pDevice, } CPWL_EditImpl::CPWL_EditImpl() - : m_pVT(new CPDF_VariableText), - m_pNotify(nullptr), - m_pOprNotify(nullptr), - m_wpCaret(-1, -1, -1), - m_wpOldCaret(-1, -1, -1), - m_SelState(), + : m_pVT(pdfium::MakeUnique<CPDF_VariableText>()), m_bEnableScroll(false), m_Undo(kEditUndoMaxItems), m_nAlignment(0), m_bNotifyFlag(false), m_bEnableOverflow(false), m_bEnableRefresh(true), - m_rcOldContent(0.0f, 0.0f, 0.0f, 0.0f), - m_bEnableUndo(true), - m_bOprNotify(false) {} + m_bEnableUndo(true) {} CPWL_EditImpl::~CPWL_EditImpl() {} @@ -644,8 +637,8 @@ void CPWL_EditImpl::SetNotify(CPWL_EditCtrl* pNotify) { m_pNotify = pNotify; } -void CPWL_EditImpl::SetOprNotify(CPWL_Edit* pOprNotify) { - m_pOprNotify = pOprNotify; +void CPWL_EditImpl::SetOperationNotify(CPWL_Edit* pOperationNotify) { + m_pOperationNotify = pOperationNotify; } CPWL_EditImpl_Iterator* CPWL_EditImpl::GetIterator() { @@ -1608,8 +1601,8 @@ bool CPWL_EditImpl::InsertWord(uint16_t word, if (bPaint) PaintInsertText(m_wpOldCaret, m_wpCaret); - if (m_bOprNotify && m_pOprNotify) - m_pOprNotify->OnInsertWord(m_wpCaret, m_wpOldCaret); + if (m_pOperationNotify) + m_pOperationNotify->OnInsertWord(m_wpCaret, m_wpOldCaret); return true; } @@ -1638,8 +1631,8 @@ bool CPWL_EditImpl::InsertReturn(const CPVT_SecProps* pSecProps, SetCaretOrigin(); SetCaretInfo(); } - if (m_bOprNotify && m_pOprNotify) - m_pOprNotify->OnInsertReturn(m_wpCaret, m_wpOldCaret); + if (m_pOperationNotify) + m_pOperationNotify->OnInsertReturn(m_wpCaret, m_wpOldCaret); return true; } @@ -1680,8 +1673,8 @@ bool CPWL_EditImpl::Backspace(bool bAddUndo, bool bPaint) { SetCaretOrigin(); SetCaretInfo(); } - if (m_bOprNotify && m_pOprNotify) - m_pOprNotify->OnBackSpace(m_wpCaret, m_wpOldCaret); + if (m_pOperationNotify) + m_pOperationNotify->OnBackSpace(m_wpCaret, m_wpOldCaret); return true; } @@ -1720,8 +1713,8 @@ bool CPWL_EditImpl::Delete(bool bAddUndo, bool bPaint) { SetCaretOrigin(); SetCaretInfo(); } - if (m_bOprNotify && m_pOprNotify) - m_pOprNotify->OnDelete(m_wpCaret, m_wpOldCaret); + if (m_pOperationNotify) + m_pOperationNotify->OnDelete(m_wpCaret, m_wpOldCaret); return true; } @@ -1757,8 +1750,8 @@ bool CPWL_EditImpl::Clear(bool bAddUndo, bool bPaint) { SetCaretOrigin(); SetCaretInfo(); } - if (m_bOprNotify && m_pOprNotify) - m_pOprNotify->OnClear(m_wpCaret, m_wpOldCaret); + if (m_pOperationNotify) + m_pOperationNotify->OnClear(m_wpCaret, m_wpOldCaret); return true; } @@ -1783,8 +1776,8 @@ bool CPWL_EditImpl::InsertText(const CFX_WideString& sText, if (bPaint) PaintInsertText(m_wpOldCaret, m_wpCaret); - if (m_bOprNotify && m_pOprNotify) - m_pOprNotify->OnInsertText(m_wpCaret, m_wpOldCaret); + if (m_pOperationNotify) + m_pOperationNotify->OnInsertText(m_wpCaret, m_wpOldCaret); return true; } @@ -1896,10 +1889,6 @@ void CPWL_EditImpl::EnableUndo(bool bUndo) { m_bEnableUndo = bUndo; } -void CPWL_EditImpl::EnableOprNotify(bool bNotify) { - m_bOprNotify = bNotify; -} - CPVT_WordPlace CPWL_EditImpl::DoInsertText(const CPVT_WordPlace& place, const CFX_WideString& sText, int32_t charset) { diff --git a/fpdfsdk/pwl/cpwl_edit_impl.h b/fpdfsdk/pwl/cpwl_edit_impl.h index 697ca84994..48b94c1057 100644 --- a/fpdfsdk/pwl/cpwl_edit_impl.h +++ b/fpdfsdk/pwl/cpwl_edit_impl.h @@ -305,7 +305,7 @@ class CPWL_EditImpl { void SetFontMap(IPVT_FontMap* pFontMap); void SetNotify(CPWL_EditCtrl* pNotify); - void SetOprNotify(CPWL_Edit* pOprNotify); + void SetOperationNotify(CPWL_Edit* pOperationNotify); // Returns an iterator for the contents. Should not be released. CPWL_EditImpl_Iterator* GetIterator(); @@ -376,7 +376,6 @@ class CPWL_EditImpl { CPVT_WordRange GetWholeWordRange() const; CPVT_WordRange GetSelectWordRange() const; void EnableUndo(bool bUndo); - void EnableOprNotify(bool bNotify); bool IsTextFull() const; bool IsTextOverflow() const; bool CanUndo() const; @@ -451,7 +450,7 @@ class CPWL_EditImpl { private: std::unique_ptr<CPDF_VariableText> m_pVT; CFX_UnownedPtr<CPWL_EditCtrl> m_pNotify; - CFX_UnownedPtr<CPWL_Edit> m_pOprNotify; + CFX_UnownedPtr<CPWL_Edit> m_pOperationNotify; std::unique_ptr<CPWL_EditImpl_Provider> m_pVTProvider; CPVT_WordPlace m_wpCaret; CPVT_WordPlace m_wpOldCaret; @@ -469,7 +468,6 @@ class CPWL_EditImpl { bool m_bEnableRefresh; CFX_FloatRect m_rcOldContent; bool m_bEnableUndo; - bool m_bOprNotify; }; class CPWL_EditImpl_Iterator { |