Remove optional argument from CXFA_LayoutProcessor::StartLayout() Change-Id: I559d8208b8415e42e520e81114f9d2d66e74b288 Reviewed-on: https://pdfium-review.googlesource.com/40391 Commit-Queue: Tom Sepez <tsepez@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/xfa/fxfa/cxfa_ffdocview.cpp b/xfa/fxfa/cxfa_ffdocview.cpp index 400be36..46b5710 100644 --- a/xfa/fxfa/cxfa_ffdocview.cpp +++ b/xfa/fxfa/cxfa_ffdocview.cpp
@@ -71,7 +71,7 @@ m_pDoc->GetXFADoc()->DoDataMerge(); m_pXFADocLayout = GetXFALayout(); - int32_t iStatus = m_pXFADocLayout->StartLayout(); + int32_t iStatus = m_pXFADocLayout->StartLayout(false); if (iStatus < 0) return iStatus; @@ -446,7 +446,7 @@ LockUpdate(); m_bInLayoutStatus = true; if (!m_pXFADocLayout->IncrementLayout() && - m_pXFADocLayout->StartLayout() < 100) { + m_pXFADocLayout->StartLayout(false) < 100) { m_pXFADocLayout->DoLayout(); UnlockUpdate(); m_bInLayoutStatus = false;
diff --git a/xfa/fxfa/cxfa_ffpageview.cpp b/xfa/fxfa/cxfa_ffpageview.cpp index cb97439..351f576 100644 --- a/xfa/fxfa/cxfa_ffpageview.cpp +++ b/xfa/fxfa/cxfa_ffpageview.cpp
@@ -381,39 +381,39 @@ CXFA_LayoutItemIterator* sIterator, CXFA_LayoutItem* pContainerItem, CXFA_TabParam* pContainer, - bool& bCurrentItem, - bool& bContentArea, - bool bMarsterPage) { + bool* bCurrentItem, + bool* bContentArea, + bool bMasterPage) { std::vector<std::unique_ptr<CXFA_TabParam>> tabParams; CXFA_LayoutItem* pSearchItem = sIterator->MoveToNext(); while (pSearchItem) { if (!pSearchItem->IsContentLayoutItem()) { - bContentArea = true; + *bContentArea = true; pSearchItem = sIterator->MoveToNext(); continue; } - if (bMarsterPage && bContentArea) { + if (bMasterPage && *bContentArea) { break; } - if (bMarsterPage || bContentArea) { + if (bMasterPage || *bContentArea) { CXFA_FFWidget* hWidget = GetWidget(pSearchItem); if (!hWidget) { pSearchItem = sIterator->MoveToNext(); continue; } if (pContainerItem && (pSearchItem->GetParent() != pContainerItem)) { - bCurrentItem = true; + *bCurrentItem = true; break; } tabParams.push_back(pdfium::MakeUnique<CXFA_TabParam>(hWidget)); if (IsLayoutElement(pSearchItem->GetFormNode()->GetElementType(), true)) { OrderContainer(sIterator, pSearchItem, tabParams.back().get(), - bCurrentItem, bContentArea, bMarsterPage); + bCurrentItem, bContentArea, bMasterPage); } } - if (bCurrentItem) { + if (*bCurrentItem) { pSearchItem = sIterator->GetCurrent(); - bCurrentItem = false; + *bCurrentItem = false; } else { pSearchItem = sIterator->MoveToNext(); } @@ -437,7 +437,8 @@ auto pParam = pdfium::MakeUnique<CXFA_TabParam>(nullptr); bool bCurrentItem = false; bool bContentArea = false; - OrderContainer(&sIterator, nullptr, pParam.get(), bCurrentItem, bContentArea); + OrderContainer(&sIterator, nullptr, pParam.get(), &bCurrentItem, + &bContentArea, false); WidgetArray->insert(WidgetArray->end(), pParam->GetChildren().begin(), pParam->GetChildren().end()); @@ -445,8 +446,8 @@ bCurrentItem = false; bContentArea = false; pParam->ClearChildren(); - OrderContainer(&sIterator, nullptr, pParam.get(), bCurrentItem, bContentArea, - true); + OrderContainer(&sIterator, nullptr, pParam.get(), &bCurrentItem, + &bContentArea, true); WidgetArray->insert(WidgetArray->end(), pParam->GetChildren().begin(), pParam->GetChildren().end()); }
diff --git a/xfa/fxfa/cxfa_ffpageview.h b/xfa/fxfa/cxfa_ffpageview.h index daf2b19..31ce63f 100644 --- a/xfa/fxfa/cxfa_ffpageview.h +++ b/xfa/fxfa/cxfa_ffpageview.h
@@ -95,9 +95,9 @@ void OrderContainer(CXFA_LayoutItemIterator* sIterator, CXFA_LayoutItem* pContainerItem, CXFA_TabParam* pContainer, - bool& bCurrentItem, - bool& bContentArea, - bool bMarsterPage = false); + bool* bCurrentItem, + bool* bContentArea, + bool bMasterPage); std::vector<UnownedPtr<CXFA_FFWidget>> m_TabOrderWidgetArray; UnownedPtr<CXFA_FFPageView> m_pPageView;
diff --git a/xfa/fxfa/parser/cxfa_layoutprocessor.h b/xfa/fxfa/parser/cxfa_layoutprocessor.h index e8391be..bba4357 100644 --- a/xfa/fxfa/parser/cxfa_layoutprocessor.h +++ b/xfa/fxfa/parser/cxfa_layoutprocessor.h
@@ -26,7 +26,7 @@ ~CXFA_LayoutProcessor(); CXFA_Document* GetDocument() const; - int32_t StartLayout(bool bForceRestart = false); + int32_t StartLayout(bool bForceRestart); int32_t DoLayout(); bool IncrementLayout(); int32_t CountPages() const;