From 8d09fb5bf0b2b4cba93411b8508ef3064df239cb Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Sat, 23 Jan 2021 14:53:51 +0100 Subject: [PATCH] Support non-default styles in multirow --- src/insets/InsetTabular.cpp | 12 ------------ src/insets/InsetTabular.h | 4 ---- src/output_latex.cpp | 18 ++++++++++-------- 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/src/insets/InsetTabular.cpp b/src/insets/InsetTabular.cpp index 244fbd4b38..c7785d68ab 100644 --- a/src/insets/InsetTabular.cpp +++ b/src/insets/InsetTabular.cpp @@ -4198,12 +4198,6 @@ InsetTableCell::InsetTableCell(Buffer * buf) isMultiColumn(false), isMultiRow(false), contentAlign(LYX_ALIGN_CENTER) {} -bool InsetTableCell::forcePlainLayout(idx_type) const -{ - return isMultiRow; -} - - bool InsetTableCell::allowParagraphCustomization(idx_type) const { return isFixedWidth; @@ -7398,12 +7392,6 @@ bool InsetTabular::allowParagraphCustomization(idx_type cell) const } -bool InsetTabular::forcePlainLayout(idx_type cell) const -{ - return tabular.isMultiRow(cell); -} - - bool InsetTabular::insertPlaintextString(BufferView & bv, docstring const & buf, bool usePaste) { diff --git a/src/insets/InsetTabular.h b/src/insets/InsetTabular.h index 3064522287..a405591af5 100644 --- a/src/insets/InsetTabular.h +++ b/src/insets/InsetTabular.h @@ -136,8 +136,6 @@ private: /// bool usePlainLayout() const override { return true; } /// - bool forcePlainLayout(idx_type = 0) const override; - /// bool allowParagraphCustomization(idx_type = 0) const override; /// bool forceLocalFontSwitch() const override; @@ -1034,8 +1032,6 @@ public: /// should all paragraphs be output with "Standard" layout? bool allowParagraphCustomization(idx_type cell = 0) const override; /// - bool forcePlainLayout(idx_type cell = 0) const override; - /// void addPreview(DocIterator const & inset_pos, graphics::PreviewLoader &) const override; diff --git a/src/output_latex.cpp b/src/output_latex.cpp index c5306d74ac..4589b3795b 100644 --- a/src/output_latex.cpp +++ b/src/output_latex.cpp @@ -1455,12 +1455,7 @@ void TeXOnePar(Buffer const & buf, // Note from JMarc: we will re-add a \n explicitly in // TeXEnvironment, because it is needed in this case if (nextpar && !os.afterParbreak() && !last_was_separator) { - if (runparams.isNonLong) - // This is to allow parbreak in multirow - // It could also be used for other non-long - // contexts - os << "\\endgraf"; - else if (!text.inset().getLayout().parbreakIgnored() && !merged_par) + if (!text.inset().getLayout().parbreakIgnored() && !merged_par) // Make sure to start a new line os << breakln; // A newline '\n' is always output before a command, @@ -1507,8 +1502,15 @@ void TeXOnePar(Buffer const & buf, && tclass.isDefaultLayout(next_layout))) { // and omit paragraph break if it has been deleted with ct // and changes are not shown in output - if (!merged_par) - os << '\n'; + if (!merged_par) { + if (runparams.isNonLong) + // This is to allow parbreak in multirow + // It could also be used for other non-long + // contexts + os << "\\endgraf\n"; + else + os << '\n'; + } } } }