summaryrefslogtreecommitdiff
path: root/sw/source/core/doc/docchart.cxx
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2022-10-10 12:09:44 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2022-10-11 08:44:09 +0200
commit71337b4327805b73e92c995153c5746d89793b13 (patch)
treefd66764b57912cb2a8b86618e97f1e90d607d2cd /sw/source/core/doc/docchart.cxx
parentbab44a97d21d0ac8a8a06678e71024c1a830943f (diff)
use more string_view in sw
Change-Id: Ibefb8549834ba5011286e3221f1ae276e2c0c0bf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/141153 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw/source/core/doc/docchart.cxx')
-rw-r--r--sw/source/core/doc/docchart.cxx18
1 files changed, 9 insertions, 9 deletions
diff --git a/sw/source/core/doc/docchart.cxx b/sw/source/core/doc/docchart.cxx
index 05ebd8fa7956..70e96968e4df 100644
--- a/sw/source/core/doc/docchart.cxx
+++ b/sw/source/core/doc/docchart.cxx
@@ -36,21 +36,21 @@ void SwTable::UpdateCharts() const
GetFrameFormat()->GetDoc()->UpdateCharts( GetFrameFormat()->GetName() );
}
-bool SwTable::IsTableComplexForChart( const OUString& rSelection ) const
+bool SwTable::IsTableComplexForChart( std::u16string_view aSelection ) const
{
const SwTableBox* pSttBox, *pEndBox;
- if( 2 < rSelection.getLength() )
+ if( 2 < aSelection.size() )
{
- const sal_Int32 nSeparator {rSelection.indexOf( ':' )};
- OSL_ENSURE( -1 != nSeparator, "no valid selection" );
+ const size_t nSeparator = aSelection.find( u':' );
+ OSL_ENSURE( std::u16string_view::npos != nSeparator, "no valid selection" );
// Remove brackets at the beginning and from the end
- const sal_Int32 nOffset {'<' == rSelection[0] ? 1 : 0};
- const sal_Int32 nLength {'>' == rSelection[ rSelection.getLength()-1 ]
- ? rSelection.getLength()-1 : rSelection.getLength()};
+ const sal_Int32 nOffset = '<' == aSelection[0] ? 1 : 0;
+ const sal_Int32 nLength = '>' == aSelection[ aSelection.size()-1 ]
+ ? aSelection.size()-1 : aSelection.size();
- pSttBox = GetTableBox(rSelection.copy( nOffset, nSeparator - nOffset ));
- pEndBox = GetTableBox(rSelection.copy( nSeparator+1, nLength - (nSeparator+1) ));
+ pSttBox = GetTableBox(OUString(aSelection.substr( nOffset, nSeparator - nOffset )));
+ pEndBox = GetTableBox(OUString(aSelection.substr( nSeparator+1, nLength - (nSeparator+1) )));
}
else
{