OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com | 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com |
6 | 6 |
7 #include "public/fpdf_edit.h" | 7 #include "public/fpdf_edit.h" |
8 | 8 |
9 #include "fpdfsdk/include/fsdk_define.h" | 9 #include "fpdfsdk/include/fsdk_define.h" |
10 #include "public/fpdf_formfill.h" | 10 #include "public/fpdf_formfill.h" |
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
270 double d, | 270 double d, |
271 double e, | 271 double e, |
272 double f) { | 272 double f) { |
273 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); | 273 CPDF_Page* pPage = CPDFPageFromFPDFPage(page); |
274 if (!pPage) | 274 if (!pPage) |
275 return; | 275 return; |
276 CPDF_AnnotList AnnotList(pPage); | 276 CPDF_AnnotList AnnotList(pPage); |
277 for (size_t i = 0; i < AnnotList.Count(); ++i) { | 277 for (size_t i = 0; i < AnnotList.Count(); ++i) { |
278 CPDF_Annot* pAnnot = AnnotList.GetAt(i); | 278 CPDF_Annot* pAnnot = AnnotList.GetAt(i); |
279 // transformAnnots Rectangle | 279 // transformAnnots Rectangle |
280 CPDF_Rect rect; | 280 CFX_FloatRect rect; |
281 pAnnot->GetRect(rect); | 281 pAnnot->GetRect(rect); |
282 CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d, | 282 CFX_Matrix matrix((FX_FLOAT)a, (FX_FLOAT)b, (FX_FLOAT)c, (FX_FLOAT)d, |
283 (FX_FLOAT)e, (FX_FLOAT)f); | 283 (FX_FLOAT)e, (FX_FLOAT)f); |
284 rect.Transform(&matrix); | 284 rect.Transform(&matrix); |
285 CPDF_Array* pRectArray = NULL; | 285 CPDF_Array* pRectArray = NULL; |
286 pRectArray = pAnnot->GetAnnotDict()->GetArrayBy("Rect"); | 286 pRectArray = pAnnot->GetAnnotDict()->GetArrayBy("Rect"); |
287 if (!pRectArray) | 287 if (!pRectArray) |
288 pRectArray = new CPDF_Array; | 288 pRectArray = new CPDF_Array; |
289 pRectArray->SetAt(0, new CPDF_Number(rect.left)); | 289 pRectArray->SetAt(0, new CPDF_Number(rect.left)); |
290 pRectArray->SetAt(1, new CPDF_Number(rect.bottom)); | 290 pRectArray->SetAt(1, new CPDF_Number(rect.bottom)); |
(...skipping 12 matching lines...) Expand all Loading... |
303 !pPage->m_pFormDict->GetElement("Type")->GetDirect() || | 303 !pPage->m_pFormDict->GetElement("Type")->GetDirect() || |
304 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare( | 304 pPage->m_pFormDict->GetElement("Type")->GetDirect()->GetString().Compare( |
305 "Page")) { | 305 "Page")) { |
306 return; | 306 return; |
307 } | 307 } |
308 CPDF_Dictionary* pDict = pPage->m_pFormDict; | 308 CPDF_Dictionary* pDict = pPage->m_pFormDict; |
309 rotate %= 4; | 309 rotate %= 4; |
310 | 310 |
311 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); | 311 pDict->SetAt("Rotate", new CPDF_Number(rotate * 90)); |
312 } | 312 } |
OLD | NEW |