Reflow CXFA_ItemLayoutProcessor::GotoNextContainerNode().
Get rid of goto statements.
Change-Id: I3ad018a368c1721c16646efceb225c0a819b350f
Reviewed-on: https://pdfium-review.googlesource.com/c/47279
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp b/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp
index d61db05..3eddc98 100644
--- a/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp
+++ b/xfa/fxfa/layout/cxfa_itemlayoutprocessor.cpp
@@ -856,7 +856,7 @@
ret = HandleKeep(pChildContainer->GetFirstChild(), pCurActionNode);
if (ret.has_value())
return ret.value();
- goto CheckNextChildContainer;
+ break;
case Stage::kNone:
*pCurActionNode = nullptr;
@@ -874,7 +874,7 @@
ret = HandleBreakBefore(pChildContainer, pCurActionNode);
if (ret.has_value())
return ret.value();
- goto CheckNextChildContainer;
+ break;
case Stage::kContainer:
*pCurActionNode = nullptr;
@@ -884,26 +884,31 @@
ret = HandleBreakAfter(pChildContainer, pCurActionNode);
if (ret.has_value())
return ret.value();
+ break;
- CheckNextChildContainer : {
- ret = HandleCheckNextChildContainer(pParentContainer, pChildContainer,
- pCurActionNode);
+ case Stage::kBookendTrailer:
+ ret = HandleBookendTrailer(pParentContainer, pCurActionNode);
if (ret.has_value())
return ret.value();
-
- *pCurActionNode = nullptr;
- FALLTHROUGH;
- case Stage::kBookendTrailer:
- ret = HandleBookendTrailer(pParentContainer, pCurActionNode);
- if (ret.has_value())
- return ret.value();
- }
FALLTHROUGH;
default:
*pCurActionNode = nullptr;
return Stage::kDone;
}
+
+ ret = HandleCheckNextChildContainer(pParentContainer, pChildContainer,
+ pCurActionNode);
+ if (ret.has_value())
+ return ret.value();
+
+ *pCurActionNode = nullptr;
+ ret = HandleBookendTrailer(pParentContainer, pCurActionNode);
+ if (ret.has_value())
+ return ret.value();
+
+ *pCurActionNode = nullptr;
+ return Stage::kDone;
}
Optional<CXFA_ItemLayoutProcessor::Stage>