summaryrefslogtreecommitdiff
path: root/fpdfsdk/fsdk_mgr.cpp
diff options
context:
space:
mode:
authorjaepark <jaepark@google.com>2016-08-26 16:16:10 -0700
committerCommit bot <commit-bot@chromium.org>2016-08-26 16:16:10 -0700
commit9ed91376d562f3c6e7ca0a99035a74502f648776 (patch)
treed164689b94d520448de46c8e4dbc9ea0abf788cf /fpdfsdk/fsdk_mgr.cpp
parent987f3ee94c3cb8e4a6113ad05453a2948469386c (diff)
downloadpdfium-9ed91376d562f3c6e7ca0a99035a74502f648776.tar.xz
Rename CPDFSDK_Annot::GetType to CPDFSDK_Annot::GetAnnotSubtype.
CPDFSDK_Annot::GetType should be renamed to GetAnnotSubtype as it returns annotation subtype. Also, CPDFSDK_Annot::GetSubType is only used to check if the annotation is signature widget. Thus, change the method to IsSignatureWidget. Lastly, rename CPDF_Annot::GetSubType to CPDF_Annot::GetSubtype to match with spec. Review-Url: https://codereview.chromium.org/2287703002
Diffstat (limited to 'fpdfsdk/fsdk_mgr.cpp')
-rw-r--r--fpdfsdk/fsdk_mgr.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/fpdfsdk/fsdk_mgr.cpp b/fpdfsdk/fsdk_mgr.cpp
index e0d78a2197..9f16098e12 100644
--- a/fpdfsdk/fsdk_mgr.cpp
+++ b/fpdfsdk/fsdk_mgr.cpp
@@ -442,7 +442,7 @@ FX_BOOL CPDFSDK_Document::KillFocusAnnot(FX_UINT nFlag) {
#endif // PDF_ENABLE_XFA
if (pAnnotHandler->Annot_OnKillFocus(pFocusAnnot, nFlag)) {
- if (pFocusAnnot->GetType() == "Widget") {
+ if (pFocusAnnot->GetAnnotSubtype() == "Widget") {
CPDFSDK_Widget* pWidget = (CPDFSDK_Widget*)pFocusAnnot;
int nFieldType = pWidget->GetFieldType();
if (FIELDTYPE_TEXTFIELD == nFieldType ||
@@ -586,7 +586,7 @@ const CPDF_Annot* CPDFSDK_PageView::GetPDFAnnotAtPoint(FX_FLOAT pageX,
const CPDF_Annot* CPDFSDK_PageView::GetPDFWidgetAtPoint(FX_FLOAT pageX,
FX_FLOAT pageY) {
for (const auto& pAnnot : m_pAnnotList->All()) {
- if (pAnnot->GetSubType() == "Widget") {
+ if (pAnnot->GetSubtype() == "Widget") {
CFX_FloatRect annotRect = pAnnot->GetRect();
if (annotRect.Contains(pageX, pageY))
return pAnnot.get();
@@ -615,9 +615,10 @@ CPDFSDK_Annot* CPDFSDK_PageView::GetFXWidgetAtPoint(FX_FLOAT pageX,
CPDFSDK_AnnotHandlerMgr* pAnnotMgr = pEnv->GetAnnotHandlerMgr();
CPDFSDK_AnnotIterator annotIterator(this, false);
while (CPDFSDK_Annot* pSDKAnnot = annotIterator.Next()) {
- bool bHitTest = pSDKAnnot->GetType() == "Widget";
+ bool bHitTest = pSDKAnnot->GetAnnotSubtype() == "Widget";
#ifdef PDF_ENABLE_XFA
- bHitTest = bHitTest || pSDKAnnot->GetType() == FSDK_XFAWIDGET_TYPENAME;
+ bHitTest =
+ bHitTest || pSDKAnnot->GetAnnotSubtype() == FSDK_XFAWIDGET_TYPENAME;
#endif // PDF_ENABLE_XFA
if (bHitTest) {
pAnnotMgr->Annot_OnGetViewBBox(this, pSDKAnnot);