MCPcopy Create free account
hub / github.com/KDE/kdiff3 / calcTopLineInFile

Method calcTopLineInFile

src/difftextwindow.cpp:2029–2039  ·  view source on GitHub ↗

Search for the first visible line (search loop needed when no line exists for this file.)

Source from the content-addressed store, hash-verified

2027
2028// Search for the first visible line (search loop needed when no line exists for this file.)
2029LineRef DiffTextWindow::calcTopLineInFile(const LineRef firstLine) const
2030{
2031 LineRef currentLine;
2032 for(size_t i = convertLineToDiff3LineIdx(firstLine); i < d->getDiff3LineVector()->size(); ++i)
2033 {
2034 const Diff3Line* d3l = (*d->getDiff3LineVector())[i];
2035 currentLine = d3l->getLineInFile(getWindowIndex());
2036 if(currentLine.isValid()) break;
2037 }
2038 return currentLine;
2039}
2040
2041void DiffTextWindowFrame::setFirstLine(const LineRef firstLine)
2042{

Callers 2

slotFilePrintMethod · 0.80
setFirstLineMethod · 0.80

Calls 4

getLineInFileMethod · 0.80
sizeMethod · 0.45
getDiff3LineVectorMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected