diff options
Diffstat (limited to 'sc')
-rw-r--r-- | sc/inc/stringutil.hxx | 2 | ||||
-rw-r--r-- | sc/source/core/tool/stringutil.cxx | 10 | ||||
-rw-r--r-- | sc/source/ui/app/inputhdl.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/docshell/docsh.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/unoobj/exceldetect.cxx | 4 |
5 files changed, 8 insertions, 14 deletions
diff --git a/sc/inc/stringutil.hxx b/sc/inc/stringutil.hxx index 8cdb5821d0a9..150a3ede269e 100644 --- a/sc/inc/stringutil.hxx +++ b/sc/inc/stringutil.hxx @@ -153,7 +153,7 @@ public: static OUString SC_DLLPUBLIC GetQuotedToken(const OUString &rIn, sal_Int32 nToken, const OUString& rQuotedPairs, sal_Unicode cTok, sal_Int32& rIndex ); - static bool SC_DLLPUBLIC isMultiline( const OUString& rStr ); + static bool SC_DLLPUBLIC isMultiline( std::u16string_view rStr ); static ScInputStringType parseInputString( SvNumberFormatter& rFormatter, const OUString& rStr, LanguageType eLang ); diff --git a/sc/source/core/tool/stringutil.cxx b/sc/source/core/tool/stringutil.cxx index 7532d720e57a..131853a5f162 100644 --- a/sc/source/core/tool/stringutil.cxx +++ b/sc/source/core/tool/stringutil.cxx @@ -421,15 +421,9 @@ OUString ScStringUtil::GetQuotedToken(const OUString &rIn, sal_Int32 nToken, con } } -bool ScStringUtil::isMultiline( const OUString& rStr ) +bool ScStringUtil::isMultiline( std::u16string_view rStr ) { - if (rStr.indexOf('\n') != -1) - return true; - - if (rStr.indexOf('\r') != -1) - return true; - - return false; + return rStr.find_first_of(u"\n\r") != std::u16string_view::npos; } ScInputStringType ScStringUtil::parseInputString( diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index 4d5d1a1d8ac2..abd1190475fb 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -1107,9 +1107,9 @@ void ScInputHandler::HideTipBelow() namespace { -bool lcl_hasSingleToken(const OUString& s, sal_Unicode c) +bool lcl_hasSingleToken(std::u16string_view s, sal_Unicode c) { - return !s.isEmpty() && s.indexOf(c)<0; + return !s.empty() && s.find(c) == std::u16string_view::npos; } } diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 8c64e3a8416f..633fda283499 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -3422,7 +3422,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT bool TestImportDBF(SvStream &rStream) OUString sTmpDir = aTmpDir.GetURL(); OUString sExtension(".dbf"); - utl::TempFile aTempInput(OUString(), true, &sExtension, &sTmpDir); + utl::TempFile aTempInput(u"", true, &sExtension, &sTmpDir); aTempInput.EnableKillingFile(); SvStream* pInputStream = aTempInput.GetStream(StreamMode::WRITE); diff --git a/sc/source/ui/unoobj/exceldetect.cxx b/sc/source/ui/unoobj/exceldetect.cxx index a50f9994f4d2..75694bbc9620 100644 --- a/sc/source/ui/unoobj/exceldetect.cxx +++ b/sc/source/ui/unoobj/exceldetect.cxx @@ -120,9 +120,9 @@ bool isExcel40(const uno::Reference<io::XInputStream>& xInStream) return true; } -bool isTemplate(const OUString& rType) +bool isTemplate(std::u16string_view rType) { - return rType.indexOf("_VorlageTemplate") != -1; + return rType.find(u"_VorlageTemplate") != std::u16string_view::npos; } } |