| 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 <algorithm> | 7 #include <algorithm> | 
| 8 | 8 | 
| 9 #include "core/include/fpdfapi/cpdf_array.h" | 9 #include "core/include/fpdfapi/cpdf_array.h" | 
| 10 #include "core/include/fpdfapi/cpdf_document.h" | 10 #include "core/include/fpdfapi/cpdf_document.h" | 
| (...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 616 FX_SYSTEMTIME CPDFSDK_BAAnnot::GetModifiedDate() const { | 616 FX_SYSTEMTIME CPDFSDK_BAAnnot::GetModifiedDate() const { | 
| 617   FX_SYSTEMTIME systime; | 617   FX_SYSTEMTIME systime; | 
| 618   CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetStringBy("M"); | 618   CFX_ByteString str = m_pAnnot->GetAnnotDict()->GetStringBy("M"); | 
| 619 | 619 | 
| 620   CPDFSDK_DateTime dt(str); | 620   CPDFSDK_DateTime dt(str); | 
| 621   dt.ToSystemTime(systime); | 621   dt.ToSystemTime(systime); | 
| 622 | 622 | 
| 623   return systime; | 623   return systime; | 
| 624 } | 624 } | 
| 625 | 625 | 
| 626 void CPDFSDK_BAAnnot::SetFlags(int nFlags) { | 626 void CPDFSDK_BAAnnot::SetFlags(FX_DWORD nFlags) { | 
| 627   m_pAnnot->GetAnnotDict()->SetAtInteger("F", nFlags); | 627   m_pAnnot->GetAnnotDict()->SetAtInteger("F", nFlags); | 
| 628 } | 628 } | 
| 629 | 629 | 
| 630 int CPDFSDK_BAAnnot::GetFlags() const { | 630 FX_DWORD CPDFSDK_BAAnnot::GetFlags() const { | 
| 631   return m_pAnnot->GetAnnotDict()->GetIntegerBy("F"); | 631   return m_pAnnot->GetAnnotDict()->GetIntegerBy("F"); | 
| 632 } | 632 } | 
| 633 | 633 | 
| 634 void CPDFSDK_BAAnnot::SetAppState(const CFX_ByteString& str) { | 634 void CPDFSDK_BAAnnot::SetAppState(const CFX_ByteString& str) { | 
| 635   if (str.IsEmpty()) | 635   if (str.IsEmpty()) | 
| 636     m_pAnnot->GetAnnotDict()->RemoveAt("AS"); | 636     m_pAnnot->GetAnnotDict()->RemoveAt("AS"); | 
| 637   else | 637   else | 
| 638     m_pAnnot->GetAnnotDict()->SetAtString("AS", str); | 638     m_pAnnot->GetAnnotDict()->SetAtString("AS", str); | 
| 639 } | 639 } | 
| 640 | 640 | 
| (...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 878 } | 878 } | 
| 879 | 879 | 
| 880 FX_FLOAT CPDFSDK_Annot::GetMinHeight() const { | 880 FX_FLOAT CPDFSDK_Annot::GetMinHeight() const { | 
| 881   return BA_ANNOT_MINHEIGHT; | 881   return BA_ANNOT_MINHEIGHT; | 
| 882 } | 882 } | 
| 883 | 883 | 
| 884 FX_BOOL CPDFSDK_BAAnnot::CreateFormFiller() { | 884 FX_BOOL CPDFSDK_BAAnnot::CreateFormFiller() { | 
| 885   return TRUE; | 885   return TRUE; | 
| 886 } | 886 } | 
| 887 FX_BOOL CPDFSDK_BAAnnot::IsVisible() const { | 887 FX_BOOL CPDFSDK_BAAnnot::IsVisible() const { | 
| 888   int nFlags = GetFlags(); | 888   FX_DWORD nFlags = GetFlags(); | 
| 889   return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) || | 889   return !((nFlags & ANNOTFLAG_INVISIBLE) || (nFlags & ANNOTFLAG_HIDDEN) || | 
| 890            (nFlags & ANNOTFLAG_NOVIEW)); | 890            (nFlags & ANNOTFLAG_NOVIEW)); | 
| 891 } | 891 } | 
| 892 | 892 | 
| 893 CPDF_Action CPDFSDK_BAAnnot::GetAction() const { | 893 CPDF_Action CPDFSDK_BAAnnot::GetAction() const { | 
| 894   return CPDF_Action(m_pAnnot->GetAnnotDict()->GetDictBy("A")); | 894   return CPDF_Action(m_pAnnot->GetAnnotDict()->GetDictBy("A")); | 
| 895 } | 895 } | 
| 896 | 896 | 
| 897 void CPDFSDK_BAAnnot::SetAction(const CPDF_Action& action) { | 897 void CPDFSDK_BAAnnot::SetAction(const CPDF_Action& action) { | 
| 898   ASSERT(action.GetDict()); | 898   ASSERT(action.GetDict()); | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 959 | 959 | 
| 960 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | 960 CPDF_Page* CPDFSDK_Annot::GetPDFPage() { | 
| 961   return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; | 961   return m_pPageView ? m_pPageView->GetPDFPage() : nullptr; | 
| 962 } | 962 } | 
| 963 | 963 | 
| 964 #ifdef PDF_ENABLE_XFA | 964 #ifdef PDF_ENABLE_XFA | 
| 965 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { | 965 CPDFXFA_Page* CPDFSDK_Annot::GetPDFXFAPage() { | 
| 966   return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; | 966   return m_pPageView ? m_pPageView->GetPDFXFAPage() : nullptr; | 
| 967 } | 967 } | 
| 968 #endif  // PDF_ENABLE_XFA | 968 #endif  // PDF_ENABLE_XFA | 
| OLD | NEW | 
|---|