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

Side by Side Diff: fpdfsdk/src/fsdk_mgr.cpp

Issue 1743753002: Revert "Replace CPDF_Rect and CPDF_Point with CFX types." (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 4 years, 9 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/src/fsdk_baseform_embeddertest.cpp ('k') | fpdfsdk/src/fxedit/fxet_ap.cpp » ('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 <algorithm> 7 #include <algorithm>
8 #include <memory> 8 #include <memory>
9 9
10 #include "fpdfsdk/include/fsdk_mgr.h" 10 #include "fpdfsdk/include/fsdk_mgr.h"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 51
52 class CFX_SystemHandler : public IFX_SystemHandler { 52 class CFX_SystemHandler : public IFX_SystemHandler {
53 public: 53 public:
54 explicit CFX_SystemHandler(CPDFDoc_Environment* pEnv) 54 explicit CFX_SystemHandler(CPDFDoc_Environment* pEnv)
55 : m_pEnv(pEnv), m_nCharSet(-1) {} 55 : m_pEnv(pEnv), m_nCharSet(-1) {}
56 ~CFX_SystemHandler() override {} 56 ~CFX_SystemHandler() override {}
57 57
58 public: 58 public:
59 // IFX_SystemHandler 59 // IFX_SystemHandler
60 void InvalidateRect(FX_HWND hWnd, FX_RECT rect) override; 60 void InvalidateRect(FX_HWND hWnd, FX_RECT rect) override;
61 void OutputSelectedRect(void* pFormFiller, CFX_FloatRect& rect) override; 61 void OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) override;
62 FX_BOOL IsSelectionImplemented() override; 62 FX_BOOL IsSelectionImplemented() override;
63 CFX_WideString GetClipboardText(FX_HWND hWnd) override { return L""; } 63 CFX_WideString GetClipboardText(FX_HWND hWnd) override { return L""; }
64 FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) override { 64 FX_BOOL SetClipboardText(FX_HWND hWnd, CFX_WideString string) override {
65 return FALSE; 65 return FALSE;
66 } 66 }
67 void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) override {} 67 void ClientToScreen(FX_HWND hWnd, int32_t& x, int32_t& y) override {}
68 void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) override {} 68 void ScreenToClient(FX_HWND hWnd, int32_t& x, int32_t& y) override {}
69 void SetCursor(int32_t nCursorType) override; 69 void SetCursor(int32_t nCursorType) override;
70 FX_HMENU CreatePopupMenu() override { return NULL; } 70 FX_HMENU CreatePopupMenu() override { return NULL; }
71 FX_BOOL AppendMenuItem(FX_HMENU hMenu, 71 FX_BOOL AppendMenuItem(FX_HMENU hMenu,
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
125 if (!pPage || !pPageView) 125 if (!pPage || !pPageView)
126 return; 126 return;
127 CFX_Matrix page2device; 127 CFX_Matrix page2device;
128 pPageView->GetCurrentMatrix(page2device); 128 pPageView->GetCurrentMatrix(page2device);
129 CFX_Matrix device2page; 129 CFX_Matrix device2page;
130 device2page.SetReverse(page2device); 130 device2page.SetReverse(page2device);
131 FX_FLOAT left, top, right, bottom; 131 FX_FLOAT left, top, right, bottom;
132 device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top); 132 device2page.Transform((FX_FLOAT)rect.left, (FX_FLOAT)rect.top, left, top);
133 device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right, 133 device2page.Transform((FX_FLOAT)rect.right, (FX_FLOAT)rect.bottom, right,
134 bottom); 134 bottom);
135 CFX_FloatRect rcPDF(left, bottom, right, top); 135 CPDF_Rect rcPDF(left, bottom, right, top);
136 rcPDF.Normalize(); 136 rcPDF.Normalize();
137 137
138 m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right, 138 m_pEnv->FFI_Invalidate(pPage, rcPDF.left, rcPDF.top, rcPDF.right,
139 rcPDF.bottom); 139 rcPDF.bottom);
140 } 140 }
141 void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, 141 void CFX_SystemHandler::OutputSelectedRect(void* pFormFiller, CPDF_Rect& rect) {
142 CFX_FloatRect& rect) {
143 CFFL_FormFiller* pFFL = (CFFL_FormFiller*)pFormFiller; 142 CFFL_FormFiller* pFFL = (CFFL_FormFiller*)pFormFiller;
144 if (pFFL) { 143 if (pFFL) {
145 CFX_FloatPoint leftbottom = CFX_FloatPoint(rect.left, rect.bottom); 144 CPDF_Point leftbottom = CPDF_Point(rect.left, rect.bottom);
146 CFX_FloatPoint righttop = CFX_FloatPoint(rect.right, rect.top); 145 CPDF_Point righttop = CPDF_Point(rect.right, rect.top);
147 CFX_FloatPoint ptA = pFFL->PWLtoFFL(leftbottom); 146 CPDF_Point ptA = pFFL->PWLtoFFL(leftbottom);
148 CFX_FloatPoint ptB = pFFL->PWLtoFFL(righttop); 147 CPDF_Point ptB = pFFL->PWLtoFFL(righttop);
149 CPDFSDK_Annot* pAnnot = pFFL->GetSDKAnnot(); 148 CPDFSDK_Annot* pAnnot = pFFL->GetSDKAnnot();
150 UnderlyingPageType* pPage = pAnnot->GetUnderlyingPage(); 149 UnderlyingPageType* pPage = pAnnot->GetUnderlyingPage();
151 ASSERT(pPage); 150 ASSERT(pPage);
152 m_pEnv->FFI_OutputSelectedRect(pPage, ptA.x, ptB.y, ptB.x, ptA.y); 151 m_pEnv->FFI_OutputSelectedRect(pPage, ptA.x, ptB.y, ptB.x, ptA.y);
153 } 152 }
154 } 153 }
155 154
156 FX_BOOL CFX_SystemHandler::IsSelectionImplemented() { 155 FX_BOOL CFX_SystemHandler::IsSelectionImplemented() {
157 if (m_pEnv) { 156 if (m_pEnv) {
158 FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo(); 157 FPDF_FORMFILLINFO* pInfo = m_pEnv->GetFormFillInfo();
(...skipping 593 matching lines...) Expand 10 before | Expand all | Expand 10 after
752 } 751 }
753 return nullptr; 752 return nullptr;
754 } 753 }
755 754
756 CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX, 755 CPDFSDK_Annot* CPDFSDK_PageView::GetFXAnnotAtPoint(FX_FLOAT pageX,
757 FX_FLOAT pageY) { 756 FX_FLOAT pageY) {
758 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 757 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
759 CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr(); 758 CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
760 CPDFSDK_AnnotIterator annotIterator(this, false); 759 CPDFSDK_AnnotIterator annotIterator(this, false);
761 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { 760 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
762 CFX_FloatRect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot); 761 CPDF_Rect rc = pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
763 if (rc.Contains(pageX, pageY)) 762 if (rc.Contains(pageX, pageY))
764 return pSDKAnnot; 763 return pSDKAnnot;
765 } 764 }
766 765
767 return nullptr; 766 return nullptr;
768 } 767 }
769 768
770 CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX, 769 CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX,
771 FX_FLOAT pageY) { 770 FX_FLOAT pageY) {
772 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 771 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
773 CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr(); 772 CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
774 CPDFSDK_AnnotIterator annotIterator(this, false); 773 CPDFSDK_AnnotIterator annotIterator(this, false);
775 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) { 774 while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
776 bool bHitTest = pSDKAnnot->GetType() == "Widget"; 775 bool bHitTest = pSDKAnnot->GetType() == "Widget";
777 #ifdef PDF_ENABLE_XFA 776 #ifdef PDF_ENABLE_XFA
778 bHitTest = bHitTest || pSDKAnnot->GetType() == FSDK_XFAWIDGET_TYPENAME; 777 bHitTest = bHitTest || pSDKAnnot->GetType() == FSDK_XFAWIDGET_TYPENAME;
779 #endif // PDF_ENABLE_XFA 778 #endif // PDF_ENABLE_XFA
780 if (bHitTest) { 779 if (bHitTest) {
781 pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot); 780 pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);
782 CFX_FloatPoint point(pageX, pageY); 781 CPDF_Point point(pageX, pageY);
783 if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point)) 782 if (pAnnotMgr->Annot_OnHitTest(this, pSDKAnnot, point))
784 return pSDKAnnot; 783 return pSDKAnnot;
785 } 784 }
786 } 785 }
787 786
788 return nullptr; 787 return nullptr;
789 } 788 }
790 789
791 void CPDFSDK_PageView::KillFocusAnnotIfNeeded() { 790 void CPDFSDK_PageView::KillFocusAnnotIfNeeded() {
792 // if there is a focused annot on the page, we should kill the focus first. 791 // if there is a focused annot on the page, we should kill the focus first.
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
908 return nullptr; 907 return nullptr;
909 908
910 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { 909 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) {
911 if (pAnnot->GetXFAWidget() == hWidget) 910 if (pAnnot->GetXFAWidget() == hWidget)
912 return pAnnot; 911 return pAnnot;
913 } 912 }
914 return nullptr; 913 return nullptr;
915 } 914 }
916 #endif // PDF_ENABLE_XFA 915 #endif // PDF_ENABLE_XFA
917 916
918 FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CFX_FloatPoint& point, 917 FX_BOOL CPDFSDK_PageView::OnLButtonDown(const CPDF_Point& point,
919 FX_UINT nFlag) { 918 FX_UINT nFlag) {
920 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 919 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
921 ASSERT(pEnv); 920 ASSERT(pEnv);
922 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y); 921 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
923 if (!pFXAnnot) { 922 if (!pFXAnnot) {
924 KillFocusAnnot(nFlag); 923 KillFocusAnnot(nFlag);
925 return FALSE; 924 return FALSE;
926 } 925 }
927 926
928 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 927 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
929 FX_BOOL bRet = 928 FX_BOOL bRet =
930 pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag, point); 929 pAnnotHandlerMgr->Annot_OnLButtonDown(this, pFXAnnot, nFlag, point);
931 if (bRet) 930 if (bRet)
932 SetFocusAnnot(pFXAnnot); 931 SetFocusAnnot(pFXAnnot);
933 return bRet; 932 return bRet;
934 } 933 }
935 934
936 #ifdef PDF_ENABLE_XFA 935 #ifdef PDF_ENABLE_XFA
937 FX_BOOL CPDFSDK_PageView::OnRButtonDown(const CFX_FloatPoint& point, 936 FX_BOOL CPDFSDK_PageView::OnRButtonDown(const CPDF_Point& point,
938 FX_UINT nFlag) { 937 FX_UINT nFlag) {
939 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 938 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
940 ASSERT(pEnv); 939 ASSERT(pEnv);
941 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 940 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
942 ASSERT(pAnnotHandlerMgr); 941 ASSERT(pAnnotHandlerMgr);
943 942
944 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y); 943 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
945 944
946 if (pFXAnnot == NULL) 945 if (pFXAnnot == NULL)
947 return FALSE; 946 return FALSE;
948 947
949 FX_BOOL bRet = 948 FX_BOOL bRet =
950 pAnnotHandlerMgr->Annot_OnRButtonDown(this, pFXAnnot, nFlag, point); 949 pAnnotHandlerMgr->Annot_OnRButtonDown(this, pFXAnnot, nFlag, point);
951 if (bRet) { 950 if (bRet) {
952 SetFocusAnnot(pFXAnnot); 951 SetFocusAnnot(pFXAnnot);
953 } 952 }
954 return TRUE; 953 return TRUE;
955 } 954 }
956 955
957 FX_BOOL CPDFSDK_PageView::OnRButtonUp(const CFX_FloatPoint& point, 956 FX_BOOL CPDFSDK_PageView::OnRButtonUp(const CPDF_Point& point, FX_UINT nFlag) {
958 FX_UINT nFlag) {
959 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 957 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
960 ASSERT(pEnv); 958 ASSERT(pEnv);
961 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 959 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
962 960
963 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y); 961 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
964 962
965 if (pFXAnnot == NULL) 963 if (pFXAnnot == NULL)
966 return FALSE; 964 return FALSE;
967 965
968 FX_BOOL bRet = 966 FX_BOOL bRet =
969 pAnnotHandlerMgr->Annot_OnRButtonUp(this, pFXAnnot, nFlag, point); 967 pAnnotHandlerMgr->Annot_OnRButtonUp(this, pFXAnnot, nFlag, point);
970 if (bRet) { 968 if (bRet) {
971 SetFocusAnnot(pFXAnnot); 969 SetFocusAnnot(pFXAnnot);
972 } 970 }
973 return TRUE; 971 return TRUE;
974 } 972 }
975 #endif // PDF_ENABLE_XFA 973 #endif // PDF_ENABLE_XFA
976 974
977 FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CFX_FloatPoint& point, 975 FX_BOOL CPDFSDK_PageView::OnLButtonUp(const CPDF_Point& point, FX_UINT nFlag) {
978 FX_UINT nFlag) {
979 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 976 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
980 ASSERT(pEnv); 977 ASSERT(pEnv);
981 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 978 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
982 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y); 979 CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y);
983 CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot(); 980 CPDFSDK_Annot* pFocusAnnot = GetFocusAnnot();
984 FX_BOOL bRet = FALSE; 981 FX_BOOL bRet = FALSE;
985 if (pFocusAnnot && pFocusAnnot != pFXAnnot) { 982 if (pFocusAnnot && pFocusAnnot != pFXAnnot) {
986 // Last focus Annot gets a chance to handle the event. 983 // Last focus Annot gets a chance to handle the event.
987 bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFocusAnnot, nFlag, point); 984 bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFocusAnnot, nFlag, point);
988 } 985 }
989 if (pFXAnnot && !bRet) 986 if (pFXAnnot && !bRet)
990 bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFXAnnot, nFlag, point); 987 bRet = pAnnotHandlerMgr->Annot_OnLButtonUp(this, pFXAnnot, nFlag, point);
991 return bRet; 988 return bRet;
992 } 989 }
993 990
994 FX_BOOL CPDFSDK_PageView::OnMouseMove(const CFX_FloatPoint& point, int nFlag) { 991 FX_BOOL CPDFSDK_PageView::OnMouseMove(const CPDF_Point& point, int nFlag) {
995 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 992 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
996 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 993 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
997 if (CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y)) { 994 if (CPDFSDK_Annot* pFXAnnot = GetFXWidgetAtPoint(point.x, point.y)) {
998 if (m_CaptureWidget && m_CaptureWidget != pFXAnnot) { 995 if (m_CaptureWidget && m_CaptureWidget != pFXAnnot) {
999 m_bExitWidget = TRUE; 996 m_bExitWidget = TRUE;
1000 m_bEnterWidget = FALSE; 997 m_bEnterWidget = FALSE;
1001 pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag); 998 pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
1002 } 999 }
1003 m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot; 1000 m_CaptureWidget = (CPDFSDK_Widget*)pFXAnnot;
1004 m_bOnWidget = TRUE; 1001 m_bOnWidget = TRUE;
(...skipping 12 matching lines...) Expand all
1017 if (m_CaptureWidget) { 1014 if (m_CaptureWidget) {
1018 pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag); 1015 pAnnotHandlerMgr->Annot_OnMouseExit(this, m_CaptureWidget, nFlag);
1019 m_CaptureWidget = NULL; 1016 m_CaptureWidget = NULL;
1020 } 1017 }
1021 } 1018 }
1022 return FALSE; 1019 return FALSE;
1023 } 1020 }
1024 1021
1025 FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX, 1022 FX_BOOL CPDFSDK_PageView::OnMouseWheel(double deltaX,
1026 double deltaY, 1023 double deltaY,
1027 const CFX_FloatPoint& point, 1024 const CPDF_Point& point,
1028 int nFlag) { 1025 int nFlag) {
1029 if (CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y)) { 1026 if (CPDFSDK_Annot* pAnnot = GetFXWidgetAtPoint(point.x, point.y)) {
1030 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 1027 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
1031 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr(); 1028 CPDFSDK_AnnotHandlerMgr* pAnnotHandlerMgr = pEnv->GetAnnotHandlerMgr();
1032 return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag, 1029 return pAnnotHandlerMgr->Annot_OnMouseWheel(this, pAnnot, nFlag,
1033 (int)deltaY, point); 1030 (int)deltaY, point);
1034 } 1031 }
1035 return FALSE; 1032 return FALSE;
1036 } 1033 }
1037 1034
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
1142 m_CaptureWidget = nullptr; 1139 m_CaptureWidget = nullptr;
1143 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) 1140 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray)
1144 m_pSDKDoc->GetEnv()->GetAnnotHandlerMgr()->ReleaseAnnot(pAnnot); 1141 m_pSDKDoc->GetEnv()->GetAnnotHandlerMgr()->ReleaseAnnot(pAnnot);
1145 m_fxAnnotArray.clear(); 1142 m_fxAnnotArray.clear();
1146 m_pAnnotList.reset(); 1143 m_pAnnotList.reset();
1147 SetLock(FALSE); 1144 SetLock(FALSE);
1148 } 1145 }
1149 1146
1150 void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects) { 1147 void CPDFSDK_PageView::UpdateRects(CFX_RectArray& rects) {
1151 for (int i = 0; i < rects.GetSize(); i++) { 1148 for (int i = 0; i < rects.GetSize(); i++) {
1152 CFX_FloatRect rc = rects.GetAt(i); 1149 CPDF_Rect rc = rects.GetAt(i);
1153 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 1150 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
1154 pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom); 1151 pEnv->FFI_Invalidate(m_page, rc.left, rc.top, rc.right, rc.bottom);
1155 } 1152 }
1156 } 1153 }
1157 1154
1158 void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) { 1155 void CPDFSDK_PageView::UpdateView(CPDFSDK_Annot* pAnnot) {
1159 CFX_FloatRect rcWindow = pAnnot->GetRect(); 1156 CPDF_Rect rcWindow = pAnnot->GetRect();
1160 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv(); 1157 CPDFDoc_Environment* pEnv = m_pSDKDoc->GetEnv();
1161 pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right, 1158 pEnv->FFI_Invalidate(m_page, rcWindow.left, rcWindow.top, rcWindow.right,
1162 rcWindow.bottom); 1159 rcWindow.bottom);
1163 } 1160 }
1164 1161
1165 int CPDFSDK_PageView::GetPageIndex() { 1162 int CPDFSDK_PageView::GetPageIndex() {
1166 if (m_page) { 1163 if (m_page) {
1167 #ifdef PDF_ENABLE_XFA 1164 #ifdef PDF_ENABLE_XFA
1168 CPDF_Dictionary* pDic = m_page->GetPDFPage()->m_pFormDict; 1165 CPDF_Dictionary* pDic = m_page->GetPDFPage()->m_pFormDict;
1169 #else // PDF_ENABLE_XFA 1166 #else // PDF_ENABLE_XFA
(...skipping 19 matching lines...) Expand all
1189 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot(); 1186 CPDFSDK_Annot* pFocusAnnot = m_pSDKDoc->GetFocusAnnot();
1190 if (!pFocusAnnot) 1187 if (!pFocusAnnot)
1191 return nullptr; 1188 return nullptr;
1192 1189
1193 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) { 1190 for (CPDFSDK_Annot* pAnnot : m_fxAnnotArray) {
1194 if (pAnnot == pFocusAnnot) 1191 if (pAnnot == pFocusAnnot)
1195 return pAnnot; 1192 return pAnnot;
1196 } 1193 }
1197 return nullptr; 1194 return nullptr;
1198 } 1195 }
OLDNEW
« no previous file with comments | « fpdfsdk/src/fsdk_baseform_embeddertest.cpp ('k') | fpdfsdk/src/fxedit/fxet_ap.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698