mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-24 05:40:59 +00:00
* src/CutAndPaste.C: simplify code by making use of
Paragraph::isMergedOnEndOfParDeletion() git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16030 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
62ef9250a2
commit
8d31ce8bf4
@ -297,18 +297,11 @@ PitPosPair eraseSelectionHelper(BufferParams const & params,
|
|||||||
pos_type const left = (pit == startpit ? startpos : 0);
|
pos_type const left = (pit == startpit ? startpos : 0);
|
||||||
pos_type const right = (pit == endpit ? endpos : pars[pit].size() + 1);
|
pos_type const right = (pit == endpit ? endpos : pars[pit].size() + 1);
|
||||||
|
|
||||||
|
bool const merge = pars[pit].isMergedOnEndOfParDeletion(params.trackChanges);
|
||||||
|
|
||||||
// Logically erase only, including the end-of-paragraph character
|
// Logically erase only, including the end-of-paragraph character
|
||||||
pars[pit].eraseChars(left, right, params.trackChanges);
|
pars[pit].eraseChars(left, right, params.trackChanges);
|
||||||
|
|
||||||
// A paragraph break has to be physically removed by merging only
|
|
||||||
// if either (1) change tracking is off, or (2) the imaginary
|
|
||||||
// end-of-paragraph character is marked as inserted even after
|
|
||||||
// the erase operation (please see Paragraph::Pimpl::eraseChar(...)
|
|
||||||
// for details on end-of-par handling)
|
|
||||||
|
|
||||||
bool const merge = !params.trackChanges ||
|
|
||||||
pars[pit].isInserted(pars[pit].size());
|
|
||||||
|
|
||||||
// Separate handling of paragraph break:
|
// Separate handling of paragraph break:
|
||||||
if (merge && pit != endpit &&
|
if (merge && pit != endpit &&
|
||||||
(pit + 1 != endpit || pars[pit].hasSameLayout(pars[pit + 1]))) {
|
(pit + 1 != endpit || pars[pit].hasSameLayout(pars[pit + 1]))) {
|
||||||
|
Loading…
Reference in New Issue
Block a user