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 "fpdfsdk/include/fsdk_mgr.h" | 7 #include "fpdfsdk/include/fsdk_mgr.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <memory> | 10 #include <memory> |
(...skipping 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1151 if (m_pSDKDoc && GetFocusAnnot()) | 1151 if (m_pSDKDoc && GetFocusAnnot()) |
1152 m_pSDKDoc->SetFocusAnnot(nullptr); | 1152 m_pSDKDoc->SetFocusAnnot(nullptr); |
1153 m_CaptureWidget = nullptr; | 1153 m_CaptureWidget = nullptr; |
1154 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) | 1154 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) |
1155 m_pSDKDoc->GetEnv()->GetAnnotHandlerMgr()->ReleaseAnnot(pAnnot); | 1155 m_pSDKDoc->GetEnv()->GetAnnotHandlerMgr()->ReleaseAnnot(pAnnot); |
1156 m_fxAnnotArray.clear(); | 1156 m_fxAnnotArray.clear(); |
1157 m_pAnnotList.reset(); | 1157 m_pAnnotList.reset(); |
1158 SetLock(FALSE); | 1158 SetLock(FALSE); |
1159 } | 1159 } |
1160 | 1160 |
1161 void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects) { | 1161 void CPDFSDK_PageView::UpdateRects(const std::vector<CFX_FloatRect>& rects) { |
1162 for (int i = 0; i < rects.GetSize(); i++) { | 1162 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); |
1163 CFX_FloatRect rc = rects.GetAt(i); | 1163 for (const auto& rc : rects) |
1164 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); | |
1165 pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom); | 1164 pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom); |
1166 } | |
1167 } | 1165 } |
1168 | 1166 |
1169 void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { | 1167 void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { |
1170 CFX_FloatRect rcWindow = pAnnot->GetRect(); | 1168 CFX_FloatRect rcWindow = pAnnot->GetRect(); |
1171 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); | 1169 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); |
1172 pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, | 1170 pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, |
1173 rcWindow.bottom); | 1171 rcWindow.bottom); |
1174 } | 1172 } |
1175 | 1173 |
1176 int CPDFSDK_PageView::GetPageIndex() { | 1174 int CPDFSDK_PageView::GetPageIndex() { |
(...skipping 23 matching lines...) Expand all Loading... |
1200 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); | 1198 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); |
1201 if (!pFocusAnnot) | 1199 if (!pFocusAnnot) |
1202 return nullptr; | 1200 return nullptr; |
1203 | 1201 |
1204 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { | 1202 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { |
1205 if (pAnnot == pFocusAnnot) | 1203 if (pAnnot == pFocusAnnot) |
1206 return pAnnot; | 1204 return pAnnot; |
1207 } | 1205 } |
1208 return nullptr; | 1206 return nullptr; |
1209 } | 1207 } |
OLD | NEW |