| 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 "../include/fsdk_define.h" | 7 #include "../include/fsdk_define.h" |
| 8 #include "../include/fsdk_mgr.h" | 8 #include "../include/fsdk_mgr.h" |
| 9 #include "../include/fsdk_baseannot.h" | 9 #include "../include/fsdk_baseannot.h" |
| 10 | 10 |
| (...skipping 667 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 678 | 678 |
| 679 if (str.IsEmpty()) | 679 if (str.IsEmpty()) |
| 680 m_pAnnot->GetAnnotDict()->RemoveAt("M"); | 680 m_pAnnot->GetAnnotDict()->RemoveAt("M"); |
| 681 else | 681 else |
| 682 m_pAnnot->GetAnnotDict()->SetAtString("M", str); | 682 m_pAnnot->GetAnnotDict()->SetAtString("M", str); |
| 683 } | 683 } |
| 684 | 684 |
| 685 FX_SYSTEMTIME CPDFSDK_Annot::GetModifiedDate() const | 685 FX_SYSTEMTIME CPDFSDK_Annot::GetModifiedDate() const |
| 686 { | 686 { |
| 687 FX_SYSTEMTIME systime; | 687 FX_SYSTEMTIME systime; |
| 688 » CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetString("M"); | 688 » CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetStringAt("M"); |
| 689 | 689 |
| 690 CPDFSDK_DateTime dt(str); | 690 CPDFSDK_DateTime dt(str); |
| 691 dt.ToSystemTime(systime); | 691 dt.ToSystemTime(systime); |
| 692 | 692 |
| 693 return systime; | 693 return systime; |
| 694 } | 694 } |
| 695 | 695 |
| 696 void CPDFSDK_Annot::SetFlags(int nFlags) | 696 void CPDFSDK_Annot::SetFlags(int nFlags) |
| 697 { | 697 { |
| 698 m_pAnnot->GetAnnotDict()->SetAtInteger("F", nFlags); | 698 m_pAnnot->GetAnnotDict()->SetAtInteger("F", nFlags); |
| 699 } | 699 } |
| 700 | 700 |
| 701 int CPDFSDK_Annot::GetFlags() const | 701 int CPDFSDK_Annot::GetFlags() const |
| 702 { | 702 { |
| 703 return m_pAnnot->GetAnnotDict()->GetInteger("F"); | 703 return m_pAnnot->GetAnnotDict()->GetInteger("F"); |
| 704 } | 704 } |
| 705 | 705 |
| 706 void CPDFSDK_Annot::SetAppState(const CFX_ByteString& str) | 706 void CPDFSDK_Annot::SetAppState(const CFX_ByteString& str) |
| 707 { | 707 { |
| 708 if (str.IsEmpty()) | 708 if (str.IsEmpty()) |
| 709 m_pAnnot->GetAnnotDict()->RemoveAt("AS"); | 709 m_pAnnot->GetAnnotDict()->RemoveAt("AS"); |
| 710 else | 710 else |
| 711 m_pAnnot->GetAnnotDict()->SetAtString("AS", str); | 711 m_pAnnot->GetAnnotDict()->SetAtString("AS", str); |
| 712 } | 712 } |
| 713 | 713 |
| 714 CFX_ByteString CPDFSDK_Annot::GetAppState() const | 714 CFX_ByteString CPDFSDK_Annot::GetAppState() const |
| 715 { | 715 { |
| 716 » return m_pAnnot->GetAnnotDict()->GetString("AS"); | 716 » return m_pAnnot->GetAnnotDict()->GetStringAt("AS"); |
| 717 } | 717 } |
| 718 | 718 |
| 719 void CPDFSDK_Annot::SetStructParent(int key) | 719 void CPDFSDK_Annot::SetStructParent(int key) |
| 720 { | 720 { |
| 721 m_pAnnot->GetAnnotDict()->SetAtInteger("StructParent", key); | 721 m_pAnnot->GetAnnotDict()->SetAtInteger("StructParent", key); |
| 722 } | 722 } |
| 723 | 723 |
| 724 int CPDFSDK_Annot::GetStructParent() const | 724 int CPDFSDK_Annot::GetStructParent() const |
| 725 { | 725 { |
| 726 return m_pAnnot->GetAnnotDict()->GetInteger("StructParent"); | 726 return m_pAnnot->GetAnnotDict()->GetInteger("StructParent"); |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 796 pBSDict->SetAtName("S", "U"); | 796 pBSDict->SetAtName("S", "U"); |
| 797 break; | 797 break; |
| 798 } | 798 } |
| 799 } | 799 } |
| 800 | 800 |
| 801 int CPDFSDK_Annot::GetBorderStyle() const | 801 int CPDFSDK_Annot::GetBorderStyle() const |
| 802 { | 802 { |
| 803 CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); | 803 CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); |
| 804 if (pBSDict) | 804 if (pBSDict) |
| 805 { | 805 { |
| 806 » » CFX_ByteString sBorderStyle = pBSDict->GetString("S", "S"); | 806 » » CFX_ByteString sBorderStyle = pBSDict->GetStringAt("S", "S"); |
| 807 if (sBorderStyle == "S") return BBS_SOLID; | 807 if (sBorderStyle == "S") return BBS_SOLID; |
| 808 if (sBorderStyle == "D") return BBS_DASH; | 808 if (sBorderStyle == "D") return BBS_DASH; |
| 809 if (sBorderStyle == "B") return BBS_BEVELED; | 809 if (sBorderStyle == "B") return BBS_BEVELED; |
| 810 if (sBorderStyle == "I") return BBS_INSET; | 810 if (sBorderStyle == "I") return BBS_INSET; |
| 811 if (sBorderStyle == "U") return BBS_UNDERLINE; | 811 if (sBorderStyle == "U") return BBS_UNDERLINE; |
| 812 } | 812 } |
| 813 | 813 |
| 814 CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); | 814 CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); |
| 815 if (pBorder) | 815 if (pBorder) |
| 816 { | 816 { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1075 return ; | 1075 return ; |
| 1076 } | 1076 } |
| 1077 | 1077 |
| 1078 CPDF_Page* CPDFSDK_Annot::GetPDFPage() | 1078 CPDF_Page* CPDFSDK_Annot::GetPDFPage() |
| 1079 { | 1079 { |
| 1080 if(m_pPageView) | 1080 if(m_pPageView) |
| 1081 return m_pPageView->GetPDFPage(); | 1081 return m_pPageView->GetPDFPage(); |
| 1082 return NULL; | 1082 return NULL; |
| 1083 } | 1083 } |
| 1084 | 1084 |
| OLD | NEW |