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

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

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