[LyX/master] XHTML/DocBook tables: slight refactoring.

Thibaut Cuvelier tcuvelier at lyx.org
Sat Apr 2 01:00:27 UTC 2022


commit 838157392a8ddfbd3db604bf62f30f6c839d70b3
Author: Thibaut Cuvelier <tcuvelier at lyx.org>
Date:   Fri Apr 1 20:39:02 2022 +0200

    XHTML/DocBook tables: slight refactoring.
---
 src/insets/InsetTabular.cpp |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp
index 8c571d6..0832054 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();


More information about the lyx-cvs mailing list