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 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
744 pBSDict = new CPDF_Dictionary; | 744 pBSDict = new CPDF_Dictionary; |
745 m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict); | 745 m_pAnnot->GetAnnotDict()->SetAt("BS", pBSDict); |
746 } | 746 } |
747 | 747 |
748 pBSDict->SetAtInteger("W", nWidth); | 748 pBSDict->SetAtInteger("W", nWidth); |
749 } | 749 } |
750 } | 750 } |
751 | 751 |
752 int CPDFSDK_Annot::GetBorderWidth() const | 752 int CPDFSDK_Annot::GetBorderWidth() const |
753 { | 753 { |
754 » CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"); | 754 » if (CPDF_Array* pBorder = m_pAnnot->GetAnnotDict()->GetArray("Border"))
{ |
755 | |
756 » if (pBorder) | |
757 » { | |
758 return pBorder->GetInteger(2); | 755 return pBorder->GetInteger(2); |
759 } | 756 } |
760 » else | 757 if (CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS")) { |
761 » { | 758 return pBSDict->GetInteger("W", 1); |
762 » » CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS
"); | |
763 | |
764 » » if (pBSDict) | |
765 » » { | |
766 » » » return pBSDict->GetInteger("W", 1); | |
767 » » } | |
768 } | 759 } |
769 return 1; | 760 return 1; |
770 } | 761 } |
771 | 762 |
772 void CPDFSDK_Annot::SetBorderStyle(int nStyle) | 763 void CPDFSDK_Annot::SetBorderStyle(int nStyle) |
773 { | 764 { |
774 CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); | 765 CPDF_Dictionary* pBSDict = m_pAnnot->GetAnnotDict()->GetDict("BS"); |
775 if (!pBSDict) | 766 if (!pBSDict) |
776 { | 767 { |
777 pBSDict = new CPDF_Dictionary; | 768 pBSDict = new CPDF_Dictionary; |
(...skipping 297 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1075 return ; | 1066 return ; |
1076 } | 1067 } |
1077 | 1068 |
1078 CPDF_Page* CPDFSDK_Annot::GetPDFPage() | 1069 CPDF_Page* CPDFSDK_Annot::GetPDFPage() |
1079 { | 1070 { |
1080 if(m_pPageView) | 1071 if(m_pPageView) |
1081 return m_pPageView->GetPDFPage(); | 1072 return m_pPageView->GetPDFPage(); |
1082 return NULL; | 1073 return NULL; |
1083 } | 1074 } |
1084 | 1075 |
OLD | NEW |