diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 10:31:38 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-11 13:55:30 +0200 |
commit | 65e4a776e8315fd61fd67ad00d28985b11f0b79e (patch) | |
tree | 1ab7a2947d47807086e0477a8d3ad35c2e75dd48 /xmlhelp/source/treeview | |
parent | a7b7614c7cab42cd0839752635db81e25e1e50a1 (diff) |
simplify some OUString::copy calls
Change-Id: Ifa228ca02ea79a1309e1875414028aade7e5f12d
Reviewed-on: https://gerrit.libreoffice.org/39801
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'xmlhelp/source/treeview')
-rw-r--r-- | xmlhelp/source/treeview/tvread.cxx | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/xmlhelp/source/treeview/tvread.cxx b/xmlhelp/source/treeview/tvread.cxx index 9410a1886757..4e726a2bf2b6 100644 --- a/xmlhelp/source/treeview/tvread.cxx +++ b/xmlhelp/source/treeview/tvread.cxx @@ -301,11 +301,9 @@ TVRead::hasByName( const OUString& aName ) Any SAL_CALL TVRead::getByHierarchicalName( const OUString& aName ) { - sal_Int32 idx; - - if( ( idx = aName.indexOf( '/' ) ) != -1 && - aName.copy( 0,idx ) == "Children" ) - return Children->getByHierarchicalName( aName.copy( 1 + idx ) ); + OUString aRest; + if( aName.startsWith("Children/", &aRest) ) + return Children->getByHierarchicalName( aRest ); return getByName( aName ); } @@ -313,11 +311,9 @@ TVRead::getByHierarchicalName( const OUString& aName ) sal_Bool SAL_CALL TVRead::hasByHierarchicalName( const OUString& aName ) { - sal_Int32 idx; - - if( ( idx = aName.indexOf( '/' ) ) != -1 && - aName.copy( 0,idx ) == "Children" ) - return Children->hasByHierarchicalName( aName.copy( 1 + idx ) ); + OUString aRest; + if( aName.startsWith("Children/", &aRest) ) + return Children->hasByHierarchicalName( aRest ); return hasByName( aName ); } |