Remove all lines that are empty, because no src lines are there.
| 309 | } |
| 310 | // Remove all lines that are empty, because no src lines are there. |
| 311 | void MergeBlock::removeEmptySource() |
| 312 | { |
| 313 | LineRef oldSrcLine; |
| 314 | e_SrcSelector oldSrc = e_SrcSelector::Invalid; |
| 315 | MergeEditLineList::iterator melIt; |
| 316 | for(melIt = list().begin(); melIt != list().end();) |
| 317 | { |
| 318 | MergeEditLine& mel = *melIt; |
| 319 | e_SrcSelector melsrc = mel.src(); |
| 320 | |
| 321 | LineRef srcLine = mel.isRemoved() ? LineRef() : melsrc == e_SrcSelector::A ? mel.id3l()->getLineA() : melsrc == e_SrcSelector::B ? mel.id3l()->getLineB() : melsrc == e_SrcSelector::C ? mel.id3l()->getLineC() : LineRef(); |
| 322 | |
| 323 | // At least one line remains because oldSrc != melsrc for first line in list |
| 324 | // Other empty lines will be removed |
| 325 | if(!srcLine.isValid() && !oldSrcLine.isValid() && oldSrc == melsrc) |
| 326 | melIt = list().erase(melIt); |
| 327 | else |
| 328 | ++melIt; |
| 329 | |
| 330 | oldSrcLine = srcLine; |
| 331 | oldSrc = melsrc; |
| 332 | } |
| 333 | } |
| 334 | |
| 335 | // Returns the iterator to the MergeBlock after the split |
| 336 | MergeBlockList::iterator MergeBlockList::splitAtDiff3LineIdx(qint32 d3lLineIdx) |