diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:27:00 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2015-06-02 11:27:00 +0200 |
commit | 91957a75aab89415d92aa137d73fc5cf892a0408 (patch) | |
tree | f70e30816dc893357985ff9902b46e45acd7744e /i18npool | |
parent | 34c2adbdfb32927468778e786437eecf8ece8249 (diff) |
loplugin:cstylecast: deal with those that are (technically) const_cast
Change-Id: I5bad1428e96c76f7d295f69e10beea4397d560ff
Diffstat (limited to 'i18npool')
-rw-r--r-- | i18npool/qa/cppunit/test_textsearch.cxx | 8 | ||||
-rw-r--r-- | i18npool/source/breakiterator/gendict.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/collator/gencoll_rule.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/indexentry/genindex_data.cxx | 2 | ||||
-rw-r--r-- | i18npool/source/search/textsearch.cxx | 6 | ||||
-rw-r--r-- | i18npool/source/textconversion/genconv_dict.cxx | 6 |
6 files changed, 13 insertions, 13 deletions
diff --git a/i18npool/qa/cppunit/test_textsearch.cxx b/i18npool/qa/cppunit/test_textsearch.cxx index db2d4022250e..3de164ac6007 100644 --- a/i18npool/qa/cppunit/test_textsearch.cxx +++ b/i18npool/qa/cppunit/test_textsearch.cxx @@ -61,11 +61,11 @@ void TestTextSearch::testICU() OUString aString( "abcdefgh" ); OUString aPattern( "e" ); - IcuUniString aSearchPat( (const UChar*)aPattern.getStr(), aPattern.getLength() ); + IcuUniString aSearchPat( reinterpret_cast<const UChar*>(aPattern.getStr()), aPattern.getLength() ); pRegexMatcher = new RegexMatcher( aSearchPat, nSearchFlags, nErr ); - IcuUniString aSource( (const UChar*)aString.getStr(), aString.getLength() ); + IcuUniString aSource( reinterpret_cast<const UChar*>(aString.getStr()), aString.getLength() ); pRegexMatcher->reset( aSource ); CPPUNIT_ASSERT( pRegexMatcher->find( 0, nErr ) ); @@ -80,10 +80,10 @@ void TestTextSearch::testICU() OUString aString2( "acababaabcababadcdaa" ); OUString aPattern2( "a" ); - IcuUniString aSearchPat2( (const UChar*)aPattern2.getStr(), aPattern2.getLength() ); + IcuUniString aSearchPat2( reinterpret_cast<const UChar*>(aPattern2.getStr()), aPattern2.getLength() ); pRegexMatcher = new RegexMatcher( aSearchPat2, nSearchFlags, nErr ); - IcuUniString aSource2( (const UChar*)aString2.getStr(), aString2.getLength() ); + IcuUniString aSource2( reinterpret_cast<const UChar*>(aString2.getStr()), aString2.getLength() ); pRegexMatcher->reset( aSource2 ); CPPUNIT_ASSERT( pRegexMatcher->find( 0, nErr ) ); diff --git a/i18npool/source/breakiterator/gendict.cxx b/i18npool/source/breakiterator/gendict.cxx index 8bec7d203fb4..3e649dd964fb 100644 --- a/i18npool/source/breakiterator/gendict.cxx +++ b/i18npool/source/breakiterator/gendict.cxx @@ -120,7 +120,7 @@ static inline void printDataArea(FILE *dictionary_fp, FILE *source_fp, vector<sa while (fgets(str, 1024, dictionary_fp)) { // input file is in UTF-8 encoding // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)str, strlen(str) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(str, strlen(str) - 1, RTL_TEXTENCODING_UTF8); const sal_Unicode *u = Ostr.getStr(); const sal_Int32 len = Ostr.getLength(); diff --git a/i18npool/source/collator/gencoll_rule.cxx b/i18npool/source/collator/gencoll_rule.cxx index 201170a2e80c..b4f0ad2671fd 100644 --- a/i18npool/source/collator/gencoll_rule.cxx +++ b/i18npool/source/collator/gencoll_rule.cxx @@ -97,7 +97,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) continue; // input file is in UTF-8 encoding - OUString Ostr = OUString((const sal_Char *)str, len, RTL_TEXTENCODING_UTF8).trim(); + OUString Ostr = OUString(str, len, RTL_TEXTENCODING_UTF8).trim(); len = Ostr.getLength(); if (len == 0) diff --git a/i18npool/source/indexentry/genindex_data.cxx b/i18npool/source/indexentry/genindex_data.cxx index 990b24b31399..a4721d8c907c 100644 --- a/i18npool/source/indexentry/genindex_data.cxx +++ b/i18npool/source/indexentry/genindex_data.cxx @@ -60,7 +60,7 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv) continue; // input file is in UTF-8 encoding - OUString Ostr = OUString((const sal_Char *)str, len, RTL_TEXTENCODING_UTF8); + OUString Ostr = OUString(str, len, RTL_TEXTENCODING_UTF8); len = Ostr.getLength(); if (len == 0) continue; // skip empty line. diff --git a/i18npool/source/search/textsearch.cxx b/i18npool/source/search/textsearch.cxx index b8005fb66ecf..b62b56c06c33 100644 --- a/i18npool/source/search/textsearch.cxx +++ b/i18npool/source/search/textsearch.cxx @@ -783,7 +783,7 @@ void TextSearch::RESrchPrepare( const ::com::sun::star::util::SearchOptions& rOp nIcuSearchFlags |= UREGEX_CASE_INSENSITIVE; UErrorCode nIcuErr = U_ZERO_ERROR; // assumption: transliteration didn't mangle regexp control chars - IcuUniString aIcuSearchPatStr( (const UChar*)rPatternStr.getStr(), rPatternStr.getLength()); + IcuUniString aIcuSearchPatStr( reinterpret_cast<const UChar*>(rPatternStr.getStr()), rPatternStr.getLength()); #ifndef DISABLE_WORDBOUND_EMULATION // for conveniance specific syntax elements of the old regex engine are emulated // - by replacing \< with "word-break followed by a look-ahead word-char" @@ -860,7 +860,7 @@ SearchResult TextSearch::RESrchFrwrd( const OUString& searchStr, // use the ICU RegexMatcher to find the matches UErrorCode nIcuErr = U_ZERO_ERROR; - const IcuUniString aSearchTargetStr( (const UChar*)searchStr.getStr(), endPos); + const IcuUniString aSearchTargetStr( reinterpret_cast<const UChar*>(searchStr.getStr()), endPos); pRegexMatcher->reset( aSearchTargetStr); // search until there is a valid match for(;;) @@ -915,7 +915,7 @@ SearchResult TextSearch::RESrchBkwrd( const OUString& searchStr, // TODO: use ICU's backward searching once it becomes available // as its replacement using forward search is not as good as the real thing UErrorCode nIcuErr = U_ZERO_ERROR; - const IcuUniString aSearchTargetStr( (const UChar*)searchStr.getStr(), startPos); + const IcuUniString aSearchTargetStr( reinterpret_cast<const UChar*>(searchStr.getStr()), startPos); pRegexMatcher->reset( aSearchTargetStr); if (!lcl_findRegex( pRegexMatcher, endPos, nIcuErr)) return aRet; diff --git a/i18npool/source/textconversion/genconv_dict.cxx b/i18npool/source/textconversion/genconv_dict.cxx index c7538ee25004..f83d4cacff92 100644 --- a/i18npool/source/textconversion/genconv_dict.cxx +++ b/i18npool/source/textconversion/genconv_dict.cxx @@ -100,7 +100,7 @@ void make_hhc_char(FILE *sfp, FILE *cfp) while (fgets(Cstr, 1024, sfp)) { // input file is in UTF-8 encoding (Hangul:Hanja) // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); const sal_Unicode *Ustr = Ostr.getStr(); sal_Int32 len = Ostr.getLength(); @@ -188,7 +188,7 @@ void make_stc_char(FILE *sfp, FILE *cfp) while (fgets(Cstr, 1024, sfp)) { // input file is in UTF-8 encoding (SChinese:TChinese) // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); const sal_Unicode *Ustr = Ostr.getStr(); sal_Int32 len = Ostr.getLength(); if (Ustr[1] == 'v') @@ -354,7 +354,7 @@ void make_stc_word(FILE *sfp, FILE *cfp) while (fgets(Cstr, 1024, sfp)) { // input file is in UTF-8 encoding (SChinese:TChinese) // don't convert last new line character to Ostr. - OUString Ostr((const sal_Char *)Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); + OUString Ostr(Cstr, strlen(Cstr) - 1, RTL_TEXTENCODING_UTF8); sal_Int32 len = Ostr.getLength(); if (char_total + len + 1 > 0xFFFF) { fprintf(stderr, "Word Dictionary stc_word.dic is too big (line %ld)", sal::static_int_cast< long >(line)); |