chart2/source/controller/inc/ChartController.hxx        |    2 +-
 chart2/source/controller/main/ChartController.cxx       |    2 +-
 chart2/source/controller/main/ChartController_Tools.cxx |    2 +-
 include/svx/SvxColorValueSet.hxx                        |    2 +-
 include/svx/svdotext.hxx                                |    2 +-
 include/svx/xgrad.hxx                                   |    2 +-
 include/svx/xmlgrhlp.hxx                                |    2 +-
 svx/source/svdraw/svdotxat.cxx                          |    4 ++--
 svx/source/tbxctrls/PaletteManager.cxx                  |    2 +-
 svx/source/tbxctrls/SvxColorValueSet.cxx                |    4 ++--
 svx/source/xml/xmlgrhlp.cxx                             |    6 +++---
 svx/source/xoutdev/xattr.cxx                            |    6 +++---
 12 files changed, 18 insertions(+), 18 deletions(-)

New commits:
commit eaedd8f968aa200f49a15000f41ee1126004b5e7
Author:     Noel Grandin <noel.gran...@collabora.co.uk>
AuthorDate: Thu Sep 22 11:42:13 2022 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Thu Sep 22 15:41:08 2022 +0200

    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.gran...@collabora.co.uk>

diff --git a/chart2/source/controller/inc/ChartController.hxx 
b/chart2/source/controller/inc/ChartController.hxx
index 0e913961f2c8..f777de00ece7 100644
--- a/chart2/source/controller/inc/ChartController.hxx
+++ b/chart2/source/controller/inc/ChartController.hxx
@@ -504,7 +504,7 @@ private:
     void executeDispatch_LOKSetTextSelection(int nType, int nX, int nY);
     void executeDispatch_LOKPieSegmentDragging(int nOffset);
     void executeDispatch_FillColor(sal_uInt32 nColor);
-    void executeDispatch_FillGradient(OUString sJSONGradient);
+    void executeDispatch_FillGradient(std::u16string_view sJSONGradient);
     void executeDispatch_LineColor(sal_uInt32 nColor);
     void executeDispatch_LineWidth(sal_uInt32 nWidth);
 
diff --git a/chart2/source/controller/main/ChartController.cxx 
b/chart2/source/controller/main/ChartController.cxx
index 85c7c41439a3..bac40f686d51 100644
--- a/chart2/source/controller/main/ChartController.cxx
+++ b/chart2/source/controller/main/ChartController.cxx
@@ -1124,7 +1124,7 @@ void SAL_CALL ChartController::dispatch(
     }
     else if(aCommand.startsWith("FillGradient"))
     {
-        this->executeDispatch_FillGradient(aCommand.copy(aCommand.indexOf('=') 
+ 1));
+        
this->executeDispatch_FillGradient(aCommand.subView(aCommand.indexOf('=') + 1));
     }
     else if(aCommand == "Paste")
         this->executeDispatch_Paste();
diff --git a/chart2/source/controller/main/ChartController_Tools.cxx 
b/chart2/source/controller/main/ChartController_Tools.cxx
index ee036e9cff01..e2f11c7eb655 100644
--- a/chart2/source/controller/main/ChartController_Tools.cxx
+++ b/chart2/source/controller/main/ChartController_Tools.cxx
@@ -955,7 +955,7 @@ void ChartController::executeDispatch_FillColor(sal_uInt32 
nColor)
     }
 }
 
-void ChartController::executeDispatch_FillGradient(OUString sJSONGradient)
+void ChartController::executeDispatch_FillGradient(std::u16string_view 
sJSONGradient)
 {
     XGradient aXGradient = XGradient::fromJSON(sJSONGradient);
     css::awt::Gradient aGradient = aXGradient.toGradientUNO();
diff --git a/include/svx/SvxColorValueSet.hxx b/include/svx/SvxColorValueSet.hxx
index 1872b58fdf04..1037734a2121 100644
--- a/include/svx/SvxColorValueSet.hxx
+++ b/include/svx/SvxColorValueSet.hxx
@@ -39,7 +39,7 @@ public:
     static sal_uInt32 getColumnCount();
 
     void addEntriesForXColorList(const XColorList& rXColorList, sal_uInt32 
nStartIndex = 1);
-    void addEntriesForColorSet(const std::set<Color>& rColorSet, const 
OUString& rNamePrefix);
+    void addEntriesForColorSet(const std::set<Color>& rColorSet, 
std::u16string_view rNamePrefix);
     Size layoutAllVisible(sal_uInt32 nEntryCount);
     void layoutToGivenHeight(sal_uInt32 nHeight, sal_uInt32 nEntryCount);
 
diff --git a/include/svx/svdotext.hxx b/include/svx/svdotext.hxx
index 6b1a61e08a69..6041a74fe0aa 100644
--- a/include/svx/svdotext.hxx
+++ b/include/svx/svdotext.hxx
@@ -259,7 +259,7 @@ private:
     static void AppendFamilyToStyleName(OUString& styleName, SfxStyleFamily 
family);
 
     /** Reads the style family from a style name to which the family has been 
appended. */
-    static SfxStyleFamily ReadFamilyFromStyleName(const OUString& styleName);
+    static SfxStyleFamily ReadFamilyFromStyleName(std::u16string_view 
styleName);
 
 protected:
     bool ImpCanConvTextToCurve() const;
diff --git a/include/svx/xgrad.hxx b/include/svx/xgrad.hxx
index 93a2f00655f4..553dfe23b93b 100644
--- a/include/svx/xgrad.hxx
+++ b/include/svx/xgrad.hxx
@@ -77,7 +77,7 @@ public:
     sal_uInt16         GetSteps() const                 { return nStepCount; }
 
     boost::property_tree::ptree dumpAsJSON() const;
-    static XGradient fromJSON(const OUString& rJSON);
+    static XGradient fromJSON(std::u16string_view rJSON);
     css::awt::Gradient toGradientUNO() const;
 };
 
diff --git a/include/svx/xmlgrhlp.hxx b/include/svx/xmlgrhlp.hxx
index 0e54e1cb102b..177d1afc4be6 100644
--- a/include/svx/xmlgrhlp.hxx
+++ b/include/svx/xmlgrhlp.hxx
@@ -70,7 +70,7 @@ private:
     SVX_DLLPRIVATE SvxGraphicHelperStream_Impl
                                             ImplGetGraphicStream( const 
OUString& rPictureStorageName,
                                                       const OUString& 
rPictureStreamName );
-    SVX_DLLPRIVATE static OUString      ImplGetGraphicMimeType( const 
OUString& rFileName );
+    SVX_DLLPRIVATE static OUString      ImplGetGraphicMimeType( 
std::u16string_view rFileName );
     SVX_DLLPRIVATE Graphic                  ImplReadGraphic( const OUString& 
rPictureStorageName,
                                                  const OUString& 
rPictureStreamName );
 
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);

Reply via email to