rtftok: move the CellEnd break to the top of the replayBuffer loop

no logic change, CellEnd is the only early exit from the loop so
put it on its own ahead of the if/else chain before the rest of the
loop body moves into a function in the next commit

Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I9c20449a4780a3b390134a0cc2701d9a07e8d9c5
Reviewed-on: https://gerrit.collaboraoffice.com/c/online/+/13058
Tested-by: Jenkins CPCI <releng@collaboraoffice.com>
Reviewed-by: Noel Grandin <noel.grandin@collabora.com>
(cherry picked from commit fe3efbbaefce2a0fb5fa01afcc6f28304d95c1bb)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/211333
Reviewed-by: Xisco Fauli <xiscofauli@libreoffice.org>
Tested-by: Jenkins
This commit is contained in:
Caolán McNamara
2026-09-22 23:59:55 +02:00
committed by Xisco Fauli
parent a019d1a06f
commit 96efff7b2f
@@ -1933,6 +1933,17 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms,
{
Buf_t aTuple(rBuffer.front());
rBuffer.pop_front();
if (std::get<0>(aTuple) == RTFBufferTypes::CellEnd)
{
assert(pSprms && pAttributes);
auto pValue = new RTFValue(1);
pSprms->set(NS_ooxml::LN_tblCell, pValue);
writerfilter::Reference<Properties>::Pointer_t const pTableCellProperties(
new RTFReferenceProperties(*pAttributes, *pSprms));
Mapper().props(pTableCellProperties);
tableBreak();
break;
}
if (std::get<0>(aTuple) == RTFBufferTypes::Props
|| std::get<0>(aTuple) == RTFBufferTypes::PropsChar)
{
@@ -1955,17 +1966,6 @@ void RTFDocumentImpl::replayBuffer(RTFBuffer_t& rBuffer, RTFSprms* const pSprms,
sendProperties(rRowBuffer.GetParaProperties(), rRowBuffer.GetFrameProperties(),
rRowBuffer.GetRowProperties());
}
else if (std::get<0>(aTuple) == RTFBufferTypes::CellEnd)
{
assert(pSprms && pAttributes);
auto pValue = new RTFValue(1);
pSprms->set(NS_ooxml::LN_tblCell, pValue);
writerfilter::Reference<Properties>::Pointer_t const pTableCellProperties(
new RTFReferenceProperties(*pAttributes, *pSprms));
Mapper().props(pTableCellProperties);
tableBreak();
break;
}
else if (std::get<0>(aTuple) == RTFBufferTypes::StartRun)
Mapper().startCharacterGroup();
else if (std::get<0>(aTuple) == RTFBufferTypes::Text)