From 33d684d684133eb939a99b44c54eaeacf31e4b1c Mon Sep 17 00:00:00 2001 From: levlam Date: Fri, 27 Sep 2019 03:42:26 +0300 Subject: [PATCH] Represent empty IV cells as null. GitOrigin-RevId: 2a087121c7a676e95165b72ed09e002c2323ddd8 --- td/generate/scheme/td_api.tl | 2 +- td/telegram/WebPageBlock.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index 28aa6921..d7710d42 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -787,7 +787,7 @@ pageBlockVerticalAlignmentMiddle = PageBlockVerticalAlignment; //@description The content should be bottom-aligned pageBlockVerticalAlignmentBottom = PageBlockVerticalAlignment; -//@description Represents a cell of a table @text Cell text @is_header True, if it is a header cell +//@description Represents a cell of a table @text Cell text; may be null. If the text is null, then the cell should be invisible @is_header True, if it is a header cell //@colspan The number of columns the cell should span @rowspan The number of rows the cell should span //@align Horizontal cell content alignment @valign Vertical cell content alignment pageBlockTableCell text:RichText is_header:Bool colspan:int32 rowspan:int32 align:PageBlockHorizontalAlignment valign:PageBlockVerticalAlignment = PageBlockTableCell; diff --git a/td/telegram/WebPageBlock.cpp b/td/telegram/WebPageBlock.cpp index 4370cb49..58c9cd54 100644 --- a/td/telegram/WebPageBlock.cpp +++ b/td/telegram/WebPageBlock.cpp @@ -236,8 +236,8 @@ class WebPageBlockTableCell { UNREACHABLE(); return nullptr; }(); - return td_api::make_object(text.get_rich_text_object(), is_header, colspan, rowspan, - std::move(align), std::move(valign)); + return td_api::make_object(text.empty() ? null : text.get_rich_text_object(), is_header, + colspan, rowspan, std::move(align), std::move(valign)); } template