diff options
-rw-r--r-- | core/fpdfdoc/cpdf_annot.cpp | 20 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_annot.h | 10 | ||||
-rw-r--r-- | core/fpdfdoc/cpdf_formcontrol.cpp | 2 | ||||
-rw-r--r-- | fpdfsdk/fpdf_annot.cpp | 31 |
4 files changed, 31 insertions, 32 deletions
diff --git a/core/fpdfdoc/cpdf_annot.cpp b/core/fpdfdoc/cpdf_annot.cpp index 13bceab695..961da82d37 100644 --- a/core/fpdfdoc/cpdf_annot.cpp +++ b/core/fpdfdoc/cpdf_annot.cpp @@ -61,9 +61,9 @@ CPDF_Form* AnnotGetMatrix(const CPDF_Page* pPage, return pForm; } -CPDF_Stream* FPDFDOC_GetAnnotAPInternal(CPDF_Dictionary* pAnnotDict, - CPDF_Annot::AppearanceMode eMode, - bool bFallbackToNormal) { +CPDF_Stream* GetAnnotAPInternal(CPDF_Dictionary* pAnnotDict, + CPDF_Annot::AppearanceMode eMode, + bool bFallbackToNormal) { CPDF_Dictionary* pAP = pAnnotDict->GetDictFor("AP"); if (!pAP) return nullptr; @@ -177,18 +177,18 @@ uint32_t CPDF_Annot::GetFlags() const { return m_pAnnotDict->GetIntegerFor("F"); } -CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, - CPDF_Annot::AppearanceMode eMode) { - return FPDFDOC_GetAnnotAPInternal(pAnnotDict, eMode, true); +CPDF_Stream* GetAnnotAP(CPDF_Dictionary* pAnnotDict, + CPDF_Annot::AppearanceMode eMode) { + return GetAnnotAPInternal(pAnnotDict, eMode, true); } -CPDF_Stream* FPDFDOC_GetAnnotAPNoFallback(CPDF_Dictionary* pAnnotDict, - CPDF_Annot::AppearanceMode eMode) { - return FPDFDOC_GetAnnotAPInternal(pAnnotDict, eMode, false); +CPDF_Stream* GetAnnotAPNoFallback(CPDF_Dictionary* pAnnotDict, + CPDF_Annot::AppearanceMode eMode) { + return GetAnnotAPInternal(pAnnotDict, eMode, false); } CPDF_Form* CPDF_Annot::GetAPForm(const CPDF_Page* pPage, AppearanceMode mode) { - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pAnnotDict.Get(), mode); + CPDF_Stream* pStream = GetAnnotAP(m_pAnnotDict.Get(), mode); if (!pStream) return nullptr; diff --git a/core/fpdfdoc/cpdf_annot.h b/core/fpdfdoc/cpdf_annot.h index df9f773521..d24e49777c 100644 --- a/core/fpdfdoc/cpdf_annot.h +++ b/core/fpdfdoc/cpdf_annot.h @@ -128,12 +128,12 @@ class CPDF_Annot { // Get the AP in an annotation dict for a given appearance mode. // If |eMode| is not Normal and there is not AP for that mode, falls back to // the Normal AP. -CPDF_Stream* FPDFDOC_GetAnnotAP(CPDF_Dictionary* pAnnotDict, - CPDF_Annot::AppearanceMode eMode); +CPDF_Stream* GetAnnotAP(CPDF_Dictionary* pAnnotDict, + CPDF_Annot::AppearanceMode eMode); // Get the AP in an annotation dict for a given appearance mode. -// No fallbacks to Normal like in FPDFDOC_GetAnnotAP. -CPDF_Stream* FPDFDOC_GetAnnotAPNoFallback(CPDF_Dictionary* pAnnotDict, - CPDF_Annot::AppearanceMode eMode); +// No fallbacks to Normal like in GetAnnotAP. +CPDF_Stream* GetAnnotAPNoFallback(CPDF_Dictionary* pAnnotDict, + CPDF_Annot::AppearanceMode eMode); #endif // CORE_FPDFDOC_CPDF_ANNOT_H_ diff --git a/core/fpdfdoc/cpdf_formcontrol.cpp b/core/fpdfdoc/cpdf_formcontrol.cpp index a80b0294c1..d644ba9a64 100644 --- a/core/fpdfdoc/cpdf_formcontrol.cpp +++ b/core/fpdfdoc/cpdf_formcontrol.cpp @@ -166,7 +166,7 @@ void CPDF_FormControl::DrawControl(CFX_RenderDevice* pDevice, if (m_pWidgetDict->GetIntegerFor("F") & ANNOTFLAG_HIDDEN) return; - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(m_pWidgetDict.Get(), mode); + CPDF_Stream* pStream = GetAnnotAP(m_pWidgetDict.Get(), mode); if (!pStream) return; diff --git a/fpdfsdk/fpdf_annot.cpp b/fpdfsdk/fpdf_annot.cpp index b20e5c87dc..10e4d989ad 100644 --- a/fpdfsdk/fpdf_annot.cpp +++ b/fpdfsdk/fpdf_annot.cpp @@ -143,7 +143,7 @@ static_assert(static_cast<int>(CPDF_Object::Type::REFERENCE) == "CPDF_Object::REFERENCE value mismatch"); bool HasAPStream(CPDF_Dictionary* pAnnotDict) { - return !!FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); + return !!GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); } void UpdateContentStream(CPDF_Form* pForm, CPDF_Stream* pStream) { @@ -192,7 +192,7 @@ void UpdateBBox(CPDF_Dictionary* annot_dict) { // Update BBox entry in appearance stream based on the bounding rectangle // of the annotation's quadpoints. CPDF_Stream* pStream = - FPDFDOC_GetAnnotAP(annot_dict, CPDF_Annot::AppearanceMode::Normal); + GetAnnotAP(annot_dict, CPDF_Annot::AppearanceMode::Normal); if (pStream) { CFX_FloatRect boundingRect = CPDF_Annot::BoundingRectFromQuadPoints(annot_dict); @@ -339,8 +339,8 @@ FPDFAnnot_UpdateObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) { // Check that the annotation already has an appearance stream, since an // existing object is to be updated. - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(pAnnot->GetAnnotDict(), - CPDF_Annot::AppearanceMode::Normal); + CPDF_Stream* pStream = + GetAnnotAP(pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); if (!pStream) return false; @@ -377,12 +377,11 @@ FPDFAnnot_AppendObject(FPDF_ANNOTATION annot, FPDF_PAGEOBJECT obj) { return false; // If the annotation does not have an AP stream yet, generate and set it. - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(pAnnot->GetAnnotDict(), - CPDF_Annot::AppearanceMode::Normal); + CPDF_Stream* pStream = + GetAnnotAP(pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); if (!pStream) { CPVT_GenerateAP::GenerateEmptyAP(pPage->GetDocument(), pAnnotDict); - pStream = - FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); + pStream = GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); if (!pStream) return false; } @@ -420,8 +419,8 @@ FPDF_EXPORT int FPDF_CALLCONV FPDFAnnot_GetObjectCount(FPDF_ANNOTATION annot) { return 0; if (!pAnnot->HasForm()) { - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP( - pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); + CPDF_Stream* pStream = + GetAnnotAP(pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); if (!pStream) return 0; @@ -437,8 +436,8 @@ FPDFAnnot_GetObject(FPDF_ANNOTATION annot, int index) { return nullptr; if (!pAnnot->HasForm()) { - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP( - pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); + CPDF_Stream* pStream = + GetAnnotAP(pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); if (!pStream) return nullptr; @@ -461,8 +460,8 @@ FPDFAnnot_RemoveObject(FPDF_ANNOTATION annot, int index) { // Check that the annotation already has an appearance stream, since an // existing object is to be deleted. - CPDF_Stream* pStream = FPDFDOC_GetAnnotAP(pAnnot->GetAnnotDict(), - CPDF_Annot::AppearanceMode::Normal); + CPDF_Stream* pStream = + GetAnnotAP(pAnnot->GetAnnotDict(), CPDF_Annot::AppearanceMode::Normal); if (!pStream) return false; @@ -676,7 +675,7 @@ FPDF_EXPORT FPDF_BOOL FPDF_CALLCONV FPDFAnnot_SetRect(FPDF_ANNOTATION annot, return true; CPDF_Stream* pStream = - FPDFDOC_GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); + GetAnnotAP(pAnnotDict, CPDF_Annot::AppearanceMode::Normal); if (pStream && newRect.Contains(pStream->GetDict()->GetRectFor("BBox"))) pStream->GetDict()->SetRectFor("BBox", newRect); return true; @@ -817,7 +816,7 @@ FPDFAnnot_GetAP(FPDF_ANNOTATION annot, CPDF_Annot::AppearanceMode mode = static_cast<CPDF_Annot::AppearanceMode>(appearanceMode); - CPDF_Stream* pStream = FPDFDOC_GetAnnotAPNoFallback(pAnnotDict, mode); + CPDF_Stream* pStream = GetAnnotAPNoFallback(pAnnotDict, mode); return Utf16EncodeMaybeCopyAndReturnLength( pStream ? pStream->GetUnicodeText() : L"", buffer, buflen); } |