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

Unified Diff: xfa/fxfa/app/xfa_fftext.cpp

Issue 2631703003: Avoid endless loop deleting CFGAS_GEFont. (Closed)
Patch Set: rebase Created 3 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « xfa/fxfa/app/cxfa_textlayout.cpp ('k') | xfa/fxfa/app/xfa_textpiece.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxfa/app/xfa_fftext.cpp
diff --git a/xfa/fxfa/app/xfa_fftext.cpp b/xfa/fxfa/app/xfa_fftext.cpp
index 2307ea0dc47306f888e9d8cef0108d6e76384729..3d2c9a6ea0f222bf38628d5f7d5d78fa8c1d6e3e 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;
« no previous file with comments | « xfa/fxfa/app/cxfa_textlayout.cpp ('k') | xfa/fxfa/app/xfa_textpiece.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698