From: Thibaut Cuvelier Date: Mon, 26 Dec 2022 01:45:03 +0000 (+0100) Subject: DocBook: for computing font changes, simplify code by removing state evolution from... X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=ed7072985e6a76a8013ea670728fc40e6359c723;p=features.git DocBook: for computing font changes, simplify code by removing state evolution from iteration to iteration. This surely makes the code slightly slower (although the compiler should be smart enough), but (much) easier to reason about. --- diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 9c3b0dce35..8650826e4f 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -3568,8 +3568,6 @@ std::tuple, std::vector, std::vectorlayout_; - FontInfo font_old = style.labeltype == LABEL_MANUAL ? style.labelfont : style.font; - string const default_family = buf.masterBuffer()->params().fonts_default_family; // Conversion of the font opening/closing into DocBook tags. vector tagsToOpen; @@ -3602,14 +3600,17 @@ std::tuple, std::vector, std::vectorparams(), i - 1, outerfont).fontInfo()); Font const font = getFont(buf.masterBuffer()->params(), i, outerfont); - tie(tagsToOpen, tagsToClose) = computeDocBookFontSwitch(font_old, font, default_family, fs); + tie(tagsToOpen, tagsToClose) = computeDocBookFontSwitch( + font_old, font, buf.masterBuffer()->params().fonts_default_family, fs); if (!ignore_fonts_i) { vector::const_iterator cit = tagsToClose.begin(); @@ -3665,7 +3666,6 @@ std::tuple, std::vector, std::vector