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

Side by Side Diff: fpdfsdk/cpdfsdk_bfannothandler.cpp

Issue 2295953002: Use enum class for subtypes of CPDF_Annot. (Closed)
Patch Set: Created 4 years, 3 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
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 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/cpdfsdk_bfannothandler.h" 7 #include "fpdfsdk/include/cpdfsdk_bfannothandler.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <vector> 10 #include <vector>
(...skipping 14 matching lines...) Expand all
25 CPDFSDK_BFAnnotHandler::CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp) 25 CPDFSDK_BFAnnotHandler::CPDFSDK_BFAnnotHandler(CPDFDoc_Environment* pApp)
26 : m_pApp(pApp), m_pFormFiller(nullptr) {} 26 : m_pApp(pApp), m_pFormFiller(nullptr) {}
27 27
28 CPDFSDK_BFAnnotHandler::~CPDFSDK_BFAnnotHandler() {} 28 CPDFSDK_BFAnnotHandler::~CPDFSDK_BFAnnotHandler() {}
29 29
30 CFX_ByteString CPDFSDK_BFAnnotHandler::GetType() { 30 CFX_ByteString CPDFSDK_BFAnnotHandler::GetType() {
31 return CFX_ByteString("Widget"); 31 return CFX_ByteString("Widget");
32 } 32 }
33 33
34 FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) { 34 FX_BOOL CPDFSDK_BFAnnotHandler::CanAnswer(CPDFSDK_Annot* pAnnot) {
35 ASSERT(pAnnot->GetAnnotSubtype() == "Widget"); 35 ASSERT(pAnnot->GetAnnotSubtype() == CPDF_Annot::Subtype::WIDGET);
36 if (pAnnot->IsSignatureWidget()) 36 if (pAnnot->IsSignatureWidget())
37 return FALSE; 37 return FALSE;
38 38
39 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); 39 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot);
40 if (!pWidget->IsVisible()) 40 if (!pWidget->IsVisible())
41 return FALSE; 41 return FALSE;
42 42
43 int nFieldFlags = pWidget->GetFieldFlags(); 43 int nFieldFlags = pWidget->GetFieldFlags();
44 if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY) 44 if ((nFieldFlags & FIELDFLAG_READONLY) == FIELDFLAG_READONLY)
45 return FALSE; 45 return FALSE;
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 302
303 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, 303 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView,
304 CPDFSDK_Annot* pAnnot, 304 CPDFSDK_Annot* pAnnot,
305 const CFX_FloatPoint& point) { 305 const CFX_FloatPoint& point) {
306 ASSERT(pPageView); 306 ASSERT(pPageView);
307 ASSERT(pAnnot); 307 ASSERT(pAnnot);
308 308
309 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); 309 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot);
310 return rect.Contains(point.x, point.y); 310 return rect.Contains(point.x, point.y);
311 } 311 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698