Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(139)

Side by Side Diff: fpdfsdk/fsdk_mgr.cpp

Issue 1906903002: Replace CFX_RectArray with std::vector<CFX_FloatRect> (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Remove unused method Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « fpdfsdk/fpdftext.cpp ('k') | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « fpdfsdk/fpdftext.cpp ('k') | fpdfsdk/include/fsdk_mgr.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698