OLD | NEW |
1 // Copyright 2016 PDFium Authors. All rights reserved. | 1 // Copyright 2016 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 "fpdfsdk/cpdfsdk_widget.h" | 7 #include "fpdfsdk/cpdfsdk_widget.h" |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
(...skipping 1793 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1804 } | 1804 } |
1805 | 1805 |
1806 CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); | 1806 CPDF_Document* pDoc = m_pPageView->GetPDFDocument(); |
1807 CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources"); | 1807 CPDF_Dictionary* pStreamResList = pStreamDict->GetDictFor("Resources"); |
1808 if (!pStreamResList) { | 1808 if (!pStreamResList) { |
1809 pStreamResList = new CPDF_Dictionary(pDoc->GetByteStringPool()); | 1809 pStreamResList = new CPDF_Dictionary(pDoc->GetByteStringPool()); |
1810 pStreamDict->SetFor("Resources", pStreamResList); | 1810 pStreamDict->SetFor("Resources", pStreamResList); |
1811 } | 1811 } |
1812 | 1812 |
1813 CPDF_Dictionary* pXObject = new CPDF_Dictionary(pDoc->GetByteStringPool()); | 1813 CPDF_Dictionary* pXObject = new CPDF_Dictionary(pDoc->GetByteStringPool()); |
1814 pXObject->SetReferenceFor(sImageAlias, pDoc, pImage->GetObjNum()); | 1814 pXObject->SetReferenceFor(sImageAlias, pDoc, pImage); |
1815 pStreamResList->SetFor("XObject", pXObject); | 1815 pStreamResList->SetFor("XObject", pXObject); |
1816 } | 1816 } |
1817 | 1817 |
1818 void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) { | 1818 void CPDFSDK_Widget::RemoveAppearance(const CFX_ByteString& sAPType) { |
1819 if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictFor("AP")) | 1819 if (CPDF_Dictionary* pAPDict = m_pAnnot->GetAnnotDict()->GetDictFor("AP")) |
1820 pAPDict->RemoveFor(sAPType); | 1820 pAPDict->RemoveFor(sAPType); |
1821 } | 1821 } |
1822 | 1822 |
1823 FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, | 1823 FX_BOOL CPDFSDK_Widget::OnAAction(CPDF_AAction::AActionType type, |
1824 PDFSDK_FieldAction& data, | 1824 PDFSDK_FieldAction& data, |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1923 return FALSE; | 1923 return FALSE; |
1924 | 1924 |
1925 if (!IsVisible()) | 1925 if (!IsVisible()) |
1926 return FALSE; | 1926 return FALSE; |
1927 | 1927 |
1928 if ((GetFieldFlags() & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) | 1928 if ((GetFieldFlags() & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) |
1929 return FALSE; | 1929 return FALSE; |
1930 | 1930 |
1931 return TRUE; | 1931 return TRUE; |
1932 } | 1932 } |
OLD | NEW |