mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-23 13:31:49 +00:00
Fix breaking of MANUAL_LABEL paragraph when label is too long
Typical example is a Labeling layout which label is an inline equation larger than the screen. Before this commit, the row would not get broken at all. Two parts in the patch: 1/ when breaking the row in shortenIfNeeded, mark the last element as AlwaysBreakAfter instead of BreakAfter, in case the next element is NoBreakBefore. 2/ when nothing could be done, as last resort keep the first element of the row only.
This commit is contained in:
parent
f8f86a1a81
commit
6c98ac5a7b
@ -537,7 +537,7 @@ void moveElements(Row::Elements & from, Row::Elements::iterator const & it,
|
|||||||
to.insert(to.end(), it, from.end());
|
to.insert(to.end(), it, from.end());
|
||||||
from.erase(it, from.end());
|
from.erase(it, from.end());
|
||||||
if (!from.empty())
|
if (!from.empty())
|
||||||
from.back().row_flags = (from.back().row_flags & ~AfterFlags) | BreakAfter;
|
from.back().row_flags = (from.back().row_flags & ~AfterFlags) | AlwaysBreakAfter;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@ -645,7 +645,9 @@ Row::Elements Row::shortenIfNeeded(int const w, int const next_width)
|
|||||||
return tail;
|
return tail;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Elements();
|
// cit == beg; remove all elements after the first one.
|
||||||
|
moveElements(elements_, cit + 1, tail);
|
||||||
|
return tail;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user