diff options
author | dsinclair <dsinclair@chromium.org> | 2016-11-10 14:01:19 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-10 14:01:19 -0800 |
commit | 522c3d414e26a8a6b14407d664cee38fa3f52c07 (patch) | |
tree | c28e0d90fb00dd51860784504a5bd2b5ac161e9c /xfa/fxfa/app | |
parent | 08959c6b72b4fff388e2771b04929a3abc8f6615 (diff) | |
download | pdfium-522c3d414e26a8a6b14407d664cee38fa3f52c07.tar.xz |
IFWL method and param cleanup
Cleaning up virtual methods, unused methods, and visibility.
Review-Url: https://codereview.chromium.org/2491103002
Diffstat (limited to 'xfa/fxfa/app')
-rw-r--r-- | xfa/fxfa/app/xfa_fftextedit.cpp | 117 | ||||
-rw-r--r-- | xfa/fxfa/app/xfa_fftextedit.h | 33 |
2 files changed, 1 insertions, 149 deletions
diff --git a/xfa/fxfa/app/xfa_fftextedit.cpp b/xfa/fxfa/app/xfa_fftextedit.cpp index 2b47ae2495..e851cb29c2 100644 --- a/xfa/fxfa/app/xfa_fftextedit.cpp +++ b/xfa/fxfa/app/xfa_fftextedit.cpp @@ -289,72 +289,6 @@ bool CXFA_FFTextEdit::UpdateFWLData() { } return true; } -bool CXFA_FFTextEdit::CanUndo() { - return ((CFWL_Edit*)m_pNormalWidget)->CanUndo(); -} -bool CXFA_FFTextEdit::CanRedo() { - return ((CFWL_Edit*)m_pNormalWidget)->CanRedo(); -} -bool CXFA_FFTextEdit::Undo() { - return ((CFWL_Edit*)m_pNormalWidget)->Undo(); -} -bool CXFA_FFTextEdit::Redo() { - return ((CFWL_Edit*)m_pNormalWidget)->Redo(); -} -bool CXFA_FFTextEdit::CanCopy() { - int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); - return nCount > 0; -} -bool CXFA_FFTextEdit::CanCut() { - if (m_pNormalWidget->GetStylesEx() & FWL_STYLEEXT_EDT_ReadOnly) { - return false; - } - int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->CountSelRanges(); - return nCount > 0; -} -bool CXFA_FFTextEdit::CanPaste() { - return m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open; -} -bool CXFA_FFTextEdit::CanSelectAll() { - return ((CFWL_Edit*)m_pNormalWidget)->GetTextLength() > 0; -} -bool CXFA_FFTextEdit::Copy(CFX_WideString& wsCopy) { - return ((CFWL_Edit*)m_pNormalWidget)->Copy(wsCopy); -} -bool CXFA_FFTextEdit::Cut(CFX_WideString& wsCut) { - return ((CFWL_Edit*)m_pNormalWidget)->Cut(wsCut); -} -bool CXFA_FFTextEdit::Paste(const CFX_WideString& wsPaste) { - return ((CFWL_Edit*)m_pNormalWidget)->Paste(wsPaste); -} -bool CXFA_FFTextEdit::SelectAll() { - int32_t nCount = ((CFWL_Edit*)m_pNormalWidget)->GetTextLength(); - return ((CFWL_Edit*)m_pNormalWidget)->AddSelRange(0, nCount) >= 0; -} -bool CXFA_FFTextEdit::Delete() { - return ((CFWL_Edit*)m_pNormalWidget)->Delete(); -} -bool CXFA_FFTextEdit::DeSelect() { - return ((CFWL_Edit*)m_pNormalWidget)->ClearSelections() == - FWL_Error::Succeeded; -} -bool CXFA_FFTextEdit::GetSuggestWords(CFX_PointF pointf, - std::vector<CFX_ByteString>& sSuggest) { - if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) { - return false; - } - FWLToClient(pointf.x, pointf.y); - return ((CFWL_Edit*)m_pNormalWidget)->GetSuggestWords(pointf, sSuggest); -} -bool CXFA_FFTextEdit::ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace) { - if (m_pDataAcc->GetUIType() != XFA_Element::TextEdit) { - return false; - } - FWLToClient(pointf.x, pointf.y); - return ((CFWL_Edit*)m_pNormalWidget) - ->ReplaceSpellCheckWord(pointf, bsReplace); -} void CXFA_FFTextEdit::OnTextChanged(IFWL_Widget* pWidget, const CFX_WideString& wsChanged, const CFX_WideString& wsPrevText) { @@ -417,11 +351,6 @@ void CXFA_FFTextEdit::OnProcessEvent(CFWL_Event* pEvent) { event->bCheckWord = CheckWord(event->bsWord.AsStringC()); break; } - case CFWL_EventType::GetSuggestedWords: { - CFWL_EvtEdtGetSuggestWords* event = (CFWL_EvtEdtGetSuggestWords*)pEvent; - event->bSuggestWords = false; - break; - } default: break; } @@ -726,51 +655,7 @@ bool CXFA_FFDateTimeEdit::IsDataChanged() { m_pDataAcc->GetValue(wsOldValue, XFA_VALUEPICTURE_Edit); return wsOldValue != wsText; } -bool CXFA_FFDateTimeEdit::CanUndo() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanUndo(); -} -bool CXFA_FFDateTimeEdit::CanRedo() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanRedo(); -} -bool CXFA_FFDateTimeEdit::Undo() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->Undo(); -} -bool CXFA_FFDateTimeEdit::Redo() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->Redo(); -} -bool CXFA_FFDateTimeEdit::CanCopy() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanCopy(); -} -bool CXFA_FFDateTimeEdit::CanCut() { - if (m_pDataAcc->GetAccess() != XFA_ATTRIBUTEENUM_Open) { - return false; - } - return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanCut(); -} -bool CXFA_FFDateTimeEdit::CanPaste() { - return m_pDataAcc->GetAccess() == XFA_ATTRIBUTEENUM_Open; -} -bool CXFA_FFDateTimeEdit::CanSelectAll() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->CanSelectAll(); -} -bool CXFA_FFDateTimeEdit::Copy(CFX_WideString& wsCopy) { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->Copy(wsCopy); -} -bool CXFA_FFDateTimeEdit::Cut(CFX_WideString& wsCut) { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->Cut(wsCut); -} -bool CXFA_FFDateTimeEdit::Paste(const CFX_WideString& wsPaste) { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->Paste(wsPaste); -} -bool CXFA_FFDateTimeEdit::SelectAll() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->SelectAll(); -} -bool CXFA_FFDateTimeEdit::Delete() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->Delete(); -} -bool CXFA_FFDateTimeEdit::DeSelect() { - return ((CFWL_DateTimePicker*)m_pNormalWidget)->DeSelect(); -} + void CXFA_FFDateTimeEdit::OnSelectChanged(IFWL_Widget* pWidget, int32_t iYear, int32_t iMonth, diff --git a/xfa/fxfa/app/xfa_fftextedit.h b/xfa/fxfa/app/xfa_fftextedit.h index 917d6cf17e..115b3706a2 100644 --- a/xfa/fxfa/app/xfa_fftextedit.h +++ b/xfa/fxfa/app/xfa_fftextedit.h @@ -24,24 +24,6 @@ class CXFA_FFTextEdit : public CXFA_FFField { bool OnRButtonUp(uint32_t dwFlags, FX_FLOAT fx, FX_FLOAT fy) override; bool OnSetFocus(CXFA_FFWidget* pOldWidget) override; bool OnKillFocus(CXFA_FFWidget* pNewWidget) override; - bool CanUndo() override; - bool CanRedo() override; - bool Undo() override; - bool Redo() override; - bool CanCopy() override; - bool CanCut() override; - bool CanPaste() override; - bool CanSelectAll() override; - bool Copy(CFX_WideString& wsCopy) override; - bool Cut(CFX_WideString& wsCut) override; - bool Paste(const CFX_WideString& wsPaste) override; - bool SelectAll() override; - bool Delete() override; - bool DeSelect() override; - bool GetSuggestWords(CFX_PointF pointf, - std::vector<CFX_ByteString>& sSuggest) override; - bool ReplaceSpellCheckWord(CFX_PointF pointf, - const CFX_ByteStringC& bsReplace) override; void OnProcessMessage(CFWL_Message* pMessage) override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnDrawWidget(CFX_Graphics* pGraphics, @@ -107,21 +89,6 @@ class CXFA_FFDateTimeEdit : public CXFA_FFTextEdit { bool bDrawFocus = false) override; bool LoadWidget() override; void UpdateWidgetProperty() override; - - bool CanUndo() override; - bool CanRedo() override; - bool Undo() override; - bool Redo() override; - bool CanCopy() override; - bool CanCut() override; - bool CanPaste() override; - bool CanSelectAll() override; - bool Copy(CFX_WideString& wsCopy) override; - bool Cut(CFX_WideString& wsCut) override; - bool Paste(const CFX_WideString& wsPaste) override; - bool SelectAll() override; - bool Delete() override; - bool DeSelect() override; void OnProcessEvent(CFWL_Event* pEvent) override; void OnSelectChanged(IFWL_Widget* pWidget, |