summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdfeditpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdfeditpage.cpp')
-rw-r--r--fpdfsdk/fpdfeditpage.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/fpdfsdk/fpdfeditpage.cpp b/fpdfsdk/fpdfeditpage.cpp
index da156cd790..22b2261c6f 100644
--- a/fpdfsdk/fpdfeditpage.cpp
+++ b/fpdfsdk/fpdfeditpage.cpp
@@ -298,13 +298,15 @@ DLLEXPORT void STDCALL FPDFPage_TransformAnnots(FPDF_PAGE page,
matrix.TransformRect(rect);
CPDF_Array* pRectArray = pAnnot->GetAnnotDict()->GetArrayFor("Rect");
- if (!pRectArray)
+ if (pRectArray)
+ pRectArray->RemoveAt(0, pRectArray->GetCount());
+ else
pRectArray = pAnnot->GetAnnotDict()->SetNewFor<CPDF_Array>("Rect");
- pRectArray->SetNewAt<CPDF_Number>(0, rect.left);
- pRectArray->SetNewAt<CPDF_Number>(1, rect.bottom);
- pRectArray->SetNewAt<CPDF_Number>(2, rect.right);
- pRectArray->SetNewAt<CPDF_Number>(3, rect.top);
+ pRectArray->AddNew<CPDF_Number>(rect.left);
+ pRectArray->AddNew<CPDF_Number>(rect.bottom);
+ pRectArray->AddNew<CPDF_Number>(rect.right);
+ pRectArray->AddNew<CPDF_Number>(rect.top);
// TODO(unknown): Transform AP's rectangle
}