From: Steve Brokenshire Date: Tue, 28 Jun 2016 21:54:53 +0000 (+0100) Subject: Added OutputText function X-Git-Tag: release-0.14~54 X-Git-Url: http://Server1/repobrowser/?p=xestiaab%2F.git;a=commitdiff_plain;h=6bb536c3e2f509be4ea5d1f743785be3cfd60704 Added OutputText function --- diff --git a/source/common/textprocessing.cpp b/source/common/textprocessing.cpp index 9d6c8ff..b73252d 100644 --- a/source/common/textprocessing.cpp +++ b/source/common/textprocessing.cpp @@ -177,4 +177,44 @@ bool MapDataExists(int *ItemIndex, std::map *MapPtr){ } +} + +wxString OutputText(wxString *TextInput){ + + wxString OutputTextData; + wxString OutputLine; + int CharSeek = 0; + int LineSeek = 0; + int MaxLineSeek = 77; + + for (CharSeek = 0; CharSeek < TextInput->size(); CharSeek++){ + + LineSeek++; + + if (LineSeek == MaxLineSeek){ + + if (TextInput->substr(CharSeek, 1) != "\n"){ + OutputLine += TextInput->substr(CharSeek, 1); + } + OutputLine += "\n"; + OutputTextData += OutputLine; + OutputLine = " "; + LineSeek = 0; + MaxLineSeek = 76; + continue; + + } + + OutputLine += TextInput->substr(CharSeek, 1); + + } + + if (OutputLine != " "){ + + OutputTextData += OutputLine; + + } + + return OutputTextData; + } \ No newline at end of file diff --git a/source/common/textprocessing.h b/source/common/textprocessing.h index 7a63ea0..97ea9a1 100644 --- a/source/common/textprocessing.h +++ b/source/common/textprocessing.h @@ -39,6 +39,8 @@ void DeleteMapDataProcess(int IndexNum, std::map* MapData); bool MapDataExists(int *ItemIndex, std::map *MapPtr); bool MapDataExists(int *ItemIndex, std::map *MapPtr); +wxString OutputText(wxString *TextInput); + //void DeleteMapDataB() {}; //void DeleteMapData() {};