diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-04-20 16:33:30 -0700 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-04-20 16:33:30 -0700 |
commit | ced4c2bf1d0d1bab14a6145b35b3baecb175a691 (patch) | |
tree | 864cc9992284424365607b330ac218bfb840bf73 /fpdfsdk/src | |
parent | 7a8387e670a2f879b9b2f1fc7bb67064f73fb249 (diff) | |
download | pdfium-ced4c2bf1d0d1bab14a6145b35b3baecb175a691.tar.xz |
Merge to XFA: Remove Release() combo patch.
Includes:
Original Review URL: https://codereview.chromium.org/1098043002
Original Review URL: https://codereview.chromium.org/1097843003
Original Review URL: https://codereview.chromium.org/1093213002
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1092033004
Diffstat (limited to 'fpdfsdk/src')
-rw-r--r-- | fpdfsdk/src/formfiller/FFL_TextField.cpp | 29 | ||||
-rw-r--r-- | fpdfsdk/src/fsdk_baseform.cpp | 22 | ||||
-rw-r--r-- | fpdfsdk/src/fxedit/fxet_edit.cpp | 25 |
3 files changed, 11 insertions, 65 deletions
diff --git a/fpdfsdk/src/formfiller/FFL_TextField.cpp b/fpdfsdk/src/formfiller/FFL_TextField.cpp index dce166282e..274806fbdb 100644 --- a/fpdfsdk/src/formfiller/FFL_TextField.cpp +++ b/fpdfsdk/src/formfiller/FFL_TextField.cpp @@ -4,37 +4,8 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com -//#include "../include/FormFiller.h" -//#include "../include/FFL_FormFiller.h" #include "../../include/formfiller/FFL_TextField.h" #include "../../include/formfiller/FFL_CBA_Fontmap.h" -//#include "../include/FFL_Notify.h" - -CFFL_EditUndoItem::CFFL_EditUndoItem(CPWL_Edit* pEdit) -{ -} - -CFFL_EditUndoItem::~CFFL_EditUndoItem() -{ -} - -void CFFL_EditUndoItem::Undo() -{ -} - -void CFFL_EditUndoItem::Redo() -{ -} - -CFX_WideString CFFL_EditUndoItem::GetDescr() -{ - return L"Input"; -} - -void CFFL_EditUndoItem::Release() -{ - delete this; -} /* ------------------------------- CFFL_TextField ------------------------------- */ diff --git a/fpdfsdk/src/fsdk_baseform.cpp b/fpdfsdk/src/fsdk_baseform.cpp index 86c43f1aa4..723a25ba7e 100644 --- a/fpdfsdk/src/fsdk_baseform.cpp +++ b/fpdfsdk/src/fsdk_baseform.cpp @@ -4,6 +4,7 @@ // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com +#include "../../third_party/base/nonstd_unique_ptr.h" #include "../include/fsdk_define.h" #include "../include/fpdfxfa/fpdfxfa_doc.h" #include "../include/fpdfxfa/fpdfxfa_util.h" @@ -2459,22 +2460,13 @@ FX_BOOL CPDFSDK_InterForm::HighlightWidgets() CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget, FX_BOOL bNext) const { - ASSERT(pWidget != NULL); - - CBA_AnnotIterator* pIterator = new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", "");//XfA? - ASSERT(pIterator != NULL); - - CPDFSDK_Widget* pRet = NULL; - - if (bNext) - pRet = (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget); - else - pRet = (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget); - - pIterator->Release(); - - return pRet; + nonstd::unique_ptr<CBA_AnnotIterator> pIterator( + new CBA_AnnotIterator(pWidget->GetPageView(), "Widget", "")); + if (bNext) { + return (CPDFSDK_Widget*)pIterator->GetNextAnnot(pWidget); + } + return (CPDFSDK_Widget*)pIterator->GetPrevAnnot(pWidget); } CPDFSDK_Widget* CPDFSDK_InterForm::GetWidget(CPDF_FormControl* pControl) const diff --git a/fpdfsdk/src/fxedit/fxet_edit.cpp b/fpdfsdk/src/fxedit/fxet_edit.cpp index 2d25ba3383..c7f7ce5b04 100644 --- a/fpdfsdk/src/fxedit/fxet_edit.cpp +++ b/fpdfsdk/src/fxedit/fxet_edit.cpp @@ -453,10 +453,7 @@ void CFX_Edit_Undo::RemoveHeads() { ASSERT(m_UndoItemStack.GetSize() > 1); - IFX_Edit_UndoItem* pItem = m_UndoItemStack.GetAt(0); - ASSERT(pItem != NULL); - - pItem->Release(); + delete m_UndoItemStack.GetAt(0); m_UndoItemStack.RemoveAt(0); } @@ -464,10 +461,7 @@ void CFX_Edit_Undo::RemoveTails() { for (FX_INT32 i = m_UndoItemStack.GetSize()-1; i >= m_nCurUndoPos; i--) { - IFX_Edit_UndoItem* pItem = m_UndoItemStack.GetAt(i); - ASSERT(pItem != NULL); - - pItem->Release(); + delete m_UndoItemStack.GetAt(i); m_UndoItemStack.RemoveAt(i); } } @@ -476,10 +470,7 @@ void CFX_Edit_Undo::Reset() { for (FX_INT32 i=0, sz=m_UndoItemStack.GetSize(); i < sz; i++) { - IFX_Edit_UndoItem * pItem = m_UndoItemStack.GetAt(i); - ASSERT(pItem != NULL); - - pItem->Release(); + delete m_UndoItemStack.GetAt(i); } m_nCurUndoPos = 0; m_UndoItemStack.RemoveAll(); @@ -495,10 +486,7 @@ CFX_Edit_GroupUndoItem::~CFX_Edit_GroupUndoItem() { for (int i=0,sz=m_Items.GetSize(); i<sz; i++) { - CFX_Edit_UndoItem* pUndoItem = m_Items[i]; - ASSERT(pUndoItem != NULL); - - pUndoItem->Release(); + delete m_Items[i]; } m_Items.RemoveAll(); @@ -558,11 +546,6 @@ CFX_WideString CFX_Edit_GroupUndoItem::GetUndoTitle() return m_sTitle; } -void CFX_Edit_GroupUndoItem::Release() -{ - delete this; -} - /* ------------------------------------- CFX_Edit_UndoItem derived classes ------------------------------------- */ CFXEU_InsertWord::CFXEU_InsertWord(CFX_Edit * pEdit, const CPVT_WordPlace & wpOldPlace, const CPVT_WordPlace & wpNewPlace, |