mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Prevent unneeded (and wrong) \noindent
* When a paragraph is logically empty (only contains stuff which is not part of the text sequence * In centered paragraphs
This commit is contained in:
parent
710fb50118
commit
045c25cf76
@ -2339,13 +2339,26 @@ int Paragraph::Private::startTeXParParams(BufferParams const & bparams,
|
||||
(layout_->toggle_indent != ITOGGLE_NEVER) :
|
||||
(layout_->toggle_indent == ITOGGLE_ALWAYS);
|
||||
|
||||
if (canindent && params_.noindent() && !layout_->pass_thru) {
|
||||
os << "\\noindent ";
|
||||
column += 10;
|
||||
// Paragraphs that only contain insets which are not part of the text sequence
|
||||
// (e.g., floats) should not get \\noindent (this would cause extra white space)
|
||||
bool emptypar = true;
|
||||
if (canindent) {
|
||||
for (pos_type i = 0; i < owner_->size(); ++i) {
|
||||
if (!owner_->isInset(i) || owner_->getInset(i)->isPartOfTextSequence()) {
|
||||
emptypar = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LyXAlignment const curAlign = params_.align();
|
||||
|
||||
if (canindent && !emptypar && params_.noindent()
|
||||
&& !layout_->pass_thru && curAlign != LYX_ALIGN_CENTER) {
|
||||
os << "\\noindent ";
|
||||
column += 10;
|
||||
}
|
||||
|
||||
if (curAlign == layout_->align)
|
||||
return column;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user