diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-27 16:09:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-28 09:22:55 +0000 |
commit | f1d83ac45f08270f7f2dd7128056effd0251dc5e (patch) | |
tree | 55d924eaa7f55627039d44458d869ef65130fdf8 /sw | |
parent | 53d3755972bfd3bd2cd650edf91f1483038028c8 (diff) |
loplugin:stringconstant check for unnecessary OUString constructor..
..calls when creating exceptions
Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe
Reviewed-on: https://gerrit.libreoffice.org/33617
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/access/acccontext.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/access/acccontext.hxx | 4 | ||||
-rw-r--r-- | sw/source/core/access/accselectionhelper.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/access/acctable.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/unocore/unoftn.cxx | 3 | ||||
-rw-r--r-- | sw/source/uibase/uno/SwXDocumentSettings.cxx | 4 |
6 files changed, 8 insertions, 9 deletions
diff --git a/sw/source/core/access/acccontext.cxx b/sw/source/core/access/acccontext.cxx index 669773168b0d..fbb95cab7cdc 100644 --- a/sw/source/core/access/acccontext.cxx +++ b/sw/source/core/access/acccontext.cxx @@ -573,7 +573,7 @@ uno::Reference< XAccessible> SAL_CALL { uno::Reference < XAccessibleContext > xThis( this ); lang::IndexOutOfBoundsException aExcept( - OUString( "index out of bounds" ), + "index out of bounds", xThis ); throw aExcept; } diff --git a/sw/source/core/access/acccontext.hxx b/sw/source/core/access/acccontext.hxx index 764172e603f0..4206a135c957 100644 --- a/sw/source/core/access/acccontext.hxx +++ b/sw/source/core/access/acccontext.hxx @@ -356,7 +356,7 @@ public: #define THROW_RUNTIME_EXCEPTION( ifc, msg ) \ css::uno::Reference < ifc > xThis( this ); \ css::uno::RuntimeException aExcept( \ - OUString( msg ), xThis ); \ + msg, xThis ); \ throw aExcept; #define CHECK_FOR_DEFUNC_THIS( ifc, ths ) \ @@ -364,7 +364,7 @@ public: { \ css::uno::Reference < ifc > xThis( ths ); \ css::lang::DisposedException aExcept( \ - OUString( "object is defunctional" ), \ + "object is defunctional", \ xThis ); \ throw aExcept; \ } diff --git a/sw/source/core/access/accselectionhelper.cxx b/sw/source/core/access/accselectionhelper.cxx index ebe0cb4777d4..563e97448d03 100644 --- a/sw/source/core/access/accselectionhelper.cxx +++ b/sw/source/core/access/accselectionhelper.cxx @@ -70,7 +70,7 @@ void SwAccessibleSelectionHelper::throwIndexOutOfBoundsException() Reference < XAccessibleContext > xThis( &m_rContext ); Reference < XAccessibleSelection >xSelThis( xThis, UNO_QUERY ); lang::IndexOutOfBoundsException aExcept( - OUString( "index out of bounds" ), + "index out of bounds", xSelThis ); throw aExcept; } diff --git a/sw/source/core/access/acctable.cxx b/sw/source/core/access/acctable.cxx index 12afc54a8db5..bca6e1d9fed1 100644 --- a/sw/source/core/access/acctable.cxx +++ b/sw/source/core/access/acctable.cxx @@ -539,7 +539,7 @@ void SwAccessibleTableData_Impl::CheckRowAndCol( { uno::Reference < XAccessibleTable > xThis( pThis ); lang::IndexOutOfBoundsException aExcept( - OUString( "row or column index out of range" ), + "row or column index out of range", xThis ); throw aExcept; } diff --git a/sw/source/core/unocore/unoftn.cxx b/sw/source/core/unocore/unoftn.cxx index eb6e30b76db3..97c7fdc59db7 100644 --- a/sw/source/core/unocore/unoftn.cxx +++ b/sw/source/core/unocore/unoftn.cxx @@ -80,8 +80,7 @@ public: SwFormatFootnote const& GetFootnoteFormatOrThrow() { SwFormatFootnote const*const pFootnote( GetFootnoteFormat() ); if (!pFootnote) { - throw uno::RuntimeException(OUString( - "SwXFootnote: disposed or invalid"), nullptr); + throw uno::RuntimeException("SwXFootnote: disposed or invalid", nullptr); } return *pFootnote; } diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx index 3e529602ff59..96c181ff5ce6 100644 --- a/sw/source/uibase/uno/SwXDocumentSettings.cxx +++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx @@ -731,13 +731,13 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf uno::Sequence< beans::PropertyValue > aInfo; if ( !( rValue >>= aInfo ) ) throw lang::IllegalArgumentException( - OUString( "Value of type Sequence<PropertyValue> expected!" ), + "Value of type Sequence<PropertyValue> expected!", uno::Reference< uno::XInterface >(), 2 ); if ( !mpDocSh->SetModifyPasswordInfo( aInfo ) ) throw beans::PropertyVetoException( - OUString( "The hash is not allowed to be changed now!" ), + "The hash is not allowed to be changed now!", uno::Reference< uno::XInterface >() ); } break; |