summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2020-08-07 14:38:07 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-08-07 18:56:51 +0200
commitf3da84db230a10551bbdbd6cdf5e4cf669e54e2a (patch)
tree6362971cbf1935b675e71e83b508bac5470a40ae /extensions
parentoox: VML export: convert ESCHER_Prop_AnchorText to v-text-anchor (diff)
downloadcore-f3da84db230a10551bbdbd6cdf5e4cf669e54e2a.tar.gz
core-f3da84db230a10551bbdbd6cdf5e4cf669e54e2a.zip
Make use of std string_view
Change-Id: Ic4b330b7d046ba77e51d32d156501a18e3782985 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/100313 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/logging/csvformatter.cxx8
1 files changed, 2 insertions, 6 deletions
diff --git a/extensions/source/logging/csvformatter.cxx b/extensions/source/logging/csvformatter.cxx
index 866833c41fd5..9ab747ad504d 100644
--- a/extensions/source/logging/csvformatter.cxx
+++ b/extensions/source/logging/csvformatter.cxx
@@ -30,6 +30,7 @@
#include <rtl/ustrbuf.hxx>
#include <stdio.h>
+#include <string_view>
namespace logging
{
@@ -91,12 +92,7 @@ namespace
bool needsQuoting(const OUString& str)
{
- static const OUString quote_trigger_chars = "\",\n\r";
- sal_Int32 len = str.getLength();
- for(sal_Int32 i=0; i<len; i++)
- if(quote_trigger_chars.indexOf(str[i])!=-1)
- return true;
- return false;
+ return std::u16string_view(str).find_first_of(u"\",\n\r") != std::u16string_view::npos;
};
void appendEncodedString(OUStringBuffer& buf, const OUString& str)