From 092b65d5095f2b37138b45e605eff1fc1d9a1006 Mon Sep 17 00:00:00 2001 From: my Date: Wed, 18 Dec 2019 18:02:00 +0100 Subject: [PATCH] Weiter Logic Fehler changed. v2.2 --- src/TextRenderer.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/TextRenderer.cpp b/src/TextRenderer.cpp index 902d0f1..2621c01 100644 --- a/src/TextRenderer.cpp +++ b/src/TextRenderer.cpp @@ -168,7 +168,7 @@ std::string TextRenderer::adjustText(std::string newText) { } 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) { endIndex = i; + + return newText.substr(startIndex + 1, endIndex); } } else if (newText[i] != specialCharacter) { characterNumberOfCurrentLine++; @@ -206,10 +208,14 @@ std::string TextRenderer::adjustText(std::string newText, int startLine, int end if(currentLine == endLine) { endIndex = i; + + return newText.substr(startIndex + 1, endIndex); } } } } + + std::cout << "Fehler!! when adjust string." << std::endl; return std::string(); }