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

Method getString

src/difftextwindow.cpp:1375–1392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1373}
1374
1375QString DiffTextWindowData::getString(const LineType d3lIdx) const
1376{
1377 assert(!(m_pLineData != nullptr && m_pLineData->empty() && m_size != 0));
1378 //Qt sends resize events pre-init under certian conditions. No good way to avoid this.
1379 if(mDiff3LineVector == nullptr)
1380 return QString();
1381
1382 if(m_pLineData == nullptr || m_pLineData->empty() || d3lIdx < 0 || (size_t)d3lIdx >= mDiff3LineVector->size())
1383 return QString();
1384
1385 const Diff3Line* d3l = (*mDiff3LineVector)[d3lIdx];
1386 const LineType lineIdx = d3l->getLineIndex(getWindowIndex());
1387
1388 if(lineIdx == LineRef::invalid)
1389 return QString();
1390
1391 return (*m_pLineData)[lineIdx].getLine();
1392}
1393
1394QString DiffTextWindowData::getLineString(const LineType line) const
1395{

Callers 5

getMaxTextWidthMethod · 0.45
mouseDoubleClickEventMethod · 0.45
findStringMethod · 0.45
setSelectionMethod · 0.45
recalcWordWrapHelperMethod · 0.45

Calls 3

getLineIndexMethod · 0.80
getLineMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected