diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-22 11:42:13 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2022-09-22 15:41:08 +0200 |
commit | eaedd8f968aa200f49a15000f41ee1126004b5e7 (patch) | |
tree | d67515c1a66d9137377f951dfe0ea1a7e1e247c6 /svx/source | |
parent | d6a1408ca7ac16994467d1ec6ea9a3d86abae854 (diff) |
use more string_view in svx
Change-Id: I672f6cc93f3f00c54eb2be7fa490d656bb5f0b02
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/140407
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/svdraw/svdotxat.cxx | 4 | ||||
-rw-r--r-- | svx/source/tbxctrls/PaletteManager.cxx | 2 | ||||
-rw-r--r-- | svx/source/tbxctrls/SvxColorValueSet.cxx | 4 | ||||
-rw-r--r-- | svx/source/xml/xmlgrhlp.cxx | 6 | ||||
-rw-r--r-- | svx/source/xoutdev/xattr.cxx | 6 |
5 files changed, 11 insertions, 11 deletions
diff --git a/svx/source/svdraw/svdotxat.cxx b/svx/source/svdraw/svdotxat.cxx index 97bdb5e59c55..49f7b2e79d2c 100644 --- a/svx/source/svdraw/svdotxat.cxx +++ b/svx/source/svdraw/svdotxat.cxx @@ -444,9 +444,9 @@ void SdrTextObj::AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily fam styleName += "|" + aFam; } -SfxStyleFamily SdrTextObj::ReadFamilyFromStyleName(const OUString& styleName) +SfxStyleFamily SdrTextObj::ReadFamilyFromStyleName(std::u16string_view styleName) { - std::u16string_view familyString = styleName.subView(styleName.getLength() - PADDING_LENGTH_FOR_STYLE_FAMILY); + std::u16string_view familyString = styleName.substr(styleName.size() - PADDING_LENGTH_FOR_STYLE_FAMILY); familyString = comphelper::string::stripEnd(familyString, PADDING_CHARACTER_FOR_STYLE_FAMILY); sal_uInt16 nFam = static_cast<sal_uInt16>(o3tl::toInt32(familyString)); assert(nFam != 0); diff --git a/svx/source/tbxctrls/PaletteManager.cxx b/svx/source/tbxctrls/PaletteManager.cxx index 55b2fdbd8a2d..520790a1d7c3 100644 --- a/svx/source/tbxctrls/PaletteManager.cxx +++ b/svx/source/tbxctrls/PaletteManager.cxx @@ -226,7 +226,7 @@ void PaletteManager::ReloadColorSet(SvxColorValueSet &rColorSet) std::set<Color> aColors = pDocSh->GetDocColors(); mnColorCount = aColors.size(); rColorSet.Clear(); - rColorSet.addEntriesForColorSet(aColors, SvxResId( RID_SVXSTR_DOC_COLOR_PREFIX ) + " " ); + rColorSet.addEntriesForColorSet(aColors, OUStringConcatenation(SvxResId( RID_SVXSTR_DOC_COLOR_PREFIX ) + " ") ); } } else diff --git a/svx/source/tbxctrls/SvxColorValueSet.cxx b/svx/source/tbxctrls/SvxColorValueSet.cxx index 4b4547dfce59..4a181730ed97 100644 --- a/svx/source/tbxctrls/SvxColorValueSet.cxx +++ b/svx/source/tbxctrls/SvxColorValueSet.cxx @@ -69,10 +69,10 @@ void SvxColorValueSet::addEntriesForXColorList(const XColorList& rXColorList, sa } } -void SvxColorValueSet::addEntriesForColorSet(const std::set<Color>& rColorSet, const OUString& rNamePrefix) +void SvxColorValueSet::addEntriesForColorSet(const std::set<Color>& rColorSet, std::u16string_view rNamePrefix) { sal_uInt32 nStartIndex = 1; - if(rNamePrefix.getLength() != 0) + if(rNamePrefix.size() != 0) { for(const auto& rColor : rColorSet) { diff --git a/svx/source/xml/xmlgrhlp.cxx b/svx/source/xml/xmlgrhlp.cxx index b60a5c9a9260..95f9038893ab 100644 --- a/svx/source/xml/xmlgrhlp.cxx +++ b/svx/source/xml/xmlgrhlp.cxx @@ -483,11 +483,11 @@ SvxGraphicHelperStream_Impl SvXMLGraphicHelper::ImplGetGraphicStream( const OUSt return aRet; } -OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( const OUString& rFileName ) +OUString SvXMLGraphicHelper::ImplGetGraphicMimeType( std::u16string_view rFileName ) { - if( ( rFileName.getLength() >= 4 ) && ( rFileName[ rFileName.getLength() - 4 ] == '.' ) ) + if( ( rFileName.size() >= 4 ) && ( rFileName[ rFileName.size() - 4 ] == '.' ) ) { - const OString aExt(OUStringToOString(rFileName.subView(rFileName.getLength() - 3), + const OString aExt(OUStringToOString(rFileName.substr(rFileName.size() - 3), RTL_TEXTENCODING_ASCII_US)); return comphelper::GraphicMimeTypeHelper::GetMimeTypeForExtension( aExt ); } diff --git a/svx/source/xoutdev/xattr.cxx b/svx/source/xoutdev/xattr.cxx index d5a647d2cab7..47668cc6bf6b 100644 --- a/svx/source/xoutdev/xattr.cxx +++ b/svx/source/xoutdev/xattr.cxx @@ -2066,10 +2066,10 @@ namespace return css::awt::GradientStyle_LINEAR; } - StringMap lcl_jsonToStringMap(const OUString& rJSON) + StringMap lcl_jsonToStringMap(std::u16string_view rJSON) { StringMap aArgs; - if (rJSON.getLength() && rJSON[0] != '\0') + if (rJSON.size() && rJSON[0] != '\0') { std::stringstream aStream(OUStringToOString(rJSON, RTL_TEXTENCODING_ASCII_US).getStr()); boost::property_tree::ptree aTree; @@ -2096,7 +2096,7 @@ namespace } } -XGradient XGradient::fromJSON(const OUString& rJSON) +XGradient XGradient::fromJSON(std::u16string_view rJSON) { StringMap aMap(lcl_jsonToStringMap(rJSON)); return lcl_buildGradientFromStringMap(aMap); |