From d7682aad8fc488e3e99c3e0de4bd13155deb7ce4 Mon Sep 17 00:00:00 2001 From: dsinclair Date: Fri, 25 Mar 2016 08:54:32 -0700 Subject: Cleanup some extern method declarations. This CL removes _FPDFAPI_GetInternalFontData which is not implemented, FWL_PostMessageToMainRoop which has no body and the PostMessage which was the only caller. FWL_ShowCaret is moved to the only place where it's used. BUG=pdfium:112 Review URL: https://codereview.chromium.org/1827343003 --- xfa/fwl/basewidget/fwl_editimp.cpp | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'xfa/fwl/basewidget') diff --git a/xfa/fwl/basewidget/fwl_editimp.cpp b/xfa/fwl/basewidget/fwl_editimp.cpp index 73c7fa31e1..237e461917 100644 --- a/xfa/fwl/basewidget/fwl_editimp.cpp +++ b/xfa/fwl/basewidget/fwl_editimp.cpp @@ -27,6 +27,8 @@ #include "xfa/fwl/core/fwl_widgetimp.h" #include "xfa/fwl/core/fwl_widgetmgrimp.h" #include "xfa/fwl/core/ifwl_themeprovider.h" +#include "xfa/fxfa/app/xfa_ffdoc.h" +#include "xfa/fxfa/app/xfa_ffwidget.h" #include "xfa/fxgraphics/cfx_path.h" // static @@ -1619,9 +1621,30 @@ void CFWL_EditImp::InitEngine() { } m_pEdtEngine = IFDE_TxtEdtEngine::Create(); } -extern FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget, - FX_BOOL bVisible, - const CFX_RectF* pRtAnchor); + +FX_BOOL FWL_ShowCaret(IFWL_Widget* pWidget, + FX_BOOL bVisible, + const CFX_RectF* pRtAnchor) { + CXFA_FFWidget* pXFAWidget = (CXFA_FFWidget*)pWidget->GetPrivateData(pWidget); + if (!pXFAWidget) { + return FALSE; + } + IXFA_DocProvider* pDocProvider = pXFAWidget->GetDoc()->GetDocProvider(); + if (!pDocProvider) { + return FALSE; + } + if (bVisible) { + CFX_Matrix mt; + pXFAWidget->GetRotateMatrix(mt); + CFX_RectF rt(*pRtAnchor); + mt.TransformRect(rt); + pDocProvider->DisplayCaret(pXFAWidget, bVisible, &rt); + return TRUE; + } + pDocProvider->DisplayCaret(pXFAWidget, bVisible, pRtAnchor); + return TRUE; +} + void CFWL_EditImp::ShowCaret(FX_BOOL bVisible, CFX_RectF* pRect) { if (m_pCaret) { m_pCaret->ShowCaret(bVisible); -- cgit v1.2.3