diff options
author | Lei Zhang <thestig@chromium.org> | 2017-03-22 17:41:02 -0700 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-03-23 01:04:48 +0000 |
commit | a8c2b919f7adec510cbca49675ad4a0cd0d30fd9 (patch) | |
tree | af385e573c920ded6ca2e6488101477f626cab43 /fpdfsdk/fxedit | |
parent | d9d20a47e2c9af8630536786d614eaed229056a8 (diff) | |
download | pdfium-a8c2b919f7adec510cbca49675ad4a0cd0d30fd9.tar.xz |
Remove dead CFX_Edit code and fix some typos.
Change-Id: Ieaac36e06db3d1e2b857d999a7d3d9cd5c5a9506
Reviewed-on: https://pdfium-review.googlesource.com/3118
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'fpdfsdk/fxedit')
-rw-r--r-- | fpdfsdk/fxedit/fxet_edit.cpp | 21 | ||||
-rw-r--r-- | fpdfsdk/fxedit/fxet_edit.h | 1 |
2 files changed, 6 insertions, 16 deletions
diff --git a/fpdfsdk/fxedit/fxet_edit.cpp b/fpdfsdk/fxedit/fxet_edit.cpp index 20f584e183..884232dc76 100644 --- a/fpdfsdk/fxedit/fxet_edit.cpp +++ b/fpdfsdk/fxedit/fxet_edit.cpp @@ -1074,10 +1074,6 @@ CFX_WideString CFX_Edit::GetSelText() const { return GetRangeText(m_SelState.ConvertToWordRange()); } -int32_t CFX_Edit::GetTotalWords() const { - return m_pVT->GetTotalWords(); -} - int32_t CFX_Edit::GetTotalLines() const { int32_t nLines = 1; @@ -1215,11 +1211,6 @@ void CFX_Edit::SetContentChanged() { CFX_FloatRect rcContent = m_pVT->GetContentRect(); if (rcContent.Width() != m_rcOldContent.Width() || rcContent.Height() != m_rcOldContent.Height()) { - if (!m_bNotifyFlag) { - m_bNotifyFlag = true; - m_pNotify->IOnContentChange(rcContent); - m_bNotifyFlag = false; - } m_rcOldContent = rcContent; } } @@ -1305,11 +1296,11 @@ void CFX_Edit::SetScrollInfo() { CFX_FloatRect rcContent = m_pVT->GetContentRect(); if (!m_bNotifyFlag) { + CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag); m_bNotifyFlag = true; m_pNotify->IOnSetScrollInfoY(rcPlate.bottom, rcPlate.top, rcContent.bottom, rcContent.top, rcPlate.Height() / 3, rcPlate.Height()); - m_bNotifyFlag = false; } } } @@ -1337,9 +1328,9 @@ void CFX_Edit::SetScrollPosY(float fy) { if (m_pNotify) { if (!m_bNotifyFlag) { + CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag); m_bNotifyFlag = true; m_pNotify->IOnSetScrollPosY(fy); - m_bNotifyFlag = false; } } } @@ -1447,12 +1438,12 @@ void CFX_Edit::Refresh() { if (m_pNotify) { if (!m_bNotifyFlag) { + CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag); m_bNotifyFlag = true; if (const CFX_Edit_RectArray* pRects = m_Refresh.GetRefreshRects()) { for (int32_t i = 0, sz = pRects->GetSize(); i < sz; i++) m_pNotify->IOnInvalidateRect(pRects->GetAt(i)); } - m_bNotifyFlag = false; } } @@ -1516,10 +1507,10 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) { if (m_pNotify) { if (!m_bNotifyFlag) { + CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag); m_bNotifyFlag = true; CFX_FloatRect rcRefresh = VTToEdit(rcWord); m_pNotify->IOnInvalidateRect(&rcRefresh); - m_bNotifyFlag = false; } } } else { @@ -1530,10 +1521,10 @@ void CFX_Edit::RefreshWordRange(const CPVT_WordRange& wr) { if (m_pNotify) { if (!m_bNotifyFlag) { + CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag); m_bNotifyFlag = true; CFX_FloatRect rcRefresh = VTToEdit(rcLine); m_pNotify->IOnInvalidateRect(&rcRefresh); - m_bNotifyFlag = false; } } @@ -1569,10 +1560,10 @@ void CFX_Edit::SetCaretInfo() { ptFoot.y = line.ptLine.y + line.fLineDescent; } + CFX_AutoRestorer<bool> restorer(&m_bNotifyFlag); m_bNotifyFlag = true; m_pNotify->IOnSetCaret(m_SelState.IsEmpty(), VTToEdit(ptHead), VTToEdit(ptFoot), m_wpCaret); - m_bNotifyFlag = false; } } } diff --git a/fpdfsdk/fxedit/fxet_edit.h b/fpdfsdk/fxedit/fxet_edit.h index 08a13a87bd..a279d1c1b6 100644 --- a/fpdfsdk/fxedit/fxet_edit.h +++ b/fpdfsdk/fxedit/fxet_edit.h @@ -396,7 +396,6 @@ class CFX_Edit { CFX_WideString GetRangeText(const CPVT_WordRange& range) const; int32_t GetHorzScale() const; float GetCharSpace() const; - int32_t GetTotalWords() const; void SetSel(int32_t nStartChar, int32_t nEndChar); void GetSel(int32_t& nStartChar, int32_t& nEndChar) const; void SelectAll(); |