chart2/source/tools/XMLRangeHelper.cxx    |   10 +++++-----
 sw/source/core/unocore/XMLRangeHelper.cxx |   10 +++++-----
 2 files changed, 10 insertions(+), 10 deletions(-)

New commits:
commit a8cc5deeb1d5f10120a9207018808ef712844890
Author:     Noel Grandin <noelgran...@gmail.com>
AuthorDate: Sun Sep 29 12:19:58 2024 +0200
Commit:     Noel Grandin <noel.gran...@collabora.co.uk>
CommitDate: Sun Sep 29 18:31:30 2024 +0200

    avoid temporary OUString in lcl_getSingleCellAddressFromXMLString
    
    Change-Id: I3ec79a4ae0259babb8aa472c338cc78910abc800
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/174181
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk>

diff --git a/chart2/source/tools/XMLRangeHelper.cxx 
b/chart2/source/tools/XMLRangeHelper.cxx
index 196a0396542a..1a7e789d3098 100644
--- a/chart2/source/tools/XMLRangeHelper.cxx
+++ b/chart2/source/tools/XMLRangeHelper.cxx
@@ -112,15 +112,15 @@ void lcl_getSingleCellAddressFromXMLString(
     static const sal_Unicode aDollar( '$' );
     static const sal_Unicode aLetterA( 'A' );
 
-    OUString aCellStr = OUString(rXMLString.substr( nStartPos, nEndPos - 
nStartPos + 1 )).toAsciiUpperCase();
-    const sal_Unicode* pStrArray = aCellStr.getStr();
-    sal_Int32 nLength = aCellStr.getLength();
+    std::u16string_view aCellStr = rXMLString.substr( nStartPos, nEndPos - 
nStartPos + 1 );
+    const sal_Unicode* pStrArray = aCellStr.data();
+    sal_Int32 nLength = aCellStr.size();
     sal_Int32 i = nLength - 1, nColumn = 0;
 
     // parse number for row
     while( rtl::isAsciiDigit( pStrArray[ i ] ) && i >= 0 )
         i--;
-    rOutCell.nRow = (o3tl::toInt32(aCellStr.subView( i + 1 ))) - 1;
+    rOutCell.nRow = (o3tl::toInt32(aCellStr.substr( i + 1 ))) - 1;
     // a dollar in XML means absolute (whereas in UI it means relative)
     if( pStrArray[ i ] == aDollar )
     {
@@ -134,7 +134,7 @@ void lcl_getSingleCellAddressFromXMLString(
     sal_Int32 nPower = 1;
     while( rtl::isAsciiAlpha( pStrArray[ i ] ))
     {
-        nColumn += (pStrArray[ i ] - aLetterA + 1) * nPower;
+        nColumn += (rtl::toAsciiUpperCase(pStrArray[ i ]) - aLetterA + 1) * 
nPower;
         i--;
         nPower *= 26;
     }
diff --git a/sw/source/core/unocore/XMLRangeHelper.cxx 
b/sw/source/core/unocore/XMLRangeHelper.cxx
index ad2d56bd19d5..037fe76d2dbe 100644
--- a/sw/source/core/unocore/XMLRangeHelper.cxx
+++ b/sw/source/core/unocore/XMLRangeHelper.cxx
@@ -110,15 +110,15 @@ void lcl_getSingleCellAddressFromXMLString(
     static const sal_Unicode aDollar( '$' );
     static const sal_Unicode aLetterA( 'A' );
 
-    OUString aCellStr = OUString(rXMLString.substr( nStartPos, nEndPos - 
nStartPos + 1 )).toAsciiUpperCase();
-    const sal_Unicode* pStrArray = aCellStr.getStr();
-    sal_Int32 nLength = aCellStr.getLength();
+    std::u16string_view aCellStr = rXMLString.substr( nStartPos, nEndPos - 
nStartPos + 1 );
+    const sal_Unicode* pStrArray = aCellStr.data();
+    sal_Int32 nLength = aCellStr.size();
     sal_Int32 i = nLength - 1, nColumn = 0;
 
     // parse number for row
     while( rtl::isAsciiDigit( pStrArray[ i ] ) && i >= 0 )
         i--;
-    rOutCell.nRow = (o3tl::toInt32(aCellStr.subView( i + 1 ))) - 1;
+    rOutCell.nRow = (o3tl::toInt32(aCellStr.substr( i + 1 ))) - 1;
     // a dollar in XML means absolute (whereas in UI it means relative)
     if( pStrArray[ i ] == aDollar )
     {
@@ -133,7 +133,7 @@ void lcl_getSingleCellAddressFromXMLString(
     sal_Int32 nPower = 1;
     while( i >= 0 && rtl::isAsciiAlpha( pStrArray[ i ] ))
     {
-        nColumn += (pStrArray[ i ] - aLetterA + 1) * nPower;
+        nColumn += (rtl::toAsciiUpperCase(pStrArray[ i ]) - aLetterA + 1) * 
nPower;
         i--;
         nPower *= 26;
     }

Reply via email to