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_flatten.h" | 7 #include "public/fpdf_flatten.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 364 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
375 if (!pAPStream) { | 375 if (!pAPStream) { |
376 CPDF_Dictionary* pAPDic = pAnnotAP->GetDictFor("N"); | 376 CPDF_Dictionary* pAPDic = pAnnotAP->GetDictFor("N"); |
377 if (!pAPDic) | 377 if (!pAPDic) |
378 continue; | 378 continue; |
379 | 379 |
380 if (!sAnnotState.IsEmpty()) { | 380 if (!sAnnotState.IsEmpty()) { |
381 pAPStream = pAPDic->GetStreamFor(sAnnotState); | 381 pAPStream = pAPDic->GetStreamFor(sAnnotState); |
382 } else { | 382 } else { |
383 auto it = pAPDic->begin(); | 383 auto it = pAPDic->begin(); |
384 if (it != pAPDic->end()) { | 384 if (it != pAPDic->end()) { |
385 CPDF_Object* pFirstObj = it->second.get(); | 385 CPDF_Object* pFirstObj = it->second; |
386 if (pFirstObj) { | 386 if (pFirstObj) { |
387 if (pFirstObj->IsReference()) | 387 if (pFirstObj->IsReference()) |
388 pFirstObj = pFirstObj->GetDirect(); | 388 pFirstObj = pFirstObj->GetDirect(); |
389 if (!pFirstObj->IsStream()) | 389 if (!pFirstObj->IsStream()) |
390 continue; | 390 continue; |
391 pAPStream = pFirstObj->AsStream(); | 391 pAPStream = pFirstObj->AsStream(); |
392 } | 392 } |
393 } | 393 } |
394 } | 394 } |
395 } | 395 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
449 sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, | 449 sTemp.Format("q %f 0 0 %f %f %f cm /%s Do Q\n", m.a, m.d, m.e, m.f, |
450 sFormName.c_str()); | 450 sFormName.c_str()); |
451 sStream += sTemp; | 451 sStream += sTemp; |
452 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength()); | 452 pNewXObject->SetData(sStream.raw_str(), sStream.GetLength()); |
453 } | 453 } |
454 pPageDict->RemoveFor("Annots"); | 454 pPageDict->RemoveFor("Annots"); |
455 | 455 |
456 RectArray.RemoveAll(); | 456 RectArray.RemoveAll(); |
457 return FLATTEN_SUCCESS; | 457 return FLATTEN_SUCCESS; |
458 } | 458 } |
OLD | NEW |