diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-21 11:09:46 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-21 15:46:10 +0200 |
commit | 776ea34deefe7bdce2fb8a06e5c55ef27ec87ea7 (patch) | |
tree | bb56240e4c01367712f3c17ebd1b70fe5cffa697 /xmloff/source/style | |
parent | 70f8bddf87537e5ca28758a1f59bda23c0963501 (diff) |
use more string_view in xmloff
Change-Id: Ieef49d049760e557d341f1991f28333b09220c1d
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140336
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmloff/source/style')
-rw-r--r-- | xmloff/source/style/prstylei.cxx | 4 | ||||
-rw-r--r-- | xmloff/source/style/xmlnumfi.cxx | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/xmloff/source/style/prstylei.cxx b/xmloff/source/style/prstylei.cxx index aae787d491c6..a0277bf8a752 100644 --- a/xmloff/source/style/prstylei.cxx +++ b/xmloff/source/style/prstylei.cxx @@ -543,9 +543,9 @@ void XMLPropStyleContext::Finish( bool bOverwrite ) } bool XMLPropStyleContext::doNewDrawingLayerFillStyleDefinitionsExist( - const OUString& rFillStyleTag) const + std::u16string_view rFillStyleTag) const { - if(!maProperties.empty() && rFillStyleTag.getLength()) + if(!maProperties.empty() && !rFillStyleTag.empty()) { // no & to avoid non-obvious UAF due to the 2nd temp Reference const rtl::Reference<XMLPropertySetMapper> rMapper = GetStyles()->GetImportPropertyMapper(GetFamily())->getPropertySetMapper(); diff --git a/xmloff/source/style/xmlnumfi.cxx b/xmloff/source/style/xmlnumfi.cxx index bedd13bebcf6..370af2bde369 100644 --- a/xmloff/source/style/xmlnumfi.cxx +++ b/xmloff/source/style/xmlnumfi.cxx @@ -1947,10 +1947,10 @@ void SvXMLNumFormatContext::AddNfKeyword( sal_uInt16 nIndex ) } } -static bool lcl_IsAtEnd( OUStringBuffer& rBuffer, const OUString& rToken ) +static bool lcl_IsAtEnd( OUStringBuffer& rBuffer, std::u16string_view rToken ) { sal_Int32 nBufLen = rBuffer.getLength(); - sal_Int32 nTokLen = rToken.getLength(); + sal_Int32 nTokLen = rToken.size(); if ( nTokLen > nBufLen ) return false; |