| OLD | NEW |
| 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 Loading... |
| 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->GetType() == "Widget"); | 35 ASSERT(pAnnot->GetAnnotSubtype() == "Widget"); |
| 36 if (pAnnot->GetSubType() == BFFT_SIGNATURE) | 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; |
| 46 | 46 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 pInterForm->RemoveMap(pControl); | 91 pInterForm->RemoveMap(pControl); |
| 92 } | 92 } |
| 93 | 93 |
| 94 void CPDFSDK_BFAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} | 94 void CPDFSDK_BFAnnotHandler::DeleteAnnot(CPDFSDK_Annot* pAnnot) {} |
| 95 | 95 |
| 96 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, | 96 void CPDFSDK_BFAnnotHandler::OnDraw(CPDFSDK_PageView* pPageView, |
| 97 CPDFSDK_Annot* pAnnot, | 97 CPDFSDK_Annot* pAnnot, |
| 98 CFX_RenderDevice* pDevice, | 98 CFX_RenderDevice* pDevice, |
| 99 CFX_Matrix* pUser2Device, | 99 CFX_Matrix* pUser2Device, |
| 100 uint32_t dwFlags) { | 100 uint32_t dwFlags) { |
| 101 CFX_ByteString sSubType = pAnnot->GetSubType(); | 101 if (pAnnot->IsSignatureWidget()) { |
| 102 | |
| 103 if (sSubType == BFFT_SIGNATURE) { | |
| 104 static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( | 102 static_cast<CPDFSDK_BAAnnot*>(pAnnot)->DrawAppearance( |
| 105 pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); | 103 pDevice, pUser2Device, CPDF_Annot::Normal, nullptr); |
| 106 } else { | 104 } else { |
| 107 if (m_pFormFiller) | 105 if (m_pFormFiller) |
| 108 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); | 106 m_pFormFiller->OnDraw(pPageView, pAnnot, pDevice, pUser2Device, dwFlags); |
| 109 } | 107 } |
| 110 } | 108 } |
| 111 | 109 |
| 112 void CPDFSDK_BFAnnotHandler::OnDrawSleep(CPDFSDK_PageView* pPageView, | 110 void CPDFSDK_BFAnnotHandler::OnDrawSleep(CPDFSDK_PageView* pPageView, |
| 113 CPDFSDK_Annot* pAnnot, | 111 CPDFSDK_Annot* pAnnot, |
| 114 CFX_RenderDevice* pDevice, | 112 CFX_RenderDevice* pDevice, |
| 115 CFX_Matrix* pUser2Device, | 113 CFX_Matrix* pUser2Device, |
| 116 const CFX_FloatRect& rcWindow, | 114 const CFX_FloatRect& rcWindow, |
| 117 uint32_t dwFlags) {} | 115 uint32_t dwFlags) {} |
| 118 | 116 |
| 119 void CPDFSDK_BFAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} | 117 void CPDFSDK_BFAnnotHandler::OnDelete(CPDFSDK_Annot* pAnnot) {} |
| 120 | 118 |
| 121 void CPDFSDK_BFAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {} | 119 void CPDFSDK_BFAnnotHandler::OnRelease(CPDFSDK_Annot* pAnnot) {} |
| 122 | 120 |
| 123 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, | 121 void CPDFSDK_BFAnnotHandler::OnMouseEnter(CPDFSDK_PageView* pPageView, |
| 124 CPDFSDK_Annot* pAnnot, | 122 CPDFSDK_Annot* pAnnot, |
| 125 uint32_t nFlag) { | 123 uint32_t nFlag) { |
| 126 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 124 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 127 m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag); | 125 m_pFormFiller->OnMouseEnter(pPageView, pAnnot, nFlag); |
| 128 } | 126 } |
| 129 | 127 |
| 130 void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, | 128 void CPDFSDK_BFAnnotHandler::OnMouseExit(CPDFSDK_PageView* pPageView, |
| 131 CPDFSDK_Annot* pAnnot, | 129 CPDFSDK_Annot* pAnnot, |
| 132 uint32_t nFlag) { | 130 uint32_t nFlag) { |
| 133 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 131 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 134 m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag); | 132 m_pFormFiller->OnMouseExit(pPageView, pAnnot, nFlag); |
| 135 } | 133 } |
| 136 | 134 |
| 137 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, | 135 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDown(CPDFSDK_PageView* pPageView, |
| 138 CPDFSDK_Annot* pAnnot, | 136 CPDFSDK_Annot* pAnnot, |
| 139 uint32_t nFlags, | 137 uint32_t nFlags, |
| 140 const CFX_FloatPoint& point) { | 138 const CFX_FloatPoint& point) { |
| 141 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 139 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 142 return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); | 140 return m_pFormFiller->OnLButtonDown(pPageView, pAnnot, nFlags, point); |
| 143 | 141 |
| 144 return FALSE; | 142 return FALSE; |
| 145 } | 143 } |
| 146 | 144 |
| 147 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, | 145 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonUp(CPDFSDK_PageView* pPageView, |
| 148 CPDFSDK_Annot* pAnnot, | 146 CPDFSDK_Annot* pAnnot, |
| 149 uint32_t nFlags, | 147 uint32_t nFlags, |
| 150 const CFX_FloatPoint& point) { | 148 const CFX_FloatPoint& point) { |
| 151 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 149 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 152 return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); | 150 return m_pFormFiller->OnLButtonUp(pPageView, pAnnot, nFlags, point); |
| 153 | 151 |
| 154 return FALSE; | 152 return FALSE; |
| 155 } | 153 } |
| 156 | 154 |
| 157 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, | 155 FX_BOOL CPDFSDK_BFAnnotHandler::OnLButtonDblClk(CPDFSDK_PageView* pPageView, |
| 158 CPDFSDK_Annot* pAnnot, | 156 CPDFSDK_Annot* pAnnot, |
| 159 uint32_t nFlags, | 157 uint32_t nFlags, |
| 160 const CFX_FloatPoint& point) { | 158 const CFX_FloatPoint& point) { |
| 161 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 159 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 162 return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); | 160 return m_pFormFiller->OnLButtonDblClk(pPageView, pAnnot, nFlags, point); |
| 163 | 161 |
| 164 return FALSE; | 162 return FALSE; |
| 165 } | 163 } |
| 166 | 164 |
| 167 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, | 165 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseMove(CPDFSDK_PageView* pPageView, |
| 168 CPDFSDK_Annot* pAnnot, | 166 CPDFSDK_Annot* pAnnot, |
| 169 uint32_t nFlags, | 167 uint32_t nFlags, |
| 170 const CFX_FloatPoint& point) { | 168 const CFX_FloatPoint& point) { |
| 171 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 169 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 172 return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); | 170 return m_pFormFiller->OnMouseMove(pPageView, pAnnot, nFlags, point); |
| 173 | 171 |
| 174 return FALSE; | 172 return FALSE; |
| 175 } | 173 } |
| 176 | 174 |
| 177 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, | 175 FX_BOOL CPDFSDK_BFAnnotHandler::OnMouseWheel(CPDFSDK_PageView* pPageView, |
| 178 CPDFSDK_Annot* pAnnot, | 176 CPDFSDK_Annot* pAnnot, |
| 179 uint32_t nFlags, | 177 uint32_t nFlags, |
| 180 short zDelta, | 178 short zDelta, |
| 181 const CFX_FloatPoint& point) { | 179 const CFX_FloatPoint& point) { |
| 182 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 180 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 183 return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, | 181 return m_pFormFiller->OnMouseWheel(pPageView, pAnnot, nFlags, zDelta, |
| 184 point); | 182 point); |
| 185 | 183 |
| 186 return FALSE; | 184 return FALSE; |
| 187 } | 185 } |
| 188 | 186 |
| 189 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, | 187 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDown(CPDFSDK_PageView* pPageView, |
| 190 CPDFSDK_Annot* pAnnot, | 188 CPDFSDK_Annot* pAnnot, |
| 191 uint32_t nFlags, | 189 uint32_t nFlags, |
| 192 const CFX_FloatPoint& point) { | 190 const CFX_FloatPoint& point) { |
| 193 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 191 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 194 return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); | 192 return m_pFormFiller->OnRButtonDown(pPageView, pAnnot, nFlags, point); |
| 195 | 193 |
| 196 return FALSE; | 194 return FALSE; |
| 197 } | 195 } |
| 198 | 196 |
| 199 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, | 197 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonUp(CPDFSDK_PageView* pPageView, |
| 200 CPDFSDK_Annot* pAnnot, | 198 CPDFSDK_Annot* pAnnot, |
| 201 uint32_t nFlags, | 199 uint32_t nFlags, |
| 202 const CFX_FloatPoint& point) { | 200 const CFX_FloatPoint& point) { |
| 203 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 201 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 204 return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); | 202 return m_pFormFiller->OnRButtonUp(pPageView, pAnnot, nFlags, point); |
| 205 | 203 |
| 206 return FALSE; | 204 return FALSE; |
| 207 } | 205 } |
| 208 | 206 |
| 209 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, | 207 FX_BOOL CPDFSDK_BFAnnotHandler::OnRButtonDblClk(CPDFSDK_PageView* pPageView, |
| 210 CPDFSDK_Annot* pAnnot, | 208 CPDFSDK_Annot* pAnnot, |
| 211 uint32_t nFlags, | 209 uint32_t nFlags, |
| 212 const CFX_FloatPoint& point) { | 210 const CFX_FloatPoint& point) { |
| 213 return FALSE; | 211 return FALSE; |
| 214 } | 212 } |
| 215 | 213 |
| 216 FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, | 214 FX_BOOL CPDFSDK_BFAnnotHandler::OnChar(CPDFSDK_Annot* pAnnot, |
| 217 uint32_t nChar, | 215 uint32_t nChar, |
| 218 uint32_t nFlags) { | 216 uint32_t nFlags) { |
| 219 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 217 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 220 return m_pFormFiller->OnChar(pAnnot, nChar, nFlags); | 218 return m_pFormFiller->OnChar(pAnnot, nChar, nFlags); |
| 221 | 219 |
| 222 return FALSE; | 220 return FALSE; |
| 223 } | 221 } |
| 224 | 222 |
| 225 FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, | 223 FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyDown(CPDFSDK_Annot* pAnnot, |
| 226 int nKeyCode, | 224 int nKeyCode, |
| 227 int nFlag) { | 225 int nFlag) { |
| 228 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 226 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 229 return m_pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlag); | 227 return m_pFormFiller->OnKeyDown(pAnnot, nKeyCode, nFlag); |
| 230 | 228 |
| 231 return FALSE; | 229 return FALSE; |
| 232 } | 230 } |
| 233 | 231 |
| 234 FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, | 232 FX_BOOL CPDFSDK_BFAnnotHandler::OnKeyUp(CPDFSDK_Annot* pAnnot, |
| 235 int nKeyCode, | 233 int nKeyCode, |
| 236 int nFlag) { | 234 int nFlag) { |
| 237 return FALSE; | 235 return FALSE; |
| 238 } | 236 } |
| 239 | 237 |
| 240 void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) { | 238 void CPDFSDK_BFAnnotHandler::OnCreate(CPDFSDK_Annot* pAnnot) { |
| 241 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 239 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 242 m_pFormFiller->OnCreate(pAnnot); | 240 m_pFormFiller->OnCreate(pAnnot); |
| 243 } | 241 } |
| 244 | 242 |
| 245 void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { | 243 void CPDFSDK_BFAnnotHandler::OnLoad(CPDFSDK_Annot* pAnnot) { |
| 246 if (pAnnot->GetSubType() == BFFT_SIGNATURE) | 244 if (pAnnot->IsSignatureWidget()) |
| 247 return; | 245 return; |
| 248 | 246 |
| 249 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); | 247 CPDFSDK_Widget* pWidget = static_cast<CPDFSDK_Widget*>(pAnnot); |
| 250 if (!pWidget->IsAppearanceValid()) | 248 if (!pWidget->IsAppearanceValid()) |
| 251 pWidget->ResetAppearance(nullptr, FALSE); | 249 pWidget->ResetAppearance(nullptr, FALSE); |
| 252 | 250 |
| 253 int nFieldType = pWidget->GetFieldType(); | 251 int nFieldType = pWidget->GetFieldType(); |
| 254 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) { | 252 if (nFieldType == FIELDTYPE_TEXTFIELD || nFieldType == FIELDTYPE_COMBOBOX) { |
| 255 FX_BOOL bFormated = FALSE; | 253 FX_BOOL bFormated = FALSE; |
| 256 CFX_WideString sValue = pWidget->OnFormat(bFormated); | 254 CFX_WideString sValue = pWidget->OnFormat(bFormated); |
| 257 if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) | 255 if (bFormated && nFieldType == FIELDTYPE_COMBOBOX) |
| 258 pWidget->ResetAppearance(sValue.c_str(), FALSE); | 256 pWidget->ResetAppearance(sValue.c_str(), FALSE); |
| 259 } | 257 } |
| 260 | 258 |
| 261 #ifdef PDF_ENABLE_XFA | 259 #ifdef PDF_ENABLE_XFA |
| 262 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); | 260 CPDFSDK_PageView* pPageView = pAnnot->GetPageView(); |
| 263 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); | 261 CPDFSDK_Document* pSDKDoc = pPageView->GetSDKDocument(); |
| 264 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); | 262 CPDFXFA_Document* pDoc = pSDKDoc->GetXFADocument(); |
| 265 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { | 263 if (pDoc->GetDocType() == DOCTYPE_STATIC_XFA) { |
| 266 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty()) | 264 if (!pWidget->IsAppearanceValid() && !pWidget->GetValue().IsEmpty()) |
| 267 pWidget->ResetAppearance(FALSE); | 265 pWidget->ResetAppearance(FALSE); |
| 268 } | 266 } |
| 269 #endif // PDF_ENABLE_XFA | 267 #endif // PDF_ENABLE_XFA |
| 270 if (m_pFormFiller) | 268 if (m_pFormFiller) |
| 271 m_pFormFiller->OnLoad(pAnnot); | 269 m_pFormFiller->OnLoad(pAnnot); |
| 272 } | 270 } |
| 273 | 271 |
| 274 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, | 272 FX_BOOL CPDFSDK_BFAnnotHandler::OnSetFocus(CPDFSDK_Annot* pAnnot, |
| 275 uint32_t nFlag) { | 273 uint32_t nFlag) { |
| 276 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 274 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 277 return m_pFormFiller->OnSetFocus(pAnnot, nFlag); | 275 return m_pFormFiller->OnSetFocus(pAnnot, nFlag); |
| 278 | 276 |
| 279 return TRUE; | 277 return TRUE; |
| 280 } | 278 } |
| 281 | 279 |
| 282 FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, | 280 FX_BOOL CPDFSDK_BFAnnotHandler::OnKillFocus(CPDFSDK_Annot* pAnnot, |
| 283 uint32_t nFlag) { | 281 uint32_t nFlag) { |
| 284 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 282 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 285 return m_pFormFiller->OnKillFocus(pAnnot, nFlag); | 283 return m_pFormFiller->OnKillFocus(pAnnot, nFlag); |
| 286 | 284 |
| 287 return TRUE; | 285 return TRUE; |
| 288 } | 286 } |
| 289 | 287 |
| 290 #ifdef PDF_ENABLE_XFA | 288 #ifdef PDF_ENABLE_XFA |
| 291 FX_BOOL CPDFSDK_BFAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, | 289 FX_BOOL CPDFSDK_BFAnnotHandler::OnXFAChangedFocus(CPDFSDK_Annot* pOldAnnot, |
| 292 CPDFSDK_Annot* pNewAnnot) { | 290 CPDFSDK_Annot* pNewAnnot) { |
| 293 return TRUE; | 291 return TRUE; |
| 294 } | 292 } |
| 295 #endif // PDF_ENABLE_XFA | 293 #endif // PDF_ENABLE_XFA |
| 296 | 294 |
| 297 CFX_FloatRect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, | 295 CFX_FloatRect CPDFSDK_BFAnnotHandler::GetViewBBox(CPDFSDK_PageView* pPageView, |
| 298 CPDFSDK_Annot* pAnnot) { | 296 CPDFSDK_Annot* pAnnot) { |
| 299 if (pAnnot->GetSubType() != BFFT_SIGNATURE && m_pFormFiller) | 297 if (!pAnnot->IsSignatureWidget() && m_pFormFiller) |
| 300 return CFX_FloatRect(m_pFormFiller->GetViewBBox(pPageView, pAnnot)); | 298 return CFX_FloatRect(m_pFormFiller->GetViewBBox(pPageView, pAnnot)); |
| 301 | 299 |
| 302 return CFX_FloatRect(0, 0, 0, 0); | 300 return CFX_FloatRect(0, 0, 0, 0); |
| 303 } | 301 } |
| 304 | 302 |
| 305 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, | 303 FX_BOOL CPDFSDK_BFAnnotHandler::HitTest(CPDFSDK_PageView* pPageView, |
| 306 CPDFSDK_Annot* pAnnot, | 304 CPDFSDK_Annot* pAnnot, |
| 307 const CFX_FloatPoint& point) { | 305 const CFX_FloatPoint& point) { |
| 308 ASSERT(pPageView); | 306 ASSERT(pPageView); |
| 309 ASSERT(pAnnot); | 307 ASSERT(pAnnot); |
| 310 | 308 |
| 311 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); | 309 CFX_FloatRect rect = GetViewBBox(pPageView, pAnnot); |
| 312 return rect.Contains(point.x, point.y); | 310 return rect.Contains(point.x, point.y); |
| 313 } | 311 } |
| OLD | NEW |