Skip to content

Commit

Permalink
Make row node dependent on selection
Browse files Browse the repository at this point in the history
This fixed e.g. missing `tr` nodes in HTML Export when selection in grid
does not start at `x = 0` or does not end at `x = xs - 1`.
  • Loading branch information
tobiolo committed Sep 12, 2023
1 parent 89a6912 commit 9e50423
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/grid.h
Original file line number Diff line number Diff line change
Expand Up @@ -615,10 +615,10 @@ struct Grid {
wxString::Format(L"<ul style=\"font-size: %dpt;\">\n",
font_size).wc_str());
foreachcellinsel(c, s) {
if (x == 0) Formatter(r, format, indent, L"<row>\n", L"<tr>\n", L"");
if (x == s.x) Formatter(r, format, indent, L"<row>\n", L"<tr>\n", L"");
r.Append(c->ToText(indent, s, format, doc, inheritstyle));
if (format == A_EXPCSV) r.Append(x == xs - 1 ? '\n' : ',');
if (x == xs - 1) Formatter(r, format, indent, L"</row>\n", L"</tr>\n", L"");
if (x == s.x + s.xs - 1) Formatter(r, format, indent, L"</row>\n", L"</tr>\n", L"");
}
Formatter(r, format, indent, L"</grid>\n", L"</table>\n", L"</ul>\n");
return r;
Expand Down

0 comments on commit 9e50423

Please sign in to comment.