Rename methods in CPDF_Interform.
EnableUpdateAP acutally sets s_bUpdateAP to the given parameter. So
SetUpdateAP is accurate method name.
Review-Url: https://codereview.chromium.org/2140423002
diff --git a/core/fpdfdoc/doc_annot.cpp b/core/fpdfdoc/doc_annot.cpp
index fe17e9c..c9e5d8e 100644
--- a/core/fpdfdoc/doc_annot.cpp
+++ b/core/fpdfdoc/doc_annot.cpp
@@ -44,7 +44,7 @@
m_AnnotList.push_back(
std::unique_ptr<CPDF_Annot>(new CPDF_Annot(pDict, this)));
if (bRegenerateAP && pDict->GetStringBy("Subtype") == "Widget" &&
- CPDF_InterForm::UpdatingAPEnabled()) {
+ CPDF_InterForm::IsUpdateAPEnabled()) {
FPDF_GenerateAP(m_pDocument, pDict);
}
}
diff --git a/core/fpdfdoc/doc_form.cpp b/core/fpdfdoc/doc_form.cpp
index 82fcd4c..bad051f 100644
--- a/core/fpdfdoc/doc_form.cpp
+++ b/core/fpdfdoc/doc_form.cpp
@@ -294,12 +294,15 @@
}
FX_BOOL CPDF_InterForm::s_bUpdateAP = TRUE;
-FX_BOOL CPDF_InterForm::UpdatingAPEnabled() {
+
+FX_BOOL CPDF_InterForm::IsUpdateAPEnabled() {
return s_bUpdateAP;
}
-void CPDF_InterForm::EnableUpdateAP(FX_BOOL bUpdateAP) {
+
+void CPDF_InterForm::SetUpdateAP(FX_BOOL bUpdateAP) {
s_bUpdateAP = bUpdateAP;
}
+
CFX_ByteString CPDF_InterForm::GenerateNewResourceName(
const CPDF_Dictionary* pResDict,
const FX_CHAR* csType,
diff --git a/core/fpdfdoc/include/fpdf_doc.h b/core/fpdfdoc/include/fpdf_doc.h
index be52a1b..fd5dde0 100644
--- a/core/fpdfdoc/include/fpdf_doc.h
+++ b/core/fpdfdoc/include/fpdf_doc.h
@@ -441,8 +441,8 @@
explicit CPDF_InterForm(CPDF_Document* pDocument);
~CPDF_InterForm();
- static void EnableUpdateAP(FX_BOOL bUpdateAP);
- static FX_BOOL UpdatingAPEnabled();
+ static void SetUpdateAP(FX_BOOL bUpdateAP);
+ static FX_BOOL IsUpdateAPEnabled();
static CFX_ByteString GenerateNewResourceName(const CPDF_Dictionary* pResDict,
const FX_CHAR* csType,
int iMinLen = 2,
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index 32cc396..68143d2 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -904,11 +904,11 @@
#ifdef PDF_ENABLE_XFA
CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
#else
- FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
+ FX_BOOL bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled();
// Disable the default AP construction.
- CPDF_InterForm::EnableUpdateAP(FALSE);
+ CPDF_InterForm::SetUpdateAP(FALSE);
m_pAnnotList.reset(new CPDF_AnnotList(m_page));
- CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
+ CPDF_InterForm::SetUpdateAP(bUpdateAP);
const size_t nCount = m_pAnnotList->Count();
#endif // PDF_ENABLE_XFA
@@ -937,11 +937,11 @@
} else {
CPDF_Page* pPage = m_page->GetPDFPage();
ASSERT(pPage);
- FX_BOOL enableAPUpdate = CPDF_InterForm::UpdatingAPEnabled();
+ FX_BOOL bUpdateAP = CPDF_InterForm::IsUpdateAPEnabled();
// Disable the default AP construction.
- CPDF_InterForm::EnableUpdateAP(FALSE);
+ CPDF_InterForm::SetUpdateAP(FALSE);
m_pAnnotList.reset(new CPDF_AnnotList(pPage));
- CPDF_InterForm::EnableUpdateAP(enableAPUpdate);
+ CPDF_InterForm::SetUpdateAP(bUpdateAP);
const size_t nCount = m_pAnnotList->Count();
for (size_t i = 0; i < nCount; ++i) {