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 "Document.h" | 7 #include "Document.h" |
8 | 8 |
9 #include "Field.h" | 9 #include "Field.h" |
10 #include "Icon.h" | 10 #include "Icon.h" |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 m_pDocument(NULL), | 152 m_pDocument(NULL), |
153 m_cwBaseURL(L""), | 153 m_cwBaseURL(L""), |
154 m_bDelay(FALSE) {} | 154 m_bDelay(FALSE) {} |
155 | 155 |
156 Document::~Document() { | 156 Document::~Document() { |
157 for (int i = 0; i < m_DelayData.GetSize(); i++) { | 157 for (int i = 0; i < m_DelayData.GetSize(); i++) { |
158 delete m_DelayData.GetAt(i); | 158 delete m_DelayData.GetAt(i); |
159 } | 159 } |
160 | 160 |
161 m_DelayData.RemoveAll(); | 161 m_DelayData.RemoveAll(); |
162 m_DelayAnnotData.RemoveAll(); | |
163 } | 162 } |
164 | 163 |
165 // the total number of fileds in document. | 164 // the total number of fileds in document. |
166 FX_BOOL Document::numFields(IJS_Context* cc, | 165 FX_BOOL Document::numFields(IJS_Context* cc, |
167 CJS_PropValue& vp, | 166 CJS_PropValue& vp, |
168 CFX_WideString& sError) { | 167 CFX_WideString& sError) { |
169 if (vp.IsSetting()) { | 168 if (vp.IsSetting()) { |
170 CJS_Context* pContext = static_cast<CJS_Context*>(cc); | 169 CJS_Context* pContext = static_cast<CJS_Context*>(cc); |
171 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); | 170 sError = JSGetStringFromID(pContext, IDS_STRING_JSREADONLY); |
172 return FALSE; | 171 return FALSE; |
(...skipping 1520 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1693 | 1692 |
1694 for (int i = 0, sz = DelayDataForFieldAndControlIndex.GetSize(); i < sz; | 1693 for (int i = 0, sz = DelayDataForFieldAndControlIndex.GetSize(); i < sz; |
1695 i++) { | 1694 i++) { |
1696 CJS_DelayData* pData = DelayDataForFieldAndControlIndex.GetAt(i); | 1695 CJS_DelayData* pData = DelayDataForFieldAndControlIndex.GetAt(i); |
1697 Field::DoDelay(m_pDocument, pData); | 1696 Field::DoDelay(m_pDocument, pData); |
1698 DelayDataForFieldAndControlIndex.SetAt(i, NULL); | 1697 DelayDataForFieldAndControlIndex.SetAt(i, NULL); |
1699 delete pData; | 1698 delete pData; |
1700 } | 1699 } |
1701 } | 1700 } |
1702 | 1701 |
1703 void Document::AddDelayAnnotData(CJS_AnnotObj* pData) { | |
1704 m_DelayAnnotData.Add(pData); | |
1705 } | |
1706 | |
1707 void Document::DoAnnotDelay() { | |
1708 CFX_DWordArray DelArray; | |
1709 | |
1710 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { | |
1711 m_DelayData.RemoveAt(DelArray[j]); | |
1712 } | |
1713 } | |
1714 | |
1715 CJS_Document* Document::GetCJSDoc() const { | 1702 CJS_Document* Document::GetCJSDoc() const { |
1716 return static_cast<CJS_Document*>(m_pJSObject); | 1703 return static_cast<CJS_Document*>(m_pJSObject); |
1717 } | 1704 } |
OLD | NEW |