From 2eb088ef1cc5d71ac20a3ef178ee02e3f3e14506 Mon Sep 17 00:00:00 2001 From: kaetemi Date: Thu, 29 Oct 2020 01:58:24 +0800 Subject: [PATCH] Cleanup, ryzom/ryzomcore#335 --- nel/include/nel/gui/string_case.h | 5 -- nel/src/gui/string_case.cpp | 100 +----------------------------- 2 files changed, 1 insertion(+), 104 deletions(-) diff --git a/nel/include/nel/gui/string_case.h b/nel/include/nel/gui/string_case.h index 300d72c76..bd56c7998 100644 --- a/nel/include/nel/gui/string_case.h +++ b/nel/include/nel/gui/string_case.h @@ -25,7 +25,6 @@ namespace NLGUI { - enum TCaseMode { CaseNormal = 0, // Nothing done @@ -37,11 +36,7 @@ namespace NLGUI CaseCount }; - - void setCase( ucstring &str, TCaseMode mode ); void setCase( std::string &str, TCaseMode mode ); - - } #endif diff --git a/nel/src/gui/string_case.cpp b/nel/src/gui/string_case.cpp index f6218d39a..8946a5d1d 100644 --- a/nel/src/gui/string_case.cpp +++ b/nel/src/gui/string_case.cpp @@ -32,18 +32,6 @@ namespace NLGUI return (c == (u32char)' ') || (c == (u32char)'\t') || (c == (u32char)'\n') || (c == (u32char)'\r'); } - inline bool isSeparator (ucchar c) - { - return (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'); - } - - inline bool isSeparator (char c) - { - return (c == ' ') || (c == '\t') || (c == '\n') || (c == '\r'); - } - - // *************************************************************************** - inline bool isEndSentence (u32char c, u32char lastChar) { // Ex: One sentence. Another sentence. @@ -54,90 +42,6 @@ namespace NLGUI && (lastChar == (u32char)'.') || (lastChar == (u32char)'!') || (lastChar == (u32char)'?'); } - inline bool isEndSentence (ucstring& str, uint index) - { - // Ex: One sentence. Another sentence. - // ^ - // Counterexample: nevrax.com - // ^ - ucchar c = str[index]; - if ((str[index] == ' ') || (str[index] == '\n')) - { - if (index < 1) - return false; - c = str[index-1]; - return (c == '.') || (c == '!') || (c == '?'); - } - return false; - } - - - void setCase( ucstring &str, TCaseMode mode ) - { - const uint length = (uint)str.length(); - uint i; - bool newString = true; - bool newSentence = true; - bool newWord = true; - switch (mode) - { - case CaseLower: - str = NLMISC::toLower (str); - break; - case CaseUpper: - str = NLMISC::toUpper (str); - break; - case CaseFirstStringLetterUp: - for (i=0; i