From 838157392a8ddfbd3db604bf62f30f6c839d70b3 Mon Sep 17 00:00:00 2001 From: Thibaut Cuvelier Date: Fri, 1 Apr 2022 20:39:02 +0200 Subject: [PATCH] XHTML/DocBook tables: slight refactoring. --- src/insets/InsetTabular.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 8c571d655a..0832054bc3 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -3659,9 +3659,10 @@ docstring Tabular::xmlRow(XMLStream & xs, row_type row, OutputParams const & run bool header, bool is_xhtml, BufferParams::TableOutput docbook_table_output) const { docstring ret; + const bool is_xhtml_table = is_xhtml || docbook_table_output == BufferParams::TableOutput::HTMLTable; - std::string const row_tag = (is_xhtml || docbook_table_output == BufferParams::TableOutput::HTMLTable) ? "tr" : "row"; - std::string const cell_tag = (is_xhtml || docbook_table_output == BufferParams::TableOutput::HTMLTable) ? (header ? "th" : "td") : "entry"; + std::string const row_tag = is_xhtml_table ? "tr" : "row"; + std::string const cell_tag = is_xhtml_table ? (header ? "th" : "td") : "entry"; idx_type cell = getFirstCellInRow(row); xs << xml::StartTag(row_tag); @@ -3672,7 +3673,7 @@ docstring Tabular::xmlRow(XMLStream & xs, row_type row, OutputParams const & run stringstream attr; - if (is_xhtml || docbook_table_output == BufferParams::TableOutput::HTMLTable) { + if (is_xhtml_table) { Length const cwidth = column_info[c].p_width; if (!cwidth.zero()) { string const hwidth = cwidth.asHTMLString(); -- 2.39.5