summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2018-03-28 21:00:35 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-03-28 21:00:35 +0000
commitcbf76e656042e3d9778ccc114983ab6a3c19ff92 (patch)
tree793bacffd8e8f052ad17a25461c22dfa8479217e
parent53a8093c6ef694ec520fe0b087fbac86af97f5e8 (diff)
downloadpdfium-cbf76e656042e3d9778ccc114983ab6a3c19ff92.tar.xz
Rename CBA_AnnotIterator to CPDFSDK_AnnotIteratorchromium/3383
This CL renames CBA_AnnotIterator to CPDFSDK_AnnotIterator. This iterator does not seem to be restricted to just BAAnnot entries, so rename to the more general name. Change-Id: I735dc37cd5417a2b544882db515dbef4d4dbae67 Reviewed-on: https://pdfium-review.googlesource.com/29430 Commit-Queue: dsinclair <dsinclair@chromium.org> Reviewed-by: Henrique Nakashima <hnakashima@chromium.org>
-rw-r--r--BUILD.gn6
-rw-r--r--fpdfsdk/cpdfsdk_annothandlermgr.cpp9
-rw-r--r--fpdfsdk/cpdfsdk_annotiterator.cpp (renamed from fpdfsdk/cba_annotiterator.cpp)26
-rw-r--r--fpdfsdk/cpdfsdk_annotiterator.h (renamed from fpdfsdk/cba_annotiterator.h)14
-rw-r--r--fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp (renamed from fpdfsdk/cba_annotiterator_embeddertest.cpp)18
-rw-r--r--fpdfsdk/cpdfsdk_interform.cpp4
-rw-r--r--fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp6
-rw-r--r--fpdfsdk/pwl/cpwl_edit_embeddertest.cpp6
8 files changed, 45 insertions, 44 deletions
diff --git a/BUILD.gn b/BUILD.gn
index c6aee5c645..1cb7046c25 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -103,8 +103,6 @@ config("xfa_warnings") {
jumbo_static_library("pdfium") {
sources = [
- "fpdfsdk/cba_annotiterator.cpp",
- "fpdfsdk/cba_annotiterator.h",
"fpdfsdk/cfx_systemhandler.cpp",
"fpdfsdk/cfx_systemhandler.h",
"fpdfsdk/cpdfsdk_actionhandler.cpp",
@@ -115,6 +113,8 @@ jumbo_static_library("pdfium") {
"fpdfsdk/cpdfsdk_annothandlermgr.h",
"fpdfsdk/cpdfsdk_annotiteration.cpp",
"fpdfsdk/cpdfsdk_annotiteration.h",
+ "fpdfsdk/cpdfsdk_annotiterator.cpp",
+ "fpdfsdk/cpdfsdk_annotiterator.h",
"fpdfsdk/cpdfsdk_baannot.cpp",
"fpdfsdk/cpdfsdk_baannot.h",
"fpdfsdk/cpdfsdk_baannothandler.cpp",
@@ -2989,7 +2989,7 @@ test("pdfium_embeddertests") {
"core/fpdfapi/render/fpdf_render_pattern_embeddertest.cpp",
"core/fxcodec/codec/fx_codec_embeddertest.cpp",
"core/fxge/fx_ge_text_embeddertest.cpp",
- "fpdfsdk/cba_annotiterator_embeddertest.cpp",
+ "fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp",
"fpdfsdk/fpdf_annot_embeddertest.cpp",
"fpdfsdk/fpdf_attachment_embeddertest.cpp",
"fpdfsdk/fpdf_dataavail_embeddertest.cpp",
diff --git a/fpdfsdk/cpdfsdk_annothandlermgr.cpp b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
index 2966b4d19b..e0405e84f9 100644
--- a/fpdfsdk/cpdfsdk_annothandlermgr.cpp
+++ b/fpdfsdk/cpdfsdk_annothandlermgr.cpp
@@ -9,8 +9,8 @@
#include "core/fpdfapi/parser/cpdf_number.h"
#include "core/fpdfapi/parser/cpdf_string.h"
#include "core/fpdfdoc/cpdf_annot.h"
-#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_annot.h"
+#include "fpdfsdk/cpdfsdk_annotiterator.h"
#include "fpdfsdk/cpdfsdk_baannot.h"
#include "fpdfsdk/cpdfsdk_baannothandler.h"
#include "fpdfsdk/cpdfsdk_datetime.h"
@@ -292,8 +292,8 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
if (!pPage)
return nullptr;
if (pPage->GetPDFPage()) { // for pdf annots.
- CBA_AnnotIterator ai(pSDKAnnot->GetPageView(),
- pSDKAnnot->GetAnnotSubtype());
+ CPDFSDK_AnnotIterator ai(pSDKAnnot->GetPageView(),
+ pSDKAnnot->GetAnnotSubtype());
CPDFSDK_Annot* pNext =
bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
return pNext;
@@ -315,7 +315,8 @@ CPDFSDK_Annot* CPDFSDK_AnnotHandlerMgr::GetNextAnnot(CPDFSDK_Annot* pSDKAnnot,
return pPageView->GetAnnotByXFAWidget(hNextFocus);
#else // PDF_ENABLE_XFA
- CBA_AnnotIterator ai(pSDKAnnot->GetPageView(), CPDF_Annot::Subtype::WIDGET);
+ CPDFSDK_AnnotIterator ai(pSDKAnnot->GetPageView(),
+ CPDF_Annot::Subtype::WIDGET);
return bNext ? ai.GetNextAnnot(pSDKAnnot) : ai.GetPrevAnnot(pSDKAnnot);
#endif // PDF_ENABLE_XFA
}
diff --git a/fpdfsdk/cba_annotiterator.cpp b/fpdfsdk/cpdfsdk_annotiterator.cpp
index d1c9599cf6..1c168454fe 100644
--- a/fpdfsdk/cba_annotiterator.cpp
+++ b/fpdfsdk/cpdfsdk_annotiterator.cpp
@@ -4,7 +4,7 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#include "fpdfsdk/cba_annotiterator.h"
+#include "fpdfsdk/cpdfsdk_annotiterator.h"
#include <algorithm>
@@ -28,8 +28,8 @@ bool CompareByTopDescending(const CPDFSDK_Annot* p1, const CPDFSDK_Annot* p2) {
} // namespace
-CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
- CPDF_Annot::Subtype nAnnotSubtype)
+CPDFSDK_AnnotIterator::CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView,
+ CPDF_Annot::Subtype nAnnotSubtype)
: m_eTabOrder(STRUCTURE),
m_pPageView(pPageView),
m_nAnnotSubtype(nAnnotSubtype) {
@@ -43,17 +43,17 @@ CBA_AnnotIterator::CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
GenerateResults();
}
-CBA_AnnotIterator::~CBA_AnnotIterator() {}
+CPDFSDK_AnnotIterator::~CPDFSDK_AnnotIterator() {}
-CPDFSDK_Annot* CBA_AnnotIterator::GetFirstAnnot() {
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::GetFirstAnnot() {
return m_Annots.empty() ? nullptr : m_Annots.front();
}
-CPDFSDK_Annot* CBA_AnnotIterator::GetLastAnnot() {
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::GetLastAnnot() {
return m_Annots.empty() ? nullptr : m_Annots.back();
}
-CPDFSDK_Annot* CBA_AnnotIterator::GetNextAnnot(CPDFSDK_Annot* pAnnot) {
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::GetNextAnnot(CPDFSDK_Annot* pAnnot) {
auto iter = std::find(m_Annots.begin(), m_Annots.end(), pAnnot);
if (iter == m_Annots.end())
return nullptr;
@@ -63,7 +63,7 @@ CPDFSDK_Annot* CBA_AnnotIterator::GetNextAnnot(CPDFSDK_Annot* pAnnot) {
return *iter;
}
-CPDFSDK_Annot* CBA_AnnotIterator::GetPrevAnnot(CPDFSDK_Annot* pAnnot) {
+CPDFSDK_Annot* CPDFSDK_AnnotIterator::GetPrevAnnot(CPDFSDK_Annot* pAnnot) {
auto iter = std::find(m_Annots.begin(), m_Annots.end(), pAnnot);
if (iter == m_Annots.end())
return nullptr;
@@ -72,7 +72,7 @@ CPDFSDK_Annot* CBA_AnnotIterator::GetPrevAnnot(CPDFSDK_Annot* pAnnot) {
return *(--iter);
}
-void CBA_AnnotIterator::CollectAnnots(std::vector<CPDFSDK_Annot*>* pArray) {
+void CPDFSDK_AnnotIterator::CollectAnnots(std::vector<CPDFSDK_Annot*>* pArray) {
for (auto* pAnnot : m_pPageView->GetAnnotList()) {
if (pAnnot->GetAnnotSubtype() == m_nAnnotSubtype &&
!pAnnot->IsSignatureWidget()) {
@@ -81,7 +81,7 @@ void CBA_AnnotIterator::CollectAnnots(std::vector<CPDFSDK_Annot*>* pArray) {
}
}
-CFX_FloatRect CBA_AnnotIterator::AddToAnnotsList(
+CFX_FloatRect CPDFSDK_AnnotIterator::AddToAnnotsList(
std::vector<CPDFSDK_Annot*>* sa,
size_t idx) {
CPDFSDK_Annot* pLeftTopAnnot = sa->at(idx);
@@ -91,8 +91,8 @@ CFX_FloatRect CBA_AnnotIterator::AddToAnnotsList(
return rcLeftTop;
}
-void CBA_AnnotIterator::AddSelectedToAnnots(std::vector<CPDFSDK_Annot*>* sa,
- std::vector<size_t>* aSelect) {
+void CPDFSDK_AnnotIterator::AddSelectedToAnnots(std::vector<CPDFSDK_Annot*>* sa,
+ std::vector<size_t>* aSelect) {
for (size_t i = 0; i < aSelect->size(); ++i)
m_Annots.push_back(sa->at(aSelect->at(i)));
@@ -100,7 +100,7 @@ void CBA_AnnotIterator::AddSelectedToAnnots(std::vector<CPDFSDK_Annot*>* sa,
sa->erase(sa->begin() + aSelect->at(i));
}
-void CBA_AnnotIterator::GenerateResults() {
+void CPDFSDK_AnnotIterator::GenerateResults() {
switch (m_eTabOrder) {
case STRUCTURE:
CollectAnnots(&m_Annots);
diff --git a/fpdfsdk/cba_annotiterator.h b/fpdfsdk/cpdfsdk_annotiterator.h
index 8f9768d1e2..723550edc5 100644
--- a/fpdfsdk/cba_annotiterator.h
+++ b/fpdfsdk/cpdfsdk_annotiterator.h
@@ -4,8 +4,8 @@
// Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
-#ifndef FPDFSDK_CBA_ANNOTITERATOR_H_
-#define FPDFSDK_CBA_ANNOTITERATOR_H_
+#ifndef FPDFSDK_CPDFSDK_ANNOTITERATOR_H_
+#define FPDFSDK_CPDFSDK_ANNOTITERATOR_H_
#include <vector>
@@ -17,13 +17,13 @@
class CPDFSDK_Annot;
class CPDFSDK_PageView;
-class CBA_AnnotIterator {
+class CPDFSDK_AnnotIterator {
public:
enum TabOrder { STRUCTURE = 0, ROW, COLUMN };
- CBA_AnnotIterator(CPDFSDK_PageView* pPageView,
- CPDF_Annot::Subtype nAnnotSubtype);
- ~CBA_AnnotIterator();
+ CPDFSDK_AnnotIterator(CPDFSDK_PageView* pPageView,
+ CPDF_Annot::Subtype nAnnotSubtype);
+ ~CPDFSDK_AnnotIterator();
CPDFSDK_Annot* GetFirstAnnot();
CPDFSDK_Annot* GetLastAnnot();
@@ -43,4 +43,4 @@ class CBA_AnnotIterator {
std::vector<CPDFSDK_Annot*> m_Annots;
};
-#endif // FPDFSDK_CBA_ANNOTITERATOR_H_
+#endif // FPDFSDK_CPDFSDK_ANNOTITERATOR_H_
diff --git a/fpdfsdk/cba_annotiterator_embeddertest.cpp b/fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp
index 6198ee1eb4..879a365ae8 100644
--- a/fpdfsdk/cba_annotiterator_embeddertest.cpp
+++ b/fpdfsdk/cpdfsdk_annotiterator_embeddertest.cpp
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_annot.h"
+#include "fpdfsdk/cpdfsdk_annotiterator.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "testing/embedder_test.h"
@@ -23,9 +23,9 @@ void CheckRect(const CFX_FloatRect& actual, const CFX_FloatRect& expected) {
} // namespace
-class CBA_AnnotIteratorTest : public EmbedderTest {};
+class CPDFSDK_AnnotIteratorTest : public EmbedderTest {};
-TEST_F(CBA_AnnotIteratorTest, CBA_AnnotIterator) {
+TEST_F(CPDFSDK_AnnotIteratorTest, CPDFSDK_AnnotIterator) {
EXPECT_TRUE(OpenDocument("annotiter.pdf"));
FPDF_PAGE page0 = LoadPage(0);
FPDF_PAGE page1 = LoadPage(1);
@@ -44,8 +44,8 @@ TEST_F(CBA_AnnotIteratorTest, CBA_AnnotIterator) {
{
// Page 0 specifies "row order".
- CBA_AnnotIterator iter(pFormFillEnv->GetPageView(0),
- CPDF_Annot::Subtype::WIDGET);
+ CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageView(0),
+ CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetNextAnnot(pAnnot);
@@ -70,8 +70,8 @@ TEST_F(CBA_AnnotIteratorTest, CBA_AnnotIterator) {
}
{
// Page 1 specifies "column order"
- CBA_AnnotIterator iter(pFormFillEnv->GetPageView(1),
- CPDF_Annot::Subtype::WIDGET);
+ CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageView(1),
+ CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), RightTop);
pAnnot = iter.GetNextAnnot(pAnnot);
@@ -96,8 +96,8 @@ TEST_F(CBA_AnnotIteratorTest, CBA_AnnotIterator) {
}
{
// Page 2 specifies "struct order"
- CBA_AnnotIterator iter(pFormFillEnv->GetPageView(2),
- CPDF_Annot::Subtype::WIDGET);
+ CPDFSDK_AnnotIterator iter(pFormFillEnv->GetPageView(2),
+ CPDF_Annot::Subtype::WIDGET);
CPDFSDK_Annot* pAnnot = iter.GetFirstAnnot();
CheckRect(pAnnot->GetRect(), LeftBottom);
pAnnot = iter.GetNextAnnot(pAnnot);
diff --git a/fpdfsdk/cpdfsdk_interform.cpp b/fpdfsdk/cpdfsdk_interform.cpp
index 22d1a47e33..6d3e9cd848 100644
--- a/fpdfsdk/cpdfsdk_interform.cpp
+++ b/fpdfsdk/cpdfsdk_interform.cpp
@@ -21,9 +21,9 @@
#include "core/fpdfdoc/cpdf_interform.h"
#include "core/fxge/cfx_graphstatedata.h"
#include "core/fxge/cfx_pathdata.h"
-#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_actionhandler.h"
#include "fpdfsdk/cpdfsdk_annot.h"
+#include "fpdfsdk/cpdfsdk_annotiterator.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/cpdfsdk_helpers.h"
#include "fpdfsdk/cpdfsdk_pageview.h"
@@ -106,7 +106,7 @@ bool CPDFSDK_InterForm::HighlightWidgets() {
CPDFSDK_Widget* CPDFSDK_InterForm::GetSibling(CPDFSDK_Widget* pWidget,
bool bNext) const {
- auto pIterator = pdfium::MakeUnique<CBA_AnnotIterator>(
+ auto pIterator = pdfium::MakeUnique<CPDFSDK_AnnotIterator>(
pWidget->GetPageView(), CPDF_Annot::Subtype::WIDGET);
if (bNext)
diff --git a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
index 9fd8eec173..e4b329e61e 100644
--- a/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_combo_box_embeddertest.cpp
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_annot.h"
+#include "fpdfsdk/cpdfsdk_annotiterator.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
@@ -30,8 +30,8 @@ class CPWLComboBoxEditEmbeddertest : public EmbedderTest {
ASSERT_TRUE(m_page);
m_pFormFillEnv = static_cast<CPDFSDK_FormFillEnvironment*>(form_handle());
- CBA_AnnotIterator iter(m_pFormFillEnv->GetPageView(0),
- CPDF_Annot::Subtype::WIDGET);
+ CPDFSDK_AnnotIterator iter(m_pFormFillEnv->GetPageView(0),
+ CPDF_Annot::Subtype::WIDGET);
// User editable combobox.
m_pAnnotEditable = iter.GetFirstAnnot();
diff --git a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
index b3f0d5dc0e..43d06d3d2a 100644
--- a/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
+++ b/fpdfsdk/pwl/cpwl_edit_embeddertest.cpp
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "fpdfsdk/cba_annotiterator.h"
#include "fpdfsdk/cpdfsdk_annot.h"
+#include "fpdfsdk/cpdfsdk_annotiterator.h"
#include "fpdfsdk/cpdfsdk_formfillenvironment.h"
#include "fpdfsdk/formfiller/cffl_formfiller.h"
#include "fpdfsdk/formfiller/cffl_interactiveformfiller.h"
@@ -29,8 +29,8 @@ class CPWLEditEmbeddertest : public EmbedderTest {
ASSERT_TRUE(m_page);
m_pFormFillEnv = static_cast<CPDFSDK_FormFillEnvironment*>(form_handle());
- CBA_AnnotIterator iter(m_pFormFillEnv->GetPageView(0),
- CPDF_Annot::Subtype::WIDGET);
+ CPDFSDK_AnnotIterator iter(m_pFormFillEnv->GetPageView(0),
+ CPDF_Annot::Subtype::WIDGET);
// Normal text field.
m_pAnnot = iter.GetFirstAnnot();
ASSERT_TRUE(m_pAnnot);