MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / getPos

Function getPos

gui/codeeditor.cpp:305–317  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

303}
304
305static int getPos(const QString &fileData, int lineNumber)
306{
307 if (lineNumber <= 1)
308 return 0;
309 for (int pos = 0, line = 1; pos < fileData.size(); ++pos) {
310 if (fileData[pos] != '\n')
311 continue;
312 ++line;
313 if (line >= lineNumber)
314 return pos + 1;
315 }
316 return fileData.size();
317}
318
319void CodeEditor::setStyle(const CodeEditorStyle& newStyle)
320{

Callers 1

setErrorMethod · 0.85

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected