From 944b9efc4613218e5e162f1f9697c445d3f65605 Mon Sep 17 00:00:00 2001 From: Zach Nelson Date: Thu, 16 Apr 2026 00:50:27 -0500 Subject: [PATCH] Simpler chained calls --- lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp index 447097adc..1fe7e26bc 100644 --- a/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp +++ b/lib/Epub/Epub/parsers/ChapterHtmlSlimParser.cpp @@ -135,8 +135,8 @@ void ChapterHtmlSlimParser::startNewTextBlock(const BlockStyle& blockStyle) { // container elements deposit their vertical margins on the empty block when they // open. Merge those into the new style so the first child in a container inherits // the container's vertical spacing. - currentTextBlock->setBlockStyle( - currentTextBlock->getBlockStyle().getCombinedBlockStyle(blockStyle, BlockStyle::CombineAxis::Vertical)); + const auto style = currentTextBlock->getBlockStyle(); + currentTextBlock->setBlockStyle(style.getCombinedBlockStyle(blockStyle, BlockStyle::CombineAxis::Vertical)); if (!pendingAnchorId.empty()) { anchorData.push_back({std::move(pendingAnchorId), static_cast(completedPageCount)}); @@ -1016,8 +1016,8 @@ void XMLCALL ChapterHtmlSlimParser::endElement(void* userData, const XML_Char* n // container spacing appears after the element's content (on the last child), // not on the first child via the empty-block merge in startNewTextBlock. if (self->currentTextBlock) { - self->currentTextBlock->setBlockStyle( - self->currentTextBlock->getBlockStyle().addBottom(self->blockStyleStack.back())); + const auto style = self->currentTextBlock->getBlockStyle(); + self->currentTextBlock->setBlockStyle(style.addBottom(self->blockStyleStack.back())); } self->blockStyleStack.pop_back(); }