commit 1b7c8df68fb66782c249670dd30aa36279489143 Author: Jean-Marc Lasgouttes <lasgout...@lyx.org> Date: Sun Mar 2 21:02:03 2025 +0100
Ensure that InsetTableCell::width is initialized Use this occasion to move initial values to the object declaration. Spotted by Coverity Scan. --- src/insets/InsetTabular.cpp | 4 +--- src/insets/InsetTabular.h | 18 +++++++++--------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index b629bcb256..4394af3711 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -4793,9 +4793,7 @@ bool Tabular::hasNewlines(idx_type cell) const ///////////////////////////////////////////////////////////////////// InsetTableCell::InsetTableCell(Buffer * buf) - : InsetText(buf, InsetText::PlainLayout), isFixedWidth(false), isVarwidth(false), - isMultiColumn(false), isMultiRow(false), mr_rows(1), isCaptionRow(false), - contentAlign(LYX_ALIGN_CENTER), isDeleted(false) + : InsetText(buf, InsetText::PlainLayout) {} bool InsetTableCell::allowParagraphCustomization(idx_type) const diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 5c1aaf79e0..c20b6c014c 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -139,25 +139,25 @@ private: // So, well, if someone can do better, please do! // --rkh /// - bool isFixedWidth; + bool isFixedWidth = false; /// - bool isVarwidth; + bool isVarwidth = false; /// - bool isMultiColumn; + bool isMultiColumn = false; /// - bool isMultiRow; + bool isMultiRow = false; /// - int mr_rows; + int mr_rows = 1; /// - int width; + int width = 0; /// - bool isCaptionRow; + bool isCaptionRow = false; /// - LyXAlignment contentAlign; + LyXAlignment contentAlign = LYX_ALIGN_CENTER; /// std::string background_color; /// - bool isDeleted; + bool isDeleted = false; /// should paragraph indentation be omitted in any case? bool neverIndent() const override { return true; } /// -- lyx-cvs mailing list lyx-cvs@lists.lyx.org https://lists.lyx.org/mailman/listinfo/lyx-cvs