From 375c2764b56b38cc9326a8f8ef668fbf78234e9a Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 10 Mar 2017 14:37:14 -0800 Subject: Make most PDFium code pass Clang plugin's auto raw check. Change-Id: I9dc32342e24361389841ecba83081a97fc043377 Reviewed-on: https://pdfium-review.googlesource.com/2959 Reviewed-by: Tom Sepez Commit-Queue: Lei Zhang --- xfa/fxfa/parser/cxfa_layoutitem.cpp | 2 +- xfa/fxfa/parser/xfa_layout_itemlayout.cpp | 6 +++--- xfa/fxfa/parser/xfa_utils.cpp | 17 +++++++++-------- 3 files changed, 13 insertions(+), 12 deletions(-) (limited to 'xfa/fxfa/parser') diff --git a/xfa/fxfa/parser/cxfa_layoutitem.cpp b/xfa/fxfa/parser/cxfa_layoutitem.cpp index 476d6118ac..5409c4e0c1 100644 --- a/xfa/fxfa/parser/cxfa_layoutitem.cpp +++ b/xfa/fxfa/parser/cxfa_layoutitem.cpp @@ -64,7 +64,7 @@ CXFA_ContainerLayoutItem* CXFA_LayoutItem::GetPage() const { CFX_RectF CXFA_LayoutItem::GetRect(bool bRelative) const { ASSERT(m_bIsContentLayoutItem); - auto pThis = static_cast(this); + auto* pThis = static_cast(this); CFX_PointF sPos = pThis->m_sPos; CFX_SizeF sSize = pThis->m_sSize; if (bRelative) diff --git a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp index dd38c963d6..dd04668a33 100644 --- a/xfa/fxfa/parser/xfa_layout_itemlayout.cpp +++ b/xfa/fxfa/parser/xfa_layout_itemlayout.cpp @@ -182,7 +182,7 @@ void RelocateTableRowCells( int32_t nCurrentColIdx = 0; bool bMetWholeRowCell = false; - for (auto pLayoutChild = + for (auto* pLayoutChild = static_cast(pLayoutRow->m_pFirstChild); pLayoutChild; pLayoutChild = static_cast( pLayoutChild->m_pNextSibling)) { @@ -1995,7 +1995,7 @@ bool CXFA_ItemLayoutProcessor::ProcessKeepForSplit( childSize.height, &keepLayoutItems)) { m_arrayKeepItems.clear(); - for (auto item : keepLayoutItems) { + for (auto* item : keepLayoutItems) { pParentProcessor->m_pLayoutItem->RemoveChild(item); *fContentCurRowY -= item->m_sSize.height; m_arrayKeepItems.push_back(item); @@ -2271,7 +2271,7 @@ XFA_ItemLayoutProcessorResult CXFA_ItemLayoutProcessor::DoLayoutFlowedContainer( case XFA_ItemLayoutProcessorStages::None: break; case XFA_ItemLayoutProcessorStages::BreakBefore: { - for (auto item : m_arrayKeepItems) { + for (auto* item : m_arrayKeepItems) { m_pLayoutItem->RemoveChild(item); fContentCalculatedHeight -= item->m_sSize.height; } diff --git a/xfa/fxfa/parser/xfa_utils.cpp b/xfa/fxfa/parser/xfa_utils.cpp index 6f54c0e5fe..216c5a56c4 100644 --- a/xfa/fxfa/parser/xfa_utils.cpp +++ b/xfa/fxfa/parser/xfa_utils.cpp @@ -328,10 +328,10 @@ const XFA_PROPERTY* XFA_GetPropertyOfElement(XFA_Element eElement, if (!pProperties || iCount < 1) return nullptr; - auto it = std::find_if(pProperties, pProperties + iCount, - [eProperty](const XFA_PROPERTY& prop) { - return prop.eName == eProperty; - }); + auto* it = std::find_if(pProperties, pProperties + iCount, + [eProperty](const XFA_PROPERTY& prop) { + return prop.eName == eProperty; + }); if (it == pProperties + iCount) return nullptr; @@ -375,10 +375,11 @@ XFA_Element XFA_GetElementTypeForName(const CFX_WideStringC& wsName) { uint32_t uHash = FX_HashCode_GetW(wsName, false); const XFA_ELEMENTINFO* pEnd = g_XFAElementData + g_iXFAElementCount; - auto pInfo = std::lower_bound(g_XFAElementData, pEnd, uHash, - [](const XFA_ELEMENTINFO& info, uint32_t hash) { - return info.uHash < hash; - }); + auto* pInfo = + std::lower_bound(g_XFAElementData, pEnd, uHash, + [](const XFA_ELEMENTINFO& info, uint32_t hash) { + return info.uHash < hash; + }); if (pInfo < pEnd && pInfo->uHash == uHash) return pInfo->eName; return XFA_Element::Unknown; -- cgit v1.2.3