include/tools/globname.hxx | 2 +- svx/source/xml/xmleohlp.cxx | 2 +- tools/source/ref/globname.cxx | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-)
New commits: commit f757f152b1d2267e92a1100a9db58bf6e5aa8d3c Author: Noel Grandin <noel.gran...@collabora.co.uk> AuthorDate: Thu Apr 28 12:47:31 2022 +0200 Commit: Noel Grandin <noel.gran...@collabora.co.uk> CommitDate: Thu Apr 28 16:10:16 2022 +0200 use more string_view in tools::SvGlobalName Change-Id: I814744d250d6ce0ec7049daf215a506adb4f1ac5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133548 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/include/tools/globname.hxx b/include/tools/globname.hxx index 8ff2a8b28220..50c3fc27b923 100644 --- a/include/tools/globname.hxx +++ b/include/tools/globname.hxx @@ -59,7 +59,7 @@ public: { return !(*this == rObj); } void MakeFromMemory( void const * pData ); - bool MakeId( const OUString & rId ); + bool MakeId( std::u16string_view rId ); OUString GetHexName() const; const SvGUID& GetCLSID() const { return m_aData; } diff --git a/svx/source/xml/xmleohlp.cxx b/svx/source/xml/xmleohlp.cxx index e3fcf6100940..3a57b1754775 100644 --- a/svx/source/xml/xmleohlp.cxx +++ b/svx/source/xml/xmleohlp.cxx @@ -438,7 +438,7 @@ OUString SvXMLEmbeddedObjectHelper::ImplInsertEmbeddedObjectURL( SvGlobalName aClassId, *pClassId = nullptr; sal_Int32 nPos = aObjectStorageName.lastIndexOf( '!' ); - if( -1 != nPos && aClassId.MakeId( aObjectStorageName.copy( nPos+1 ) ) ) + if( -1 != nPos && aClassId.MakeId( aObjectStorageName.subView( nPos+1 ) ) ) { aObjectStorageName = aObjectStorageName.copy( 0, nPos ); pClassId = &aClassId; diff --git a/tools/source/ref/globname.cxx b/tools/source/ref/globname.cxx index 251fb6d1831e..a41b29bba6d3 100644 --- a/tools/source/ref/globname.cxx +++ b/tools/source/ref/globname.cxx @@ -96,10 +96,10 @@ void SvGlobalName::MakeFromMemory( void const * pData ) memcpy( &m_aData, pData, sizeof( m_aData ) ); } -bool SvGlobalName::MakeId( const OUString & rIdStr ) +bool SvGlobalName::MakeId( std::u16string_view rIdStr ) { - const sal_Unicode *pStr = rIdStr.getStr(); - if( rIdStr.getLength() != 36 + const sal_Unicode *pStr = rIdStr.data(); + if( rIdStr.size() != 36 || '-' != pStr[ 8 ] || '-' != pStr[ 13 ] || '-' != pStr[ 18 ] || '-' != pStr[ 23 ] ) return false;