diff options
Diffstat (limited to 'xfa/fxfa/app/xfa_fftext.cpp')
-rw-r--r-- | xfa/fxfa/app/xfa_fftext.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp index 2307ea0dc4..3d2c9a6ea0 100644 --- a/xfa/fxfa/app/xfa_fftext.cpp +++ b/xfa/fxfa/app/xfa_fftext.cpp @@ -153,22 +153,17 @@ FWL_WidgetHit CXFA_FFText::OnHitTest(FX_FLOAT fx, FX_FLOAT fy) { } const FX_WCHAR* CXFA_FFText::GetLinkURLAtPoint(FX_FLOAT fx, FX_FLOAT fy) { CXFA_TextLayout* pTextLayout = m_pDataAcc->GetTextLayout(); - if (!pTextLayout) { + if (!pTextLayout) return nullptr; - } - FX_FLOAT x(fx), y(fy); + + FX_FLOAT x(fx); + FX_FLOAT y(fy); FWLToClient(x, y); - const CFX_ArrayTemplate<CXFA_PieceLine*>* pPieceLines = - pTextLayout->GetPieceLines(); - int32_t iCount = pPieceLines->GetSize(); - for (int32_t i = 0; i < iCount; i++) { - CXFA_PieceLine* pPieceLine = pPieceLines->GetAt(i); - int32_t iPieces = pPieceLine->m_textPieces.GetSize(); - for (int32_t j = 0; j < iPieces; j++) { - XFA_TextPiece* pPiece = pPieceLine->m_textPieces.GetAt(j); - if (pPiece->pLinkData && pPiece->rtPiece.Contains(x, y)) { + + for (const auto& pPieceLine : *pTextLayout->GetPieceLines()) { + for (const auto& pPiece : pPieceLine->m_textPieces) { + if (pPiece->pLinkData && pPiece->rtPiece.Contains(x, y)) return pPiece->pLinkData->GetLinkURL(); - } } } return nullptr; |