Weiter Logic Fehler changed. v2.2

This commit is contained in:
my 2019-12-18 18:02:00 +01:00
parent 33fd4b0e47
commit 092b65d509
1 changed files with 7 additions and 1 deletions

View File

@ -168,7 +168,7 @@ std::string TextRenderer::adjustText(std::string newText) {
} }
if(currentLine == startLine) { if(currentLine == startLine) {
return newText.substr(i, newText.size()); return newText.substr(i + 1, newText.size());
} }
} }
} }
@ -193,6 +193,8 @@ std::string TextRenderer::adjustText(std::string newText, int startLine, int end
if(currentLine == endLine) { if(currentLine == endLine) {
endIndex = i; endIndex = i;
return newText.substr(startIndex + 1, endIndex);
} }
} else if (newText[i] != specialCharacter) { } else if (newText[i] != specialCharacter) {
characterNumberOfCurrentLine++; characterNumberOfCurrentLine++;
@ -206,10 +208,14 @@ std::string TextRenderer::adjustText(std::string newText, int startLine, int end
if(currentLine == endLine) { if(currentLine == endLine) {
endIndex = i; endIndex = i;
return newText.substr(startIndex + 1, endIndex);
} }
} }
} }
} }
std::cout << "Fehler!! when adjust string." << std::endl;
return std::string(); return std::string();
} }