From f1d83ac45f08270f7f2dd7128056effd0251dc5e Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Fri, 27 Jan 2017 16:09:54 +0200 Subject: loplugin:stringconstant check for unnecessary OUString constructor.. ..calls when creating exceptions Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe Reviewed-on: https://gerrit.libreoffice.org/33617 Tested-by: Jenkins Reviewed-by: Noel Grandin --- accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx | 9 +++------ accessibility/source/extended/AccessibleGridControlTableBase.cxx | 9 +++------ 2 files changed, 6 insertions(+), 12 deletions(-) (limited to 'accessibility') diff --git a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx index f862854379b8..32be324f8710 100644 --- a/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx +++ b/accessibility/source/extended/AccessibleBrowseBoxTableBase.cxx @@ -267,15 +267,13 @@ void AccessibleBrowseBoxTableBase::implGetSelectedColumns( Sequence< sal_Int32 > void AccessibleBrowseBoxTableBase::ensureIsValidRow( sal_Int32 nRow ) { if( nRow >= implGetRowCount() ) - throw lang::IndexOutOfBoundsException( - OUString( "row index is invalid" ), *this ); + throw lang::IndexOutOfBoundsException( "row index is invalid", *this ); } void AccessibleBrowseBoxTableBase::ensureIsValidColumn( sal_Int32 nColumn ) { if( nColumn >= implGetColumnCount() ) - throw lang::IndexOutOfBoundsException( - OUString( "column index is invalid" ), *this ); + throw lang::IndexOutOfBoundsException( "column index is invalid", *this ); } void AccessibleBrowseBoxTableBase::ensureIsValidAddress( @@ -288,8 +286,7 @@ void AccessibleBrowseBoxTableBase::ensureIsValidAddress( void AccessibleBrowseBoxTableBase::ensureIsValidIndex( sal_Int32 nChildIndex ) { if( nChildIndex >= implGetChildCount() ) - throw lang::IndexOutOfBoundsException( - OUString( "child index is invalid" ), *this ); + throw lang::IndexOutOfBoundsException( "child index is invalid", *this ); } diff --git a/accessibility/source/extended/AccessibleGridControlTableBase.cxx b/accessibility/source/extended/AccessibleGridControlTableBase.cxx index acf58c091cd9..a1d8abae6966 100644 --- a/accessibility/source/extended/AccessibleGridControlTableBase.cxx +++ b/accessibility/source/extended/AccessibleGridControlTableBase.cxx @@ -214,15 +214,13 @@ void AccessibleGridControlTableBase::implGetSelectedRows( Sequence< sal_Int32 >& void AccessibleGridControlTableBase::ensureIsValidRow( sal_Int32 nRow ) { if( nRow >= m_aTable.GetRowCount() ) - throw lang::IndexOutOfBoundsException( - OUString( "row index is invalid" ), *this ); + throw lang::IndexOutOfBoundsException( "row index is invalid", *this ); } void AccessibleGridControlTableBase::ensureIsValidColumn( sal_Int32 nColumn ) { if( nColumn >= m_aTable.GetColumnCount() ) - throw lang::IndexOutOfBoundsException( - OUString( "column index is invalid" ), *this ); + throw lang::IndexOutOfBoundsException( "column index is invalid", *this ); } void AccessibleGridControlTableBase::ensureIsValidAddress( @@ -235,8 +233,7 @@ void AccessibleGridControlTableBase::ensureIsValidAddress( void AccessibleGridControlTableBase::ensureIsValidIndex( sal_Int32 nChildIndex ) { if( nChildIndex >= m_aTable.GetRowCount()*m_aTable.GetColumnCount() ) - throw lang::IndexOutOfBoundsException( - OUString( "child index is invalid" ), *this ); + throw lang::IndexOutOfBoundsException( "child index is invalid", *this ); } -- cgit