| 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 1241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1252 | 1252 |
| 1253 bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect) { | 1253 bool Document::IsEnclosedInRect(CFX_FloatRect rect, CFX_FloatRect LinkRect) { |
| 1254 return (rect.left <= LinkRect.left && rect.top <= LinkRect.top && | 1254 return (rect.left <= LinkRect.left && rect.top <= LinkRect.top && |
| 1255 rect.right >= LinkRect.right && rect.bottom >= LinkRect.bottom); | 1255 rect.right >= LinkRect.right && rect.bottom >= LinkRect.bottom); |
| 1256 } | 1256 } |
| 1257 | 1257 |
| 1258 void IconTree::InsertIconElement(IconElement* pNewIcon) { | 1258 void IconTree::InsertIconElement(IconElement* pNewIcon) { |
| 1259 if (!pNewIcon) | 1259 if (!pNewIcon) |
| 1260 return; | 1260 return; |
| 1261 | 1261 |
| 1262 if (m_pHead == NULL && m_pEnd == NULL) { | 1262 if (m_pHead || m_pEnd) { |
| 1263 m_pHead = m_pEnd = pNewIcon; | |
| 1264 m_iLength++; | |
| 1265 } else { | |
| 1266 m_pEnd->NextIcon = pNewIcon; | 1263 m_pEnd->NextIcon = pNewIcon; |
| 1267 m_pEnd = pNewIcon; | 1264 m_pEnd = pNewIcon; |
| 1268 m_iLength++; | 1265 } else { |
| 1266 m_pHead = pNewIcon; |
| 1267 m_pEnd = pNewIcon; |
| 1269 } | 1268 } |
| 1269 m_iLength++; |
| 1270 } | 1270 } |
| 1271 | 1271 |
| 1272 void IconTree::DeleteIconTree() { | 1272 void IconTree::DeleteIconTree() { |
| 1273 if (!m_pHead || !m_pEnd) | 1273 if (!m_pHead || !m_pEnd) |
| 1274 return; | 1274 return; |
| 1275 | 1275 |
| 1276 IconElement* pTemp = NULL; | 1276 IconElement* pTemp = NULL; |
| 1277 while (m_pEnd != m_pHead) { | 1277 while (m_pEnd != m_pHead) { |
| 1278 pTemp = m_pHead; | 1278 pTemp = m_pHead; |
| 1279 m_pHead = m_pHead->NextIcon; | 1279 m_pHead = m_pHead->NextIcon; |
| (...skipping 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1773 CFX_DWordArray DelArray; | 1773 CFX_DWordArray DelArray; |
| 1774 | 1774 |
| 1775 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { | 1775 for (int j = DelArray.GetSize() - 1; j >= 0; j--) { |
| 1776 m_DelayData.RemoveAt(DelArray[j]); | 1776 m_DelayData.RemoveAt(DelArray[j]); |
| 1777 } | 1777 } |
| 1778 } | 1778 } |
| 1779 | 1779 |
| 1780 CJS_Document* Document::GetCJSDoc() const { | 1780 CJS_Document* Document::GetCJSDoc() const { |
| 1781 return static_cast<CJS_Document*>(m_pJSObject); | 1781 return static_cast<CJS_Document*>(m_pJSObject); |
| 1782 } | 1782 } |
| OLD | NEW |