X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FParagraph.cpp;h=6b1e118697cabbd6a2b099f8a5d11a4ac894fdfa;hb=bca1b63d89e27b31b089ab48c63368640084b3a6;hp=98be025f809d550394ca9624275b1d3e07d6086b;hpb=456a72b62a76803d88e11facc787ebfed477bb40;p=lyx.git diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index 98be025f80..6b1e118697 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -2352,17 +2352,26 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams, LyXAlignment const curAlign = params_.align(); // Do not output \\noindent for paragraphs - // 1. that cannot have indentation, + // 1. that cannot have indentation or are indented always, // 2. that are not part of the immediate text sequence (e.g., contain only floats), // 3. that are PassThru, - // 4. that are centered, - // 5. or start with a vspace. - if (canindent && params_.noindent() && owner_->isPartOfTextSequence() - && !layout_->pass_thru && curAlign != LYX_ALIGN_CENTER - && !owner_->empty() - && (!owner_->isInset(0) || owner_->getInset(0)->lyxCode() != VSPACE_CODE)) { - os << "\\noindent" << termcmd; - column += 10; + // 4. or that are centered. + if (canindent && params_.noindent() + && owner_->isPartOfTextSequence() + && !layout_->pass_thru + && curAlign != LYX_ALIGN_CENTER) { + if (!owner_->empty() + && (owner_->isInset(0) + && owner_->getInset(0)->lyxCode() == VSPACE_CODE)) + // If the paragraph starts with a vspace, the \\noindent + // needs to come after that (as it leaves vmode). + // If the paragraph consists only of the vspace, + // \\noindent is not needed at all. + runparams.need_noindent = owner_->size() > 1; + else { + os << "\\noindent" << termcmd; + column += 10; + } } if (curAlign == layout_->align)