diff options
98 files changed, 542 insertions, 609 deletions
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 ); } diff --git a/basegfx/source/tools/canvastools.cxx b/basegfx/source/tools/canvastools.cxx index a4a47ca37c88..ff5c4957ae98 100644 --- a/basegfx/source/tools/canvastools.cxx +++ b/basegfx/source/tools/canvastools.cxx @@ -302,9 +302,8 @@ namespace basegfx if( !xLinePoly.is() ) { throw lang::IllegalArgumentException( - OUString( - "basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(): Invalid input" - "poly-polygon, cannot retrieve vertex data"), + "basegfx::unotools::b2DPolyPolygonFromXPolyPolygon2D(): Invalid input" + "poly-polygon, cannot retrieve vertex data", uno::Reference< uno::XInterface >(), 0 ); } diff --git a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx index fb7bf08a81b3..9a050fb194c5 100644 --- a/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx +++ b/bridges/source/cpp_uno/gcc3_linux_x86-64/uno2cpp.cxx @@ -429,7 +429,7 @@ void unoInterfaceProxyDispatch( default: { ::com::sun::star::uno::RuntimeException aExc( - OUString("illegal member type description!"), + "illegal member type description!", ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface >() ); Type const & rExcType = cppu::UnoType<decltype(aExc)>::get(); diff --git a/canvas/source/vcl/canvas.cxx b/canvas/source/vcl/canvas.cxx index cb65127e4d37..0a413a5398a4 100644 --- a/canvas/source/vcl/canvas.cxx +++ b/canvas/source/vcl/canvas.cxx @@ -98,9 +98,7 @@ namespace vclcanvas OutputDevice* pOutDev = reinterpret_cast<OutputDevice*>(nPtr); if( !pOutDev ) - throw lang::NoSupportException( - OUString( "Passed OutDev invalid!" ), - nullptr); + throw lang::NoSupportException("Passed OutDev invalid!", nullptr); OutDevProviderSharedPtr pOutdevProvider( new OutDevHolder(*pOutDev) ); diff --git a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx index 18f327557fec..d778ac428bc3 100644 --- a/chart2/source/controller/sidebar/Chart2PanelFactory.cxx +++ b/chart2/source/controller/sidebar/Chart2PanelFactory.cxx @@ -113,7 +113,7 @@ Reference<css::ui::XUIElement> SAL_CALL ChartPanelFactory::createUIElement ( catch (const css::uno::Exception& e) { throw css::lang::WrappedTargetRuntimeException( - OUString("ChartPanelFactory::createUIElement exception"), + "ChartPanelFactory::createUIElement exception", nullptr, css::uno::makeAny(e)); } diff --git a/comphelper/qa/unit/variadictemplates.cxx b/comphelper/qa/unit/variadictemplates.cxx index 67e76bb79d33..77114df20fe2 100644 --- a/comphelper/qa/unit/variadictemplates.cxx +++ b/comphelper/qa/unit/variadictemplates.cxx @@ -40,7 +40,7 @@ inline void extract( { if (nArg >= seq.getLength()) { throw ::com::sun::star::lang::IllegalArgumentException( - OUString( "No such argument available!"), + "No such argument available!", xErrorContext, static_cast<sal_Int16>(nArg) ); } if (! fromAny(seq[nArg], &v)) { diff --git a/comphelper/source/misc/instancelocker.cxx b/comphelper/source/misc/instancelocker.cxx index 97671aca372c..a67ae554f238 100644 --- a/comphelper/source/misc/instancelocker.cxx +++ b/comphelper/source/misc/instancelocker.cxx @@ -130,13 +130,13 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg sal_Int32 nLen = aArguments.getLength(); if ( nLen < 2 || nLen > 3 ) throw lang::IllegalArgumentException( - OUString( "Wrong count of parameters!" ), + "Wrong count of parameters!", uno::Reference< uno::XInterface >(), 0 ); if ( !( aArguments[0] >>= xInstance ) || !xInstance.is() ) throw lang::IllegalArgumentException( - OUString( "Nonempty reference is expected as the first argument!" ), + "Nonempty reference is expected as the first argument!", uno::Reference< uno::XInterface >(), 0 ); @@ -149,14 +149,14 @@ void SAL_CALL OInstanceLocker::initialize( const uno::Sequence< uno::Any >& aArg ) { throw lang::IllegalArgumentException( - OUString("The correct modes set is expected as the second argument!"), + "The correct modes set is expected as the second argument!", uno::Reference< uno::XInterface >(), 0 ); } if ( nLen == 3 && !( aArguments[2] >>= xApproval ) ) throw lang::IllegalArgumentException( - OUString( "If the third argument is provided, it must be XActionsApproval implementation!" ), + "If the third argument is provided, it must be XActionsApproval implementation!", uno::Reference< uno::XInterface >(), 0 ); diff --git a/comphelper/source/misc/numberedcollection.cxx b/comphelper/source/misc/numberedcollection.cxx index 1faf639b16fb..45afaa32e4ae 100644 --- a/comphelper/source/misc/numberedcollection.cxx +++ b/comphelper/source/misc/numberedcollection.cxx @@ -68,7 +68,7 @@ void NumberedCollection::setUntitledPrefix(const OUString& sPrefix) ::osl::ResettableMutexGuard aLock(m_aMutex); if ( ! xComponent.is ()) - throw css::lang::IllegalArgumentException (OUString(ERRMSG_INVALID_COMPONENT_PARAM), m_xOwner.get(), 1); + throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1); sal_IntPtr pComponent = reinterpret_cast<sal_IntPtr>( xComponent.get() ); TNumberedItemHash::const_iterator pIt = m_lComponents.find (pComponent); @@ -140,7 +140,7 @@ void SAL_CALL NumberedCollection::releaseNumberForComponent(const css::uno::Refe ::osl::ResettableMutexGuard aLock(m_aMutex); if ( ! xComponent.is ()) - throw css::lang::IllegalArgumentException (OUString(ERRMSG_INVALID_COMPONENT_PARAM), m_xOwner.get(), 1); + throw css::lang::IllegalArgumentException(ERRMSG_INVALID_COMPONENT_PARAM, m_xOwner.get(), 1); sal_IntPtr pComponent = reinterpret_cast<sal_IntPtr>( xComponent.get() ); TNumberedItemHash::iterator pIt = m_lComponents.find (pComponent); diff --git a/compilerplugins/clang/stringconstant.cxx b/compilerplugins/clang/stringconstant.cxx index 50b2a600b66b..8b00e84333e8 100644 --- a/compilerplugins/clang/stringconstant.cxx +++ b/compilerplugins/clang/stringconstant.cxx @@ -1053,6 +1053,38 @@ bool StringConstant::VisitCXXConstructExpr(CXXConstructExpr const * expr) { } return true; } + + + // Now check for calls to one of our exception classes where an unnecessary OUString + // constructor is used for the first parameter. + if (isInUnoIncludeFile(expr->getConstructor()->getCanonicalDecl())) { + return true; + } + if (!expr->getConstructor()->getParent()->getName().endswith("Exception")) { + return true; + } + if (expr->getNumArgs() == 0) { + return true; + } + MaterializeTemporaryExpr const * subExpr1 = dyn_cast<MaterializeTemporaryExpr>(expr->getArg(0)); + if (!subExpr1) { + return true; + } + if (!loplugin::TypeCheck(subExpr1->getType()).Class("OUString").Namespace("rtl").GlobalNamespace()) { + return true; + } + ImplicitCastExpr const * subExpr2 = dyn_cast<ImplicitCastExpr>(subExpr1->GetTemporaryExpr()); + if (!subExpr2) { + return true; + } + CXXFunctionalCastExpr const * subExpr3 = dyn_cast<CXXFunctionalCastExpr>(subExpr2->getSubExpr()); + if (!subExpr3) { + return true; + } + report(DiagnosticsEngine::Warning, + "no need to use an explicit OUString constructor here", + subExpr3->getLocStart()) + << subExpr3->getSourceRange(); return true; } diff --git a/cppuhelper/source/factory.cxx b/cppuhelper/source/factory.cxx index 65f8553657b6..4bf015d83f51 100644 --- a/cppuhelper/source/factory.cxx +++ b/cppuhelper/source/factory.cxx @@ -202,7 +202,7 @@ Reference< XInterface > OSingleFactoryHelper::createInstanceWithArgumentsAndCont xComp->dispose(); throw lang::IllegalArgumentException( - OUString("cannot pass arguments to component => no XInitialization implemented!"), + "cannot pass arguments to component => no XInitialization implemented!", Reference< XInterface >(), 0 ); } } diff --git a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx index d20e6246617e..96201b2f801f 100644 --- a/dbaccess/source/ext/macromigration/macromigrationwizard.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationwizard.cxx @@ -157,7 +157,7 @@ namespace dbmm if ( _rArguments.getLength() != 1 ) throw IllegalArgumentException( - OUString(MacroMigrationResId(STR_INVALID_NUMBER_ARGS)), + MacroMigrationResId(STR_INVALID_NUMBER_ARGS), *this, 1 ); @@ -165,7 +165,7 @@ namespace dbmm m_xDocument.set( _rArguments[0], UNO_QUERY ); if ( !m_xDocument.is() ) throw IllegalArgumentException( - OUString(MacroMigrationResId(STR_NO_DATABASE)), + MacroMigrationResId(STR_NO_DATABASE), *this, 1 ); @@ -173,7 +173,7 @@ namespace dbmm Reference< XStorable > xDocStor( m_xDocument, UNO_QUERY_THROW ); if ( xDocStor->isReadonly() ) throw IllegalArgumentException( - OUString(MacroMigrationResId(STR_NOT_READONLY)), + MacroMigrationResId(STR_NOT_READONLY), *this, 1 ); diff --git a/dbaccess/source/sdbtools/connection/objectnames.cxx b/dbaccess/source/sdbtools/connection/objectnames.cxx index 921c8a1b65bc..d423cfc12382 100644 --- a/dbaccess/source/sdbtools/connection/objectnames.cxx +++ b/dbaccess/source/sdbtools/connection/objectnames.cxx @@ -288,7 +288,7 @@ namespace sdbtools && ( _nCommandType != CommandType::QUERY ) ) throw IllegalArgumentException( - OUString( SdbtRes( STR_INVALID_COMMAND_TYPE ) ), + SdbtRes( STR_INVALID_COMMAND_TYPE ), nullptr, 0 ); @@ -311,7 +311,7 @@ namespace sdbtools catch( const Exception& ) { throw IllegalArgumentException( - OUString( SdbtRes( STR_CONN_WITHOUT_QUERIES_OR_TABLES ) ), + SdbtRes( STR_CONN_WITHOUT_QUERIES_OR_TABLES ), nullptr, 0 ); diff --git a/dbaccess/source/sdbtools/connection/tablename.cxx b/dbaccess/source/sdbtools/connection/tablename.cxx index 08ea5adcb9bb..e51e997c13e0 100644 --- a/dbaccess/source/sdbtools/connection/tablename.cxx +++ b/dbaccess/source/sdbtools/connection/tablename.cxx @@ -152,7 +152,7 @@ namespace sdbtools || !xPSI->hasPropertyByName( PROPERTY_NAME ) ) throw IllegalArgumentException( - OUString( SdbtRes( STR_NO_TABLE_OBJECT ) ), + SdbtRes( STR_NO_TABLE_OBJECT ), *this, 0 ); @@ -199,7 +199,7 @@ namespace sdbtools found = true; if ( !found ) throw IllegalArgumentException( - OUString( SdbtRes( STR_INVALID_COMPOSITION_TYPE ) ), + SdbtRes( STR_INVALID_COMPOSITION_TYPE ), nullptr, 0 ); diff --git a/dbaccess/source/ui/app/AppController.cxx b/dbaccess/source/ui/app/AppController.cxx index e3533ddf65aa..8496e7d1f11d 100644 --- a/dbaccess/source/ui/app/AppController.cxx +++ b/dbaccess/source/ui/app/AppController.cxx @@ -2782,7 +2782,7 @@ sal_Bool SAL_CALL OApplicationController::select( const Any& _aSelection ) case DatabaseObjectContainer::REPORTS: if ( eSelectedCategory != E_NONE ) throw IllegalArgumentException( - OUString(ModuleRes(RID_STR_NO_DIFF_CAT)), + ModuleRes(RID_STR_NO_DIFF_CAT), *this, sal_Int16( pObject - aSelectedObjects.getConstArray() ) ); eSelectedCategory = ( pObject->Type == DatabaseObjectContainer::TABLES ) ? E_TABLE diff --git a/dbaccess/source/ui/app/AppControllerGen.cxx b/dbaccess/source/ui/app/AppControllerGen.cxx index c4f7fc4bf020..027b7eb08a91 100644 --- a/dbaccess/source/ui/app/AppControllerGen.cxx +++ b/dbaccess/source/ui/app/AppControllerGen.cxx @@ -119,7 +119,7 @@ void OApplicationController::convertToView(const OUString& _sName) ::dbtools::composeTableName( xMeta, sCatalog, sSchema, sName, false, ::dbtools::EComposeRule::InTableDefinitions ) ); Reference<XPropertySet> xView = ::dbaui::createView(sNewName,xConnection,xSourceObject); if ( !xView.is() ) - throw SQLException(OUString(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE)),*this,OUString( "S1000" ) ,0,Any()); + throw SQLException(ModuleRes(STR_NO_TABLE_FORMAT_INSIDE),*this,OUString( "S1000" ) ,0,Any()); getContainer()->elementAdded(E_TABLE,sNewName,makeAny(xView)); } } diff --git a/dbaccess/source/ui/querydesign/querycontroller.cxx b/dbaccess/source/ui/querydesign/querycontroller.cxx index c328f1c2863b..432778abcd5d 100644 --- a/dbaccess/source/ui/querydesign/querycontroller.cxx +++ b/dbaccess/source/ui/querydesign/querycontroller.cxx @@ -618,7 +618,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& if ( m_pSqlIterator->getStatementType() != OSQLStatementType::Select || rTabs.begin() == rTabs.end() ) { aError = SQLException( - OUString( ModuleRes( STR_QRY_NOSELECT ) ), + ModuleRes( STR_QRY_NOSELECT ), nullptr, "S1000", 1000, @@ -641,7 +641,7 @@ void OQueryController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue >& else { aError = SQLException( - OUString( ModuleRes( STR_QRY_SYNTAX ) ), + ModuleRes( STR_QRY_SYNTAX ), nullptr, "S1000", 1000, @@ -981,7 +981,7 @@ void OQueryController::impl_initialize() if ( !( aView >>= m_xAlterView ) ) { throw IllegalArgumentException( - OUString( ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ) ), + ModuleRes( STR_NO_ALTER_VIEW_SUPPORT ), *this, 1 ); diff --git a/dbaccess/source/ui/uno/copytablewizard.cxx b/dbaccess/source/ui/uno/copytablewizard.cxx index d61bda15a8cd..b68b0a6f30d7 100644 --- a/dbaccess/source/ui/uno/copytablewizard.cxx +++ b/dbaccess/source/ui/uno/copytablewizard.cxx @@ -459,7 +459,7 @@ void SAL_CALL CopyTableWizard::setOperation( ::sal_Int16 _operation ) && !OCopyTableWizard::supportsViews( m_xDestConnection ) ) throw IllegalArgumentException( - OUString( ModuleRes( STR_CTW_NO_VIEWS_SUPPORT ) ), + ModuleRes( STR_CTW_NO_VIEWS_SUPPORT ), *this, 1 ); @@ -491,7 +491,7 @@ void SAL_CALL CopyTableWizard::setCreatePrimaryKey( const Optional< OUString >& if ( _newPrimaryKey.IsPresent && !OCopyTableWizard::supportsPrimaryKey( m_xDestConnection ) ) throw IllegalArgumentException( - OUString( ModuleRes( STR_CTW_NO_PRIMARY_KEY_SUPPORT ) ), + ModuleRes( STR_CTW_NO_PRIMARY_KEY_SUPPORT ), *this, 1 ); @@ -656,7 +656,7 @@ Reference< XPropertySet > CopyTableWizard::impl_ensureDataAccessDescriptor_throw if ( !bIsValid ) { throw IllegalArgumentException( - OUString( ModuleRes( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ) ), + ModuleRes( STR_CTW_INVALID_DATA_ACCESS_DESCRIPTOR ), *const_cast< CopyTableWizard* >( this ), _nArgPos + 1 ); @@ -748,7 +748,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X break; default: throw IllegalArgumentException( - OUString( ModuleRes( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ) ), + ModuleRes( STR_CTW_ONLY_TABLES_AND_QUERIES_SUPPORT ), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -767,7 +767,7 @@ void CopyTableWizard::impl_checkForUnsupportedSettings_throw( const Reference< X if ( _out_rCommandType == CommandType::QUERY ) // we cannot copy a query if the connection cannot provide it ... throw IllegalArgumentException( - OUString(ModuleRes( STR_CTW_ERROR_NO_QUERY )), + ModuleRes( STR_CTW_ERROR_NO_QUERY ), *const_cast< CopyTableWizard* >( this ), 1 ); @@ -1457,7 +1457,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) sal_Int32 nArgCount( _rArguments.getLength() ); if ( ( nArgCount != 2 ) && ( nArgCount != 3 ) ) throw IllegalArgumentException( - OUString( ModuleRes( STR_CTW_ILLEGAL_PARAMETER_COUNT ) ), + ModuleRes( STR_CTW_ILLEGAL_PARAMETER_COUNT ), *this, 1 ); @@ -1468,7 +1468,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) { // ->createWithInteractionHandler if ( !( _rArguments[2] >>= m_xInteractionHandler ) ) throw IllegalArgumentException( - OUString(ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER )), + ModuleRes( STR_CTW_ERROR_INVALID_INTERACTIONHANDLER ), *this, 3 ); @@ -1493,7 +1493,7 @@ void SAL_CALL CopyTableWizard::initialize( const Sequence< Any >& _rArguments ) catch( const Exception& ) { throw WrappedTargetException( - OUString( ModuleRes( STR_CTW_ERROR_DURING_INITIALIZATION ) ), + ModuleRes( STR_CTW_ERROR_DURING_INITIALIZATION ), *this, ::cppu::getCaughtException() ); diff --git a/extensions/source/config/ldap/ldapuserprofilebe.cxx b/extensions/source/config/ldap/ldapuserprofilebe.cxx index f936358a5ec9..8b738b8ae1c3 100644 --- a/extensions/source/config/ldap/ldapuserprofilebe.cxx +++ b/extensions/source/config/ldap/ldapuserprofilebe.cxx @@ -62,7 +62,7 @@ LdapUserProfileBe::LdapUserProfileBe( const uno::Reference<uno::XComponentContex xContext, &aDefinition, &loggedOnUser)) { throw css::uno::RuntimeException( - OUString("LdapUserProfileBe- LDAP not configured"), + "LdapUserProfileBe- LDAP not configured", nullptr); } @@ -170,7 +170,7 @@ void LdapUserProfileBe::setPropertyValue( OUString const &, css::uno::Any const &) { throw css::lang::IllegalArgumentException( - OUString("setPropertyValue not supported"), + "setPropertyValue not supported", static_cast< cppu::OWeakObject * >(this), -1); } diff --git a/filter/source/xsltfilter/XSLTFilter.cxx b/filter/source/xsltfilter/XSLTFilter.cxx index 1adab3e15d01..fcc683118749 100644 --- a/filter/source/xsltfilter/XSLTFilter.cxx +++ b/filter/source/xsltfilter/XSLTFilter.cxx @@ -369,7 +369,7 @@ namespace XSLT if (xInterActionHandler.is()) { Sequence<Any> excArgs(0); css::ucb::InteractiveAugmentedIOException exc( - OUString("Timeout!"), + "Timeout!", static_cast< OWeakObject * >( this ), InteractionClassification_ERROR, css::ucb::IOErrorCode_GENERAL, diff --git a/forms/source/xforms/binding.cxx b/forms/source/xforms/binding.cxx index b2ffdeb1aba3..4044fcb92faa 100644 --- a/forms/source/xforms/binding.cxx +++ b/forms/source/xforms/binding.cxx @@ -93,7 +93,7 @@ using com::sun::star::xml::dom::events::XEventTarget; using com::sun::star::xsd::XDataType; -#define EXCEPT(msg) OUString(msg),static_cast<XValueBinding*>(this) +#define EXCEPT(msg) msg,static_cast<XValueBinding*>(this) #define HANDLE_BindingID 0 #define HANDLE_BindingExpression 1 diff --git a/framework/source/accelerators/acceleratorconfiguration.cxx b/framework/source/accelerators/acceleratorconfiguration.cxx index a42c55ffbc26..1b44cc93c0ca 100644 --- a/framework/source/accelerators/acceleratorconfiguration.cxx +++ b/framework/source/accelerators/acceleratorconfiguration.cxx @@ -115,15 +115,15 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE (aKeyEvent.Modifiers == 0) ) throw css::lang::IllegalArgumentException( - OUString("Such key event seems not to be supported by any operating system."), - static_cast< ::cppu::OWeakObject* >(this), - 0); + "Such key event seems not to be supported by any operating system.", + static_cast< ::cppu::OWeakObject* >(this), + 0); if (sCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), - static_cast< ::cppu::OWeakObject* >(this), - 1); + "Empty command strings are not allowed here.", + static_cast< ::cppu::OWeakObject* >(this), + 1); SolarMutexGuard g; AcceleratorCache& rCache = impl_getCFG(true); // sal_True => force getting of a writeable cache! @@ -145,7 +145,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XMLBasedAcceleratorConfigurati { if (sCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), + "Empty command strings are not allowed here.", static_cast< ::cppu::OWeakObject* >(this), 1); @@ -174,7 +174,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XMLBasedAcceleratorConfiguration::g const OUString& rCommand = lCommandList[i]; if (rCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), + "Empty command strings are not allowed here.", static_cast< ::cppu::OWeakObject* >(this), (sal_Int16)i); @@ -196,7 +196,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co { if (sCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), + "Empty command strings are not allowed here.", static_cast< ::cppu::OWeakObject* >(this), 0); @@ -204,7 +204,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co AcceleratorCache& rCache = impl_getCFG(true); // sal_True => force getting of a writeable cache! if (!rCache.hasCommand(sCommand)) throw css::container::NoSuchElementException( - OUString("Command does not exists inside this container."), + "Command does not exists inside this container.", static_cast< ::cppu::OWeakObject* >(this)); rCache.removeCommand(sCommand); } @@ -229,8 +229,8 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::reload() xIn = xStream->getInputStream(); if (!xIn.is()) throw css::io::IOException( - OUString("Could not open accelerator configuration for reading."), - static_cast< ::cppu::OWeakObject* >(this)); + "Could not open accelerator configuration for reading.", + static_cast< ::cppu::OWeakObject* >(this)); // impl_ts_load() does not clear the cache { @@ -265,8 +265,8 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::store() if (!xOut.is()) throw css::io::IOException( - OUString("Could not open accelerator configuration for saving."), - static_cast< ::cppu::OWeakObject* >(this)); + "Could not open accelerator configuration for saving.", + static_cast< ::cppu::OWeakObject* >(this)); impl_ts_save(xOut); @@ -289,7 +289,7 @@ void SAL_CALL XMLBasedAcceleratorConfiguration::storeToStorage(const css::uno::R if (!xOut.is()) throw css::io::IOException( - OUString("Could not open accelerator configuration for saving."), + "Could not open accelerator configuration for saving.", static_cast< ::cppu::OWeakObject* >(this)); impl_ts_save(xOut); @@ -549,15 +549,15 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::setKeyEvent(const css::awt::KeyE (aKeyEvent.Modifiers == 0) ) throw css::lang::IllegalArgumentException( - OUString("Such key event seems not to be supported by any operating system."), + "Such key event seems not to be supported by any operating system.", static_cast< ::cppu::OWeakObject* >(this), 0); if (sCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), - static_cast< ::cppu::OWeakObject* >(this), - 1); + "Empty command strings are not allowed here.", + static_cast< ::cppu::OWeakObject* >(this), + 1); SolarMutexGuard g; @@ -658,7 +658,7 @@ css::uno::Sequence< css::awt::KeyEvent > SAL_CALL XCUBasedAcceleratorConfigurati { if (sCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), + "Empty command strings are not allowed here.", static_cast< ::cppu::OWeakObject* >(this), 1); @@ -714,7 +714,7 @@ css::uno::Sequence< css::uno::Any > SAL_CALL XCUBasedAcceleratorConfiguration::g const OUString& rCommand = lCommandList[i]; if (rCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), + "Empty command strings are not allowed here.", static_cast< ::cppu::OWeakObject* >(this), (sal_Int16)i); @@ -740,7 +740,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co { if (sCommand.isEmpty()) throw css::lang::IllegalArgumentException( - OUString("Empty command strings are not allowed here."), + "Empty command strings are not allowed here.", static_cast< ::cppu::OWeakObject* >(this), 0); @@ -751,7 +751,7 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::removeCommandFromAllKeyEvents(co if (!rPrimaryCache.hasCommand(sCommand) && !rSecondaryCache.hasCommand(sCommand)) throw css::container::NoSuchElementException( - OUString("Command does not exists inside this container."), + "Command does not exists inside this container.", static_cast< ::cppu::OWeakObject* >(this)); if (rPrimaryCache.hasCommand(sCommand)) @@ -833,8 +833,8 @@ void SAL_CALL XCUBasedAcceleratorConfiguration::storeToStorage(const css::uno::R xOut = xStream->getOutputStream(); if (!xOut.is()) throw css::io::IOException( - OUString("Could not open accelerator configuration for saving."), - static_cast< ::cppu::OWeakObject* >(this)); + "Could not open accelerator configuration for saving.", + static_cast< ::cppu::OWeakObject* >(this)); // the original m_aCache has been split into primary cache and secondary cache... // we should merge them before storing to storage diff --git a/framework/source/accelerators/moduleacceleratorconfiguration.cxx b/framework/source/accelerators/moduleacceleratorconfiguration.cxx index 86d9c536acd9..f6cfa4d3d74c 100644 --- a/framework/source/accelerators/moduleacceleratorconfiguration.cxx +++ b/framework/source/accelerators/moduleacceleratorconfiguration.cxx @@ -114,7 +114,7 @@ ModuleAcceleratorConfiguration::ModuleAcceleratorConfiguration( if (m_sModule.isEmpty()) throw css::uno::RuntimeException( - OUString("The module dependent accelerator configuration service was initialized with an empty module identifier!"), + "The module dependent accelerator configuration service was initialized with an empty module identifier!", static_cast< ::cppu::OWeakObject* >(this)); } diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx index 5fb5f6659325..106c8dfb887d 100644 --- a/framework/source/fwe/helper/undomanagerhelper.cxx +++ b/framework/source/fwe/helper/undomanagerhelper.cxx @@ -163,7 +163,7 @@ namespace framework void cancel( const Reference< XInterface >& i_context ) { m_caughtException <<= RuntimeException( - OUString( "Concurrency error: an earlier operation on the stack failed." ), + "Concurrency error: an earlier operation on the stack failed.", i_context ); m_finishCondition.set(); diff --git a/framework/source/fwi/uielement/itemcontainer.cxx b/framework/source/fwi/uielement/itemcontainer.cxx index 892947009ff3..531febdf7e6e 100644 --- a/framework/source/fwi/uielement/itemcontainer.cxx +++ b/framework/source/fwi/uielement/itemcontainer.cxx @@ -188,7 +188,7 @@ void SAL_CALL ItemContainer::insertByIndex( sal_Int32 Index, const Any& aItem ) throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) ); } else - throw IllegalArgumentException( OUString( WRONG_TYPE_EXCEPTION ), + throw IllegalArgumentException( WRONG_TYPE_EXCEPTION, static_cast<OWeakObject *>(this), 2 ); } @@ -215,7 +215,7 @@ void SAL_CALL ItemContainer::replaceByIndex( sal_Int32 Index, const Any& aItem ) throw IndexOutOfBoundsException( OUString(), static_cast<OWeakObject *>(this) ); } else - throw IllegalArgumentException( OUString( WRONG_TYPE_EXCEPTION ), + throw IllegalArgumentException( WRONG_TYPE_EXCEPTION, static_cast<OWeakObject *>(this), 2 ); } diff --git a/framework/source/helper/vclstatusindicator.cxx b/framework/source/helper/vclstatusindicator.cxx index 5a83fe6d8776..29401a3b8443 100644 --- a/framework/source/helper/vclstatusindicator.cxx +++ b/framework/source/helper/vclstatusindicator.cxx @@ -32,7 +32,7 @@ VCLStatusIndicator::VCLStatusIndicator(const css::uno::Reference< css::awt::XWin { if (!m_xParentWindow.is()) throw css::uno::RuntimeException( - OUString("Can't work without a parent window!"), + "Can't work without a parent window!", static_cast< css::task::XStatusIndicator* >(this)); } diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx index a29ef9a37eba..4739bdc28cd7 100644 --- a/framework/source/services/autorecovery.cxx +++ b/framework/source/services/autorecovery.cxx @@ -1160,7 +1160,7 @@ void CacheLockGuard::lock(bool bLockForAddRemoveVectorItems) { OSL_FAIL("Re-entrance problem detected. Using of an stl structure in combination with iteration, adding, removing of elements etcpp."); throw css::uno::RuntimeException( - OUString("Re-entrance problem detected. Using of an stl structure in combination with iteration, adding, removing of elements etcpp."), + "Re-entrance problem detected. Using of an stl structure in combination with iteration, adding, removing of elements etcpp.", m_xOwner); } @@ -1184,7 +1184,7 @@ void CacheLockGuard::unlock() { OSL_FAIL("Wrong using of member m_nDocCacheLock detected. A ref counted value shouldn't reach values <0 .-)"); throw css::uno::RuntimeException( - OUString("Wrong using of member m_nDocCacheLock detected. A ref counted value shouldn't reach values <0 .-)"), + "Wrong using of member m_nDocCacheLock detected. A ref counted value shouldn't reach values <0 .-)", m_xOwner); } } /* SAFE */ diff --git a/framework/source/services/modulemanager.cxx b/framework/source/services/modulemanager.cxx index b4a602f77a1c..6819ee8e2afe 100644 --- a/framework/source/services/modulemanager.cxx +++ b/framework/source/services/modulemanager.cxx @@ -162,7 +162,7 @@ OUString SAL_CALL ModuleManager::identify(const css::uno::Reference< css::uno::X ) { throw css::lang::IllegalArgumentException( - OUString("Given module is not a frame nor a window, controller or model."), + "Given module is not a frame nor a window, controller or model.", static_cast< ::cppu::OWeakObject* >(this), 1); } @@ -190,7 +190,7 @@ OUString SAL_CALL ModuleManager::identify(const css::uno::Reference< css::uno::X if (sModule.isEmpty()) throw css::frame::UnknownModuleException( - OUString("Can not find suitable module for the given component."), + "Can not find suitable module for the given component.", static_cast< ::cppu::OWeakObject* >(this)); return sModule; @@ -203,7 +203,7 @@ void SAL_CALL ModuleManager::replaceByName(const OUString& sName , if (lProps.empty() ) { throw css::lang::IllegalArgumentException( - OUString("No properties given to replace part of module."), + "No properties given to replace part of module.", static_cast< cppu::OWeakObject * >(this), 2); } @@ -224,7 +224,7 @@ void SAL_CALL ModuleManager::replaceByName(const OUString& sName , if (!xModule.is()) { throw css::uno::RuntimeException( - OUString("Was not able to get write access to the requested module entry inside configuration."), + "Was not able to get write access to the requested module entry inside configuration.", static_cast< cppu::OWeakObject * >(this)); } @@ -252,7 +252,7 @@ css::uno::Any SAL_CALL ModuleManager::getByName(const OUString& sName) if (!xModule.is()) { throw css::uno::RuntimeException( - OUString("Was not able to get write access to the requested module entry inside configuration."), + "Was not able to get write access to the requested module entry inside configuration.", static_cast< cppu::OWeakObject * >(this)); } diff --git a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx index dd6cf09050a9..1c04c8afef03 100644 --- a/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx +++ b/framework/source/uiconfiguration/moduleuiconfigurationmanager.cxx @@ -1054,7 +1054,7 @@ void SAL_CALL ModuleUIConfigurationManager::reset() { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - OUString("ModuleUIConfigurationManager::reset exception"), + "ModuleUIConfigurationManager::reset exception", css::uno::Reference<css::uno::XInterface>(*this), a); } } diff --git a/oox/source/docprop/docprophandler.cxx b/oox/source/docprop/docprophandler.cxx index 2c28d8dcbc6f..24e45cef9276 100644 --- a/oox/source/docprop/docprophandler.cxx +++ b/oox/source/docprop/docprophandler.cxx @@ -665,7 +665,7 @@ void SAL_CALL OOXMLDocPropHandler::characters( const OUString& aChars ) catch( uno::Exception& e ) { throw xml::sax::SAXException( - OUString("Error while setting document property!"), + "Error while setting document property!", uno::Reference< uno::XInterface >(), uno::makeAny( e ) ); } diff --git a/package/source/zippackage/ZipPackage.cxx b/package/source/zippackage/ZipPackage.cxx index a28507852493..9a4326731f10 100644 --- a/package/source/zippackage/ZipPackage.cxx +++ b/package/source/zippackage/ZipPackage.cxx @@ -941,9 +941,7 @@ sal_Bool SAL_CALL ZipPackage::hasByHierarchicalName( const OUString& aName ) catch (const uno::Exception&) { uno::Any e(::cppu::getCaughtException()); - throw lang::WrappedTargetRuntimeException( - OUString("ZipPackage::hasByHierarchicalName"), - nullptr, e); + throw lang::WrappedTargetRuntimeException("ZipPackage::hasByHierarchicalName", nullptr, e); } return false; } diff --git a/reportdesign/source/core/api/ReportDefinition.cxx b/reportdesign/source/core/api/ReportDefinition.cxx index 84fcc9fec93d..614f7e30f805 100644 --- a/reportdesign/source/core/api/ReportDefinition.cxx +++ b/reportdesign/source/core/api/ReportDefinition.cxx @@ -1616,7 +1616,7 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue aStorageSource <<= sURL; else throw lang::IllegalArgumentException( - OUString( "No input source (URL or InputStream) found." ), + "No input source (URL or InputStream) found.", // TODO: resource *this, 1 @@ -1652,7 +1652,7 @@ void SAL_CALL OReportDefinition::load( const uno::Sequence< beans::PropertyValue { if ( i == nLastOpenMode ) throw lang::WrappedTargetException( - OUString( "An error occurred while creating the document storage." ), + "An error occurred while creating the document storage.", // TODO: resource *this, ::cppu::getCaughtException() diff --git a/reportdesign/source/ui/inspection/GeometryHandler.cxx b/reportdesign/source/ui/inspection/GeometryHandler.cxx index 816d77cf14f5..64688e53a339 100644 --- a/reportdesign/source/ui/inspection/GeometryHandler.cxx +++ b/reportdesign/source/ui/inspection/GeometryHandler.cxx @@ -1645,7 +1645,7 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, ::Point aPos(VCLPoint(_aNewPos)); if ( aPos.X() < 0 || aPos.Y() < 0 ) // TODO: have to check size with pos aka || (aPos.X() + aAwtSize.Width) > m_xSection->getReportDefinition()-> - throw beans::PropertyVetoException(OUString(ModuleRes(RID_STR_ILLEGAL_POSITION)),xSourceReportComponent); + throw beans::PropertyVetoException(ModuleRes(RID_STR_ILLEGAL_POSITION),xSourceReportComponent); ::Rectangle aSourceRect(aPos,VCLSize(_aSize)); @@ -1658,7 +1658,7 @@ void GeometryHandler::checkPosAndSize( const awt::Point& _aNewPos, const ::Rectangle aBoundRect(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); const ::Rectangle aRect = aSourceRect.GetIntersection(aBoundRect); if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) - throw beans::PropertyVetoException(OUString(ModuleRes( RID_STR_OVERLAP_OTHER_CONTROL)),xSourceReportComponent); + throw beans::PropertyVetoException(ModuleRes( RID_STR_OVERLAP_OTHER_CONTROL),xSourceReportComponent); } } } diff --git a/sc/source/ui/sidebar/ScPanelFactory.cxx b/sc/source/ui/sidebar/ScPanelFactory.cxx index 4052d5edde8e..f16ca5f21c31 100644 --- a/sc/source/ui/sidebar/ScPanelFactory.cxx +++ b/sc/source/ui/sidebar/ScPanelFactory.cxx @@ -112,7 +112,7 @@ Reference<ui::XUIElement> SAL_CALL ScPanelFactory::createUIElement ( catch (const uno::Exception& e) { throw lang::WrappedTargetRuntimeException( - OUString("ScPanelFactory::createUIElement exception"), + "ScPanelFactory::createUIElement exception", nullptr, uno::makeAny(e)); } diff --git a/sc/source/ui/unoobj/confuno.cxx b/sc/source/ui/unoobj/confuno.cxx index 73ae1dc715af..796494ecd2dc 100644 --- a/sc/source/ui/unoobj/confuno.cxx +++ b/sc/source/ui/unoobj/confuno.cxx @@ -297,7 +297,7 @@ void SAL_CALL ScDocumentConfiguration::setPropertyValue( uno::Sequence< beans::PropertyValue > aInfo; if ( !( aValue >>= aInfo ) ) throw lang::IllegalArgumentException( - OUString( "Value of type Sequence<PropertyValue> expected!" ), + "Value of type Sequence<PropertyValue> expected!", uno::Reference< uno::XInterface >(), 2 ); diff --git a/scripting/source/basprov/basscript.cxx b/scripting/source/basprov/basscript.cxx index dd098d42b9cd..8cdbbb5b4106 100644 --- a/scripting/source/basprov/basscript.cxx +++ b/scripting/source/basprov/basscript.cxx @@ -187,12 +187,11 @@ namespace basprov if ( nParamsCount < nSbxCount - nSbxOptional ) { throw provider::ScriptFrameworkErrorException( - OUString( - "wrong number of parameters!" ), + "wrong number of parameters!", Reference< XInterface >(), m_funcName, OUString( "Basic" ), - provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT ); + provider::ScriptFrameworkErrorType::NO_SUCH_SCRIPT ); } } diff --git a/scripting/source/provider/MasterScriptProvider.cxx b/scripting/source/provider/MasterScriptProvider.cxx index 9eaca17f0bc9..941cd07dbcb9 100644 --- a/scripting/source/provider/MasterScriptProvider.cxx +++ b/scripting/source/provider/MasterScriptProvider.cxx @@ -141,8 +141,7 @@ void SAL_CALL MasterScriptProvider::initialize( const Sequence < Any >& args ) if ( !xScripts.is() ) { throw lang::IllegalArgumentException( - OUString( "The given document does not support embedding scripts into it, and cannot be associated with such a document." - ), + "The given document does not support embedding scripts into it, and cannot be associated with such a document.", *this, 1 ); diff --git a/scripting/source/provider/URIHelper.cxx b/scripting/source/provider/URIHelper.cxx index 233f0021ecab..5fcab93a5ecf 100644 --- a/scripting/source/provider/URIHelper.cxx +++ b/scripting/source/provider/URIHelper.cxx @@ -218,8 +218,8 @@ ScriptingFrameworkURIHelper::getStorageURI(const OUString& rScriptURI) catch ( uno::Exception& ) { throw lang::IllegalArgumentException( - OUString("Script URI not valid"), - uno::Reference< uno::XInterface >(), 1 ); + "Script URI not valid", + uno::Reference< uno::XInterface >(), 1 ); } OUStringBuffer buf(120); diff --git a/sd/source/ui/unoidl/UnoDocumentSettings.cxx b/sd/source/ui/unoidl/UnoDocumentSettings.cxx index 8fea77d429f1..33261327487a 100644 --- a/sd/source/ui/unoidl/UnoDocumentSettings.cxx +++ b/sd/source/ui/unoidl/UnoDocumentSettings.cxx @@ -902,7 +902,7 @@ DocumentSettings::_setPropertyValues(const PropertyMapEntry** ppEntries, uno::Sequence< beans::PropertyValue > aInfo; if ( !( *pValues >>= aInfo ) ) throw lang::IllegalArgumentException( - OUString( "Value of type Sequence<PropertyValue> expected!" ), + "Value of type Sequence<PropertyValue> expected!", uno::Reference< uno::XInterface >(), 2 ); diff --git a/sdext/source/presenter/PresenterButton.cxx b/sdext/source/presenter/PresenterButton.cxx index baf81e5aee35..4487e70bad0e 100644 --- a/sdext/source/presenter/PresenterButton.cxx +++ b/sdext/source/presenter/PresenterButton.cxx @@ -495,7 +495,7 @@ void PresenterButton::ThrowIfDisposed() const if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( "PresenterButton object has already been disposed"), + "PresenterButton object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sdext/source/presenter/PresenterController.cxx b/sdext/source/presenter/PresenterController.cxx index 1bb33c46b1e0..477ad680ff7c 100644 --- a/sdext/source/presenter/PresenterController.cxx +++ b/sdext/source/presenter/PresenterController.cxx @@ -724,7 +724,7 @@ void SAL_CALL PresenterController::notifyConfigurationChange ( if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( "PresenterController object has already been disposed"), + "PresenterController object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } diff --git a/sdext/source/presenter/PresenterHelpView.cxx b/sdext/source/presenter/PresenterHelpView.cxx index 92d7819da92e..e414ad0261af 100644 --- a/sdext/source/presenter/PresenterHelpView.cxx +++ b/sdext/source/presenter/PresenterHelpView.cxx @@ -498,7 +498,7 @@ void PresenterHelpView::ThrowIfDisposed() if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( "PresenterHelpView has been already disposed"), + "PresenterHelpView has been already disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sdext/source/presenter/PresenterPaneBorderPainter.cxx b/sdext/source/presenter/PresenterPaneBorderPainter.cxx index 47f86d1f44bc..f35662ebebbc 100644 --- a/sdext/source/presenter/PresenterPaneBorderPainter.cxx +++ b/sdext/source/presenter/PresenterPaneBorderPainter.cxx @@ -369,8 +369,7 @@ void PresenterPaneBorderPainter::ThrowIfDisposed() const if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( - "PresenterPaneBorderPainter object has already been disposed"), + "PresenterPaneBorderPainter object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sdext/source/presenter/PresenterPaneFactory.cxx b/sdext/source/presenter/PresenterPaneFactory.cxx index 3477895c03d3..aff909edbe6c 100644 --- a/sdext/source/presenter/PresenterPaneFactory.cxx +++ b/sdext/source/presenter/PresenterPaneFactory.cxx @@ -318,7 +318,7 @@ void PresenterPaneFactory::ThrowIfDisposed() const if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( "PresenterPaneFactory object has already been disposed"), + "PresenterPaneFactory object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sdext/source/presenter/PresenterProtocolHandler.cxx b/sdext/source/presenter/PresenterProtocolHandler.cxx index 07470b31816d..8869303f6e64 100644 --- a/sdext/source/presenter/PresenterProtocolHandler.cxx +++ b/sdext/source/presenter/PresenterProtocolHandler.cxx @@ -335,8 +335,7 @@ void PresenterProtocolHandler::ThrowIfDisposed() const if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( - "PresenterProtocolHandler object has already been disposed"), + "PresenterProtocolHandler object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } @@ -434,8 +433,7 @@ void SAL_CALL PresenterProtocolHandler::Dispatch::dispatch( if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( - "PresenterProtocolHandler::Dispatch object has already been disposed"), + "PresenterProtocolHandler::Dispatch object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } diff --git a/sdext/source/presenter/PresenterScreen.cxx b/sdext/source/presenter/PresenterScreen.cxx index e5d61a768adf..53d5bcbd1b4f 100644 --- a/sdext/source/presenter/PresenterScreen.cxx +++ b/sdext/source/presenter/PresenterScreen.cxx @@ -210,8 +210,7 @@ void SAL_CALL PresenterScreenListener::notifyEvent( const css::document::EventOb if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( - "PresenterScreenListener object has already been disposed"), + "PresenterScreenListener object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } diff --git a/sdext/source/presenter/PresenterSlideShowView.cxx b/sdext/source/presenter/PresenterSlideShowView.cxx index 25a357e823c3..71d743f3e405 100644 --- a/sdext/source/presenter/PresenterSlideShowView.cxx +++ b/sdext/source/presenter/PresenterSlideShowView.cxx @@ -959,7 +959,7 @@ void PresenterSlideShowView::ThrowIfDisposed() if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString("PresenterSlideShowView object has already been disposed"), + "PresenterSlideShowView object has already been disposed", static_cast<uno::XWeak*>(this)); } } diff --git a/sdext/source/presenter/PresenterSlideSorter.cxx b/sdext/source/presenter/PresenterSlideSorter.cxx index fdb3ddec8781..c245a1978487 100644 --- a/sdext/source/presenter/PresenterSlideSorter.cxx +++ b/sdext/source/presenter/PresenterSlideSorter.cxx @@ -1094,8 +1094,7 @@ void PresenterSlideSorter::ThrowIfDisposed() if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( - "PresenterSlideSorter has been already disposed"), + "PresenterSlideSorter has been already disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sdext/source/presenter/PresenterToolBar.cxx b/sdext/source/presenter/PresenterToolBar.cxx index 42823bbedbab..97df29c8c03d 100644 --- a/sdext/source/presenter/PresenterToolBar.cxx +++ b/sdext/source/presenter/PresenterToolBar.cxx @@ -1037,7 +1037,7 @@ void PresenterToolBar::ThrowIfDisposed() const if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( "PresenterToolBar has already been disposed"), + "PresenterToolBar has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sdext/source/presenter/PresenterViewFactory.cxx b/sdext/source/presenter/PresenterViewFactory.cxx index 912bc1bab0e0..e70cf2786ad8 100644 --- a/sdext/source/presenter/PresenterViewFactory.cxx +++ b/sdext/source/presenter/PresenterViewFactory.cxx @@ -515,8 +515,7 @@ void PresenterViewFactory::ThrowIfDisposed() const if (rBHelper.bDisposed || rBHelper.bInDispose) { throw lang::DisposedException ( - OUString( - "PresenterViewFactory object has already been disposed"), + "PresenterViewFactory object has already been disposed", const_cast<uno::XWeak*>(static_cast<const uno::XWeak*>(this))); } } diff --git a/sfx2/source/appl/imestatuswindow.cxx b/sfx2/source/appl/imestatuswindow.cxx index 58c0f15184d2..0fa5823fcb4c 100644 --- a/sfx2/source/appl/imestatuswindow.cxx +++ b/sfx2/source/appl/imestatuswindow.cxx @@ -189,7 +189,7 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig() throw css::lang::DisposedException(); if (!m_xContext.is()) throw css::uno::RuntimeException( - OUString("null comphelper::getProcessServiceFactory"), + "null comphelper::getProcessServiceFactory", nullptr); css::uno::Reference< css::lang::XMultiServiceFactory > xProvider = css::configuration::theDefaultProvider::get( m_xContext ); @@ -208,9 +208,8 @@ css::uno::Reference< css::beans::XPropertySet > ImeStatusWindow::getConfig() css::uno::UNO_QUERY); if (!m_xConfig.is()) throw css::uno::RuntimeException( - OUString( - "null com.sun.star.configuration." - "ConfigurationUpdateAccess"), + "null com.sun.star.configuration." + "ConfigurationUpdateAccess", nullptr); bAdd = true; } diff --git a/sfx2/source/control/thumbnailviewacc.cxx b/sfx2/source/control/thumbnailviewacc.cxx index 32551122c55b..45648edceef7 100644 --- a/sfx2/source/control/thumbnailviewacc.cxx +++ b/sfx2/source/control/thumbnailviewacc.cxx @@ -556,7 +556,7 @@ void ThumbnailViewAcc::ThrowIfDisposed() { SAL_WARN("sfx", "Calling disposed object. Throwing exception:"); throw lang::DisposedException ( - OUString("object has been already disposed"), + "object has been already disposed", static_cast<uno::XWeak*>(this)); } else diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx index db2d583df39b..f242c8731d9e 100644 --- a/sfx2/source/dialog/backingcomp.cxx +++ b/sfx2/source/dialog/backingcomp.cxx @@ -365,12 +365,12 @@ void SAL_CALL BackingComp::attachFrame( /*IN*/ const css::uno::Reference< css::f // check some required states if (m_xFrame.is()) throw css::uno::RuntimeException( - OUString("already attached"), + "already attached", static_cast< ::cppu::OWeakObject* >(this)); if (!xFrame.is()) throw css::uno::RuntimeException( - OUString("invalid frame reference"), + "invalid frame reference", static_cast< ::cppu::OWeakObject* >(this)); if (!m_xWindow.is()) @@ -550,7 +550,7 @@ void SAL_CALL BackingComp::disposing( /*IN*/ const css::lang::EventObject& aEven if (!aEvent.Source.is() || aEvent.Source!=m_xWindow || !m_xWindow.is()) throw css::uno::RuntimeException( - OUString("unexpected source or called twice"), + "unexpected source or called twice", static_cast< ::cppu::OWeakObject* >(this)); m_xWindow.clear(); @@ -616,7 +616,7 @@ void SAL_CALL BackingComp::dispose() void SAL_CALL BackingComp::addEventListener( /*IN*/ const css::uno::Reference< css::lang::XEventListener >& ) { throw css::uno::RuntimeException( - OUString("not supported"), + "not supported", static_cast< ::cppu::OWeakObject* >(this)); } @@ -659,7 +659,7 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno if (m_xWindow.is()) throw css::uno::Exception( - OUString("already initialized"), + "already initialized", static_cast< ::cppu::OWeakObject* >(this)); css::uno::Reference< css::awt::XWindow > xParentWindow; @@ -670,7 +670,7 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno ) { throw css::uno::Exception( - OUString("wrong or corrupt argument list"), + "wrong or corrupt argument list", static_cast< ::cppu::OWeakObject* >(this)); } @@ -681,7 +681,7 @@ void SAL_CALL BackingComp::initialize( /*IN*/ const css::uno::Sequence< css::uno if (!m_xWindow.is()) throw css::uno::RuntimeException( - OUString("couldn't create component window"), + "couldn't create component window", static_cast< ::cppu::OWeakObject* >(this)); // start listening for window disposing diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx index 9b805abb39be..fb4376e0b38c 100644 --- a/sfx2/source/doc/DocumentMetadataAccess.cxx +++ b/sfx2/source/doc/DocumentMetadataAccess.cxx @@ -723,9 +723,8 @@ retry: if (rterr.hasValue()) { throw lang::WrappedTargetRuntimeException( - OUString( - "DocumentMetadataAccess::loadMetadataFromStorage: " - "exception"), nullptr, rterr); + "DocumentMetadataAccess::loadMetadataFromStorage: " + "exception", nullptr, rterr); } if (err) { diff --git a/sfx2/source/doc/Metadatable.cxx b/sfx2/source/doc/Metadatable.cxx index 86d2f7eb0d19..fecd4a0472dc 100644 --- a/sfx2/source/doc/Metadatable.cxx +++ b/sfx2/source/doc/Metadatable.cxx @@ -509,8 +509,7 @@ XmlIdRegistryDocument::XmlIdRegistry_Impl::LookupElement( { if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId", nullptr, 0); } const XmlIdList_t * pList( LookupElementList(i_rStreamName, i_rIdref) ); @@ -663,15 +662,13 @@ XmlIdRegistryDocument::TryRegisterMetadatable(Metadatable & i_rObject, if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId", nullptr, 0); } if (i_rObject.IsInContent() ? !isContentFile(i_rStreamName) : !isStylesFile(i_rStreamName)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId: wrong stream"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId: wrong stream", nullptr, 0); } OUString old_path; @@ -953,8 +950,7 @@ XmlIdRegistryClipboard::XmlIdRegistry_Impl::LookupEntry( { if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId", nullptr, 0); } const ClipboardXmlIdMap_t::const_iterator iter( m_XmlIdMap.find(i_rIdref) ); @@ -1076,15 +1072,13 @@ XmlIdRegistryClipboard::TryRegisterMetadatable(Metadatable & i_rObject, if (!isValidXmlId(i_rStreamName, i_rIdref)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId", nullptr, 0); } if (i_rObject.IsInContent() ? !isContentFile(i_rStreamName) : !isStylesFile(i_rStreamName)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId: wrong stream"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId: wrong stream", nullptr, 0); } OUString old_path; @@ -1207,8 +1201,7 @@ XmlIdRegistryClipboard::RegisterCopyClipboard(Metadatable & i_rCopy, if (!isValidXmlId(i_rReference.First, i_rReference.Second)) { - throw lang::IllegalArgumentException(OUString( - "illegal XmlId"), nullptr, 0); + throw lang::IllegalArgumentException("illegal XmlId", nullptr, 0); } if (!i_isLatent) @@ -1297,8 +1290,7 @@ void Metadatable::SetMetadataReference( const css::beans::StringPair & i_rRefere else { throw lang::IllegalArgumentException( - OUString("Metadatable::" - "SetMetadataReference: argument is invalid"), /*this*/nullptr, 0); + "Metadatable::SetMetadataReference: argument is invalid", /*this*/nullptr, 0); } } } @@ -1559,8 +1551,7 @@ MetadatableMixin::getMetadataReference() if (!pObject) { throw uno::RuntimeException( - OUString( - "MetadatableMixin: cannot get core object; not inserted?"), + "MetadatableMixin: cannot get core object; not inserted?", *this); } return pObject->GetMetadataReference(); @@ -1576,8 +1567,7 @@ MetadatableMixin::setMetadataReference( if (!pObject) { throw uno::RuntimeException( - OUString( - "MetadatableMixin: cannot get core object; not inserted?"), + "MetadatableMixin: cannot get core object; not inserted?", *this); } return pObject->SetMetadataReference(i_rReference); @@ -1591,8 +1581,7 @@ void SAL_CALL MetadatableMixin::ensureMetadataReference() if (!pObject) { throw uno::RuntimeException( - OUString( - "MetadatableMixin: cannot get core object; not inserted?"), + "MetadatableMixin: cannot get core object; not inserted?", *this); } return pObject->EnsureMetadataReference(); diff --git a/sfx2/source/doc/SfxDocumentMetaData.cxx b/sfx2/source/doc/SfxDocumentMetaData.cxx index 6870e7fe1867..f519833c05f5 100644 --- a/sfx2/source/doc/SfxDocumentMetaData.cxx +++ b/sfx2/source/doc/SfxDocumentMetaData.cxx @@ -596,8 +596,8 @@ SfxDocumentMetaData::getURLProperties( OUString SAL_CALL getNodeText(const css::uno::Reference<css::xml::dom::XNode>& i_xNode) { - if (!i_xNode.is()) throw css::uno::RuntimeException( - OUString("SfxDocumentMetaData::getNodeText: argument is null"), i_xNode); + if (!i_xNode.is()) + throw css::uno::RuntimeException("SfxDocumentMetaData::getNodeText: argument is null", i_xNode); for (css::uno::Reference<css::xml::dom::XNode> c = i_xNode->getFirstChild(); c.is(); c = c->getNextSibling()) { @@ -674,7 +674,7 @@ SfxDocumentMetaData::setMetaText(const char* i_name, } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - OUString("SfxDocumentMetaData::setMetaText: DOM exception"), + "SfxDocumentMetaData::setMetaText: DOM exception", css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -806,7 +806,7 @@ SfxDocumentMetaData::setMetaList(const char* i_name, } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - OUString("SfxDocumentMetaData::setMetaList: DOM exception"), + "SfxDocumentMetaData::setMetaList: DOM exception", css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -956,7 +956,7 @@ SfxDocumentMetaData::updateElement(const char *i_name, } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - OUString("SfxDocumentMetaData::updateElement: DOM exception"), + "SfxDocumentMetaData::updateElement: DOM exception", css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1032,9 +1032,9 @@ SfxDocumentMetaData::createDOM() const // throw (css::uno::RuntimeException) css::uno::Reference<css::lang::XMultiComponentFactory> xMsf ( m_xContext->getServiceManager()); css::uno::Reference<css::xml::dom::XDocumentBuilder> xBuilder( css::xml::dom::DocumentBuilder::create(m_xContext) ); css::uno::Reference<css::xml::dom::XDocument> xDoc = xBuilder->newDocument(); - if (!xDoc.is()) throw css::uno::RuntimeException( - OUString("SfxDocumentMetaData::createDOM: " - "cannot create new document"), + if (!xDoc.is()) + throw css::uno::RuntimeException( + "SfxDocumentMetaData::createDOM: cannot create new document", *const_cast<SfxDocumentMetaData*>(this)); return xDoc; } @@ -1043,8 +1043,8 @@ void SAL_CALL SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException) { if (!m_isInitialized) { - throw css::uno::RuntimeException(OUString( - "SfxDocumentMetaData::checkInit: not initialized"), + throw css::uno::RuntimeException( + "SfxDocumentMetaData::checkInit: not initialized", *const_cast<SfxDocumentMetaData*>(this)); } assert(m_xDoc.is() && m_xParent.is()); @@ -1054,8 +1054,8 @@ SfxDocumentMetaData::checkInit() const // throw (css::uno::RuntimeException) void SAL_CALL SfxDocumentMetaData::init( const css::uno::Reference<css::xml::dom::XDocument>& i_xDoc) { - if (!i_xDoc.is()) throw css::uno::RuntimeException( - OUString("SfxDocumentMetaData::init: no DOM tree given"), *this); + if (!i_xDoc.is()) + throw css::uno::RuntimeException("SfxDocumentMetaData::init: no DOM tree given", *this); css::uno::Reference<css::xml::xpath::XXPathAPI> xPath = css::xml::xpath::XPathAPI::create(m_xContext); @@ -1123,7 +1123,7 @@ void SAL_CALL SfxDocumentMetaData::init( } catch (const css::xml::dom::DOMException & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - OUString("SfxDocumentMetaData::init: DOM exception"), + "SfxDocumentMetaData::init: DOM exception", css::uno::Reference<css::uno::XInterface>(*this), a); } } @@ -1564,9 +1564,10 @@ SfxDocumentMetaData::getAutoloadSecs() void SAL_CALL SfxDocumentMetaData::setAutoloadSecs(::sal_Int32 the_value) { - if (the_value < 0) throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::setAutoloadSecs: argument is negative"), - *this, 0); + if (the_value < 0) + throw css::lang::IllegalArgumentException( + "SfxDocumentMetaData::setAutoloadSecs: argument is negative", + *this, 0); ::osl::ClearableMutexGuard g(m_aMutex); checkInit(); if (m_AutoloadSecs != the_value) { @@ -1670,9 +1671,10 @@ SfxDocumentMetaData::getEditingCycles() void SAL_CALL SfxDocumentMetaData::setEditingCycles(::sal_Int16 the_value) { - if (the_value < 0) throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::setEditingCycles: argument is negative"), - *this, 0); + if (the_value < 0) + throw css::lang::IllegalArgumentException( + "SfxDocumentMetaData::setEditingCycles: argument is negative", + *this, 0); OUStringBuffer buf; ::sax::Converter::convertNumber(buf, the_value); setMetaTextAndNotify("meta:editing-cycles", buf.makeStringAndClear()); @@ -1688,9 +1690,10 @@ SfxDocumentMetaData::getEditingDuration() void SAL_CALL SfxDocumentMetaData::setEditingDuration(::sal_Int32 the_value) { - if (the_value < 0) throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::setEditingDuration: argument is negative"), - *this, 0); + if (the_value < 0) + throw css::lang::IllegalArgumentException( + "SfxDocumentMetaData::setEditingDuration: argument is negative", + *this, 0); setMetaTextAndNotify("meta:editing-duration", durationToText(the_value)); } @@ -1735,8 +1738,8 @@ SfxDocumentMetaData::loadFromStorage( const css::uno::Reference< css::embed::XStorage > & xStorage, const css::uno::Sequence< css::beans::PropertyValue > & Medium) { - if (!xStorage.is()) throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::loadFromStorage: argument is null"), *this, 0); + if (!xStorage.is()) + throw css::lang::IllegalArgumentException("SfxDocumentMetaData::loadFromStorage: argument is null", *this, 0); ::osl::MutexGuard g(m_aMutex); // open meta data file @@ -1780,9 +1783,10 @@ SfxDocumentMetaData::loadFromStorage( xMsf->createInstanceWithArgumentsAndContext( OUString::createFromAscii(pServiceName), args, m_xContext), css::uno::UNO_QUERY_THROW); - if (!xDocHandler.is()) throw css::uno::RuntimeException( - OUString("SfxDocumentMetaData::loadFromStorage:" - " cannot create XMLOasisMetaImporter service"), *this); + if (!xDocHandler.is()) + throw css::uno::RuntimeException( + "SfxDocumentMetaData::loadFromStorage:" + " cannot create XMLOasisMetaImporter service", *this); css::uno::Reference<css::document::XImporter> xImp (xDocHandler, css::uno::UNO_QUERY_THROW); xImp->setTargetDocument(css::uno::Reference<css::lang::XComponent>(this)); @@ -1790,9 +1794,9 @@ SfxDocumentMetaData::loadFromStorage( try { xParser->parseStream(input); } catch (const css::xml::sax::SAXException &) { - throw css::io::WrongFormatException(OUString( + throw css::io::WrongFormatException( "SfxDocumentMetaData::loadFromStorage:" - " XML parsing exception"), *this); + " XML parsing exception", *this); } // NB: the implementation of XMLOasisMetaImporter calls initialize checkInit(); @@ -1803,9 +1807,9 @@ SfxDocumentMetaData::storeToStorage( const css::uno::Reference< css::embed::XStorage > & xStorage, const css::uno::Sequence< css::beans::PropertyValue > & Medium) { - if (!xStorage.is()) throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::storeToStorage:" - " argument is null"), *this, 0); + if (!xStorage.is()) + throw css::lang::IllegalArgumentException( + "SfxDocumentMetaData::storeToStorage: argument is null", *this, 0); ::osl::MutexGuard g(m_aMutex); checkInit(); @@ -1866,8 +1870,8 @@ SfxDocumentMetaData::storeToStorage( xTransaction->commit(); } } else { - throw css::io::IOException(OUString( - "SfxDocumentMetaData::storeToStorage: cannot filter"), *this); + throw css::io::IOException( + "SfxDocumentMetaData::storeToStorage: cannot filter", *this); } } @@ -1900,13 +1904,13 @@ SfxDocumentMetaData::loadFromMedium(const OUString & URL, throw; } catch (const css::uno::Exception & e) { throw css::lang::WrappedTargetException( - OUString("SfxDocumentMetaData::loadFromMedium: exception"), + "SfxDocumentMetaData::loadFromMedium: exception", css::uno::Reference<css::uno::XInterface>(*this), css::uno::makeAny(e)); } if (!xStorage.is()) { - throw css::uno::RuntimeException(OUString( - "SfxDocumentMetaData::loadFromMedium: cannot get Storage"), + throw css::uno::RuntimeException( + "SfxDocumentMetaData::loadFromMedium: cannot get Storage", *this); } loadFromStorage(xStorage, md.getAsConstPropertyValueList()); @@ -1926,8 +1930,8 @@ SfxDocumentMetaData::storeToMedium(const OUString & URL, if (!xStorage.is()) { - throw css::uno::RuntimeException(OUString( - "SfxDocumentMetaData::storeToMedium: cannot get Storage"), + throw css::uno::RuntimeException( + "SfxDocumentMetaData::storeToMedium: cannot get Storage", *this); } // set MIME type of the storage @@ -1975,14 +1979,12 @@ void SAL_CALL SfxDocumentMetaData::initialize( const css::uno::Sequence< css::un if (any >>= xDoc) { if (!xDoc.is()) { throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::" - "initialize: argument is null"), + "SfxDocumentMetaData::initialize: argument is null", *this, static_cast<sal_Int16>(i)); } } else { throw css::lang::IllegalArgumentException( - OUString("SfxDocumentMetaData::" - "initialize: argument must be XDocument"), + "SfxDocumentMetaData::initialize: argument must be XDocument", *this, static_cast<sal_Int16>(i)); } } @@ -2020,7 +2022,7 @@ SfxDocumentMetaData::createClone() } catch (const css::uno::Exception & e) { css::uno::Any a(e); throw css::lang::WrappedTargetRuntimeException( - OUString("SfxDocumentMetaData::createClone: exception"), + "SfxDocumentMetaData::createClone: exception", css::uno::Reference<css::uno::XInterface>(*this), a); } return css::uno::Reference<css::util::XCloneable> (pNew); diff --git a/sfx2/source/notify/globalevents.cxx b/sfx2/source/notify/globalevents.cxx index b4db95ec412a..1402d07b6331 100644 --- a/sfx2/source/notify/globalevents.cxx +++ b/sfx2/source/notify/globalevents.cxx @@ -250,7 +250,7 @@ void SAL_CALL SfxGlobalEvents_Impl::insert( const uno::Any& aElement ) aElement >>= xDoc; if (!xDoc.is()) throw lang::IllegalArgumentException( - OUString("Can not locate at least the model parameter."), + "Can not locate at least the model parameter.", static_cast< container::XSet* >(this), 0); @@ -284,7 +284,7 @@ void SAL_CALL SfxGlobalEvents_Impl::remove( const uno::Any& aElement ) aElement >>= xDoc; if (!xDoc.is()) throw lang::IllegalArgumentException( - OUString("Can not locate at least the model parameter."), + "Can not locate at least the model parameter.", static_cast< container::XSet* >(this), 0); diff --git a/shell/source/backends/desktopbe/desktopbackend.cxx b/shell/source/backends/desktopbe/desktopbackend.cxx index e162a03c3ded..42bc6a8b3ce4 100644 --- a/shell/source/backends/desktopbe/desktopbackend.cxx +++ b/shell/source/backends/desktopbe/desktopbackend.cxx @@ -121,7 +121,7 @@ private: void Default::setPropertyValue(OUString const &, css::uno::Any const &) { throw css::lang::IllegalArgumentException( - OUString("setPropertyValue not supported"), + "setPropertyValue not supported", static_cast< cppu::OWeakObject * >(this), -1); } diff --git a/shell/source/backends/localebe/localebackend.cxx b/shell/source/backends/localebe/localebackend.cxx index 1eb92c9773e8..36d1bf456667 100644 --- a/shell/source/backends/localebe/localebackend.cxx +++ b/shell/source/backends/localebe/localebackend.cxx @@ -259,8 +259,7 @@ void LocaleBackend::setPropertyValue( OUString const &, css::uno::Any const &) { throw css::lang::IllegalArgumentException( - OUString( - "setPropertyValue not supported"), + "setPropertyValue not supported", static_cast< cppu::OWeakObject * >(this), -1); } diff --git a/stoc/source/invocation/invocation.cxx b/stoc/source/invocation/invocation.cxx index 6622441a8cd3..fea9e93cd43b 100644 --- a/stoc/source/invocation/invocation.cxx +++ b/stoc/source/invocation/invocation.cxx @@ -887,7 +887,7 @@ InvocationInfo SAL_CALL Invocation_Impl::getInfoForName( const OUString& aName, if( !bFound ) { throw IllegalArgumentException( - OUString( "Unknown name, getExactName() failed!" ), + "Unknown name, getExactName() failed!", static_cast<XWeak *>(static_cast<OWeakObject *>(this)), 0 ); } return aRetInfo; diff --git a/stoc/source/javavm/javavm.cxx b/stoc/source/javavm/javavm.cxx index 8627f8583d6c..d7b0c885b676 100644 --- a/stoc/source/javavm/javavm.cxx +++ b/stoc/source/javavm/javavm.cxx @@ -355,13 +355,13 @@ void getDefaultLocaleFromConfig( xSMgr->createInstanceWithContext( "com.sun.star.configuration.ConfigurationRegistry", xCtx ); if(!xConfRegistry.is()) throw css::uno::RuntimeException( - OUString("javavm.cxx: couldn't get ConfigurationRegistry"), nullptr); + "javavm.cxx: couldn't get ConfigurationRegistry", nullptr); css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple( xConfRegistry, css::uno::UNO_QUERY); if(!xConfRegistry_simple.is()) throw css::uno::RuntimeException( - OUString("javavm.cxx: couldn't get ConfigurationRegistry"), nullptr); + "javavm.cxx: couldn't get ConfigurationRegistry", nullptr); xConfRegistry_simple->open("org.openoffice.Setup", true, false); css::uno::Reference<css::registry::XRegistryKey> xRegistryRootKey = xConfRegistry_simple->getRootKey(); @@ -461,13 +461,13 @@ void getJavaPropsFromSafetySettings( xCtx); if(!xConfRegistry.is()) throw css::uno::RuntimeException( - OUString("javavm.cxx: couldn't get ConfigurationRegistry"), nullptr); + "javavm.cxx: couldn't get ConfigurationRegistry", nullptr); css::uno::Reference<css::registry::XSimpleRegistry> xConfRegistry_simple( xConfRegistry, css::uno::UNO_QUERY); if(!xConfRegistry_simple.is()) throw css::uno::RuntimeException( - OUString("javavm.cxx: couldn't get ConfigurationRegistry"), nullptr); + "javavm.cxx: couldn't get ConfigurationRegistry", nullptr); xConfRegistry_simple->open( "org.openoffice.Office.Java", @@ -624,7 +624,7 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & OUString(), static_cast< cppu::OWeakObject * >(this)); if (m_xUnoVirtualMachine.is()) throw css::uno::RuntimeException( - OUString("bad call to initialize"), + "bad call to initialize", static_cast< cppu::OWeakObject * >(this)); css::beans::NamedValue val; if (rArguments.getLength() == 1 && (rArguments[0] >>= val) && val.Name == "UnoVirtualMachine" ) @@ -652,19 +652,19 @@ JavaVirtualMachine::initialize(css::uno::Sequence< css::uno::Any > const & m_xUnoVirtualMachine = new jvmaccess::UnoVirtualMachine(vm, nullptr); } catch (jvmaccess::UnoVirtualMachine::CreationException &) { throw css::uno::RuntimeException( - OUString("jvmaccess::UnoVirtualMachine::CreationException"), + "jvmaccess::UnoVirtualMachine::CreationException", static_cast< cppu::OWeakObject * >(this)); } } } if (!m_xUnoVirtualMachine.is()) { throw css::lang::IllegalArgumentException( - OUString("sequence of exactly one any containing either (a) a" - " com.sun.star.beans.NamedValue with Name" - " \"UnoVirtualMachine\" and Value a hyper representing a" - " non-null pointer to a jvmaccess:UnoVirtualMachine, or (b)" - " a hyper representing a non-null pointer to a" - " jvmaccess::VirtualMachine required"), + "sequence of exactly one any containing either (a) a" + " com.sun.star.beans.NamedValue with Name" + " \"UnoVirtualMachine\" and Value a hyper representing a" + " non-null pointer to a jvmaccess:UnoVirtualMachine, or (b)" + " a hyper representing a non-null pointer to a" + " jvmaccess::VirtualMachine required", static_cast< cppu::OWeakObject * >(this), 0); } m_xVirtualMachine = m_xUnoVirtualMachine->getVirtualMachine(); @@ -776,8 +776,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //%PRODUCTNAME requires a Java runtime environment (JRE) to perform this task. //Please install a JRE and restart %PRODUCTNAME. css::java::JavaNotFoundException exc( - OUString("JavaVirtualMachine::getJavaVM failed because" - " No suitable JRE found!"), + "JavaVirtualMachine::getJavaVM failed because" + " No suitable JRE found!", static_cast< cppu::OWeakObject * >(this)); askForRetry(css::uno::makeAny(exc)); return css::uno::Any(); @@ -786,8 +786,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) { //An unexpected error occurred throw css::uno::RuntimeException( - OUString("[JavaVirtualMachine]:An unexpected error occurred" - " while searching for a Java!"), nullptr); + "[JavaVirtualMachine]:An unexpected error occurred" + " while searching for a Java!", nullptr); } } case JFW_E_INVALID_SETTINGS: @@ -797,8 +797,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) // - Options - %PRODUCTNAME - Java, select the Java runtime environment // you want to have used by %PRODUCTNAME. css::java::InvalidJavaSettingsException exc( - OUString("JavaVirtualMachine::getJavaVM failed because" - " Java settings have changed!"), + "JavaVirtualMachine::getJavaVM failed because" + " Java settings have changed!", static_cast< cppu::OWeakObject * >(this)); askForRetry(css::uno::makeAny(exc)); return css::uno::Any(); @@ -810,7 +810,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //this task. However, use of a JRE has been disabled. Do you want to //enable the use of a JRE now? css::java::JavaDisabledException exc( - OUString("JavaVirtualMachine::getJavaVM failed because Java is disabled!"), + "JavaVirtualMachine::getJavaVM failed because Java is disabled!", static_cast< cppu::OWeakObject * >(this)); if( ! askForRetry(css::uno::makeAny(exc))) return css::uno::Any(); @@ -847,7 +847,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //is defective. Please select another version or install a new JRE //and select it under Tools - Options - %PRODUCTNAME - Java. css::java::JavaVMCreationFailureException exc( - OUString("JavaVirtualMachine::getJavaVM failed because Java is defective!"), + "JavaVirtualMachine::getJavaVM failed because Java is defective!", static_cast< cppu::OWeakObject * >(this), 0); askForRetry(css::uno::makeAny(exc)); return css::uno::Any(); @@ -864,8 +864,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //For the selected Java runtime environment to work properly, //%PRODUCTNAME must be restarted. Please restart %PRODUCTNAME now. css::java::RestartRequiredException exc( - OUString("JavaVirtualMachine::getJavaVM failed because " - "Office must be restarted before Java can be used!"), + "JavaVirtualMachine::getJavaVM failed because " + "Office must be restarted before Java can be used!", static_cast< cppu::OWeakObject * >(this)); askForRetry(css::uno::makeAny(exc)); return css::uno::Any(); @@ -874,8 +874,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) //RuntimeException: error is somewhere in the java framework. //An unexpected error occurred throw css::uno::RuntimeException( - OUString("[JavaVirtualMachine]:An unexpected error occurred" - " while starting Java!"), nullptr); + "[JavaVirtualMachine]:An unexpected error occurred" + " while starting Java!", nullptr); } if (bStarted) @@ -902,7 +902,7 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) setUpUnoVirtualMachine(guard.getEnvironment()); } catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) { throw css::uno::RuntimeException( - OUString("jvmaccess::VirtualMachine::AttachGuard::CreationException occurred"), + "jvmaccess::VirtualMachine::AttachGuard::CreationException occurred", static_cast< cppu::OWeakObject * >(this)); } } @@ -910,8 +910,8 @@ JavaVirtualMachine::getJavaVM(css::uno::Sequence< sal_Int8 > const & rProcessId) default: // RETURN_JAVAVM if (m_pJavaVm == nullptr) { throw css::uno::RuntimeException( - OUString("JavaVirtualMachine service was initialized in a way" - " that the requested JavaVM pointer is not available"), + "JavaVirtualMachine service was initialized in a way" + " that the requested JavaVM pointer is not available", static_cast< cppu::OWeakObject * >(this)); } return css::uno::makeAny(reinterpret_cast< sal_IntPtr >(m_pJavaVm)); @@ -975,7 +975,7 @@ void SAL_CALL JavaVirtualMachine::registerThread() OUString(), static_cast< cppu::OWeakObject * >(this)); if (!m_xUnoVirtualMachine.is()) throw css::uno::RuntimeException( - OUString("JavaVirtualMachine::registerThread: null VirtualMachine"), + "JavaVirtualMachine::registerThread: null VirtualMachine", static_cast< cppu::OWeakObject * >(this)); GuardStack * pStack = static_cast< GuardStack * >(m_aAttachGuards.getData()); @@ -993,8 +993,8 @@ void SAL_CALL JavaVirtualMachine::registerThread() catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) { throw css::uno::RuntimeException( - OUString("JavaVirtualMachine::registerThread: jvmaccess::" - "VirtualMachine::AttachGuard::CreationException"), + "JavaVirtualMachine::registerThread: jvmaccess::" + "VirtualMachine::AttachGuard::CreationException", static_cast< cppu::OWeakObject * >(this)); } } @@ -1007,13 +1007,13 @@ void SAL_CALL JavaVirtualMachine::revokeThread() OUString(), static_cast< cppu::OWeakObject * >(this)); if (!m_xUnoVirtualMachine.is()) throw css::uno::RuntimeException( - OUString("JavaVirtualMachine::revokeThread: null VirtualMachine"), + "JavaVirtualMachine::revokeThread: null VirtualMachine", static_cast< cppu::OWeakObject * >(this)); GuardStack * pStack = static_cast< GuardStack * >(m_aAttachGuards.getData()); if (pStack == nullptr || pStack->empty()) throw css::uno::RuntimeException( - OUString("JavaVirtualMachine::revokeThread: no matching registerThread"), + "JavaVirtualMachine::revokeThread: no matching registerThread", static_cast< cppu::OWeakObject * >(this)); delete pStack->top(); pStack->pop(); @@ -1266,7 +1266,7 @@ void SAL_CALL JavaVirtualMachine::elementReplaced( catch (jvmaccess::VirtualMachine::AttachGuard::CreationException &) { throw css::uno::RuntimeException( - OUString("jvmaccess::VirtualMachine::AttachGuard::CreationException"), + "jvmaccess::VirtualMachine::AttachGuard::CreationException", nullptr); } } @@ -1524,7 +1524,7 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) { baseUrl = exp->expandMacros("$URE_INTERNAL_JAVA_DIR/"); } catch (css::lang::IllegalArgumentException &) { throw css::uno::RuntimeException( - OUString("css::lang::IllegalArgumentException"), + "css::lang::IllegalArgumentException", static_cast< cppu::OWeakObject * >(this)); } OUString classPath; @@ -1624,7 +1624,7 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) { m_xVirtualMachine, cl2); } catch (jvmaccess::UnoVirtualMachine::CreationException &) { throw css::uno::RuntimeException( - OUString("jvmaccess::UnoVirtualMachine::CreationException"), + "jvmaccess::UnoVirtualMachine::CreationException", static_cast< cppu::OWeakObject * >(this)); } } @@ -1632,7 +1632,7 @@ void JavaVirtualMachine::setUpUnoVirtualMachine(JNIEnv * environment) { void JavaVirtualMachine::handleJniException(JNIEnv * environment) { environment->ExceptionClear(); throw css::uno::RuntimeException( - OUString("JNI exception occurred"), + "JNI exception occurred", static_cast< cppu::OWeakObject * >(this)); } diff --git a/stoc/source/simpleregistry/simpleregistry.cxx b/stoc/source/simpleregistry/simpleregistry.cxx index d50c243949f6..3035bdad527d 100644 --- a/stoc/source/simpleregistry/simpleregistry.cxx +++ b/stoc/source/simpleregistry/simpleregistry.cxx @@ -249,8 +249,8 @@ sal_Int32 Key::getLongValue() break; case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getLongValue:" - " underlying RegistryKey::getValue() = RegError::INVALID_VALUE"), + "com.sun.star.registry.SimpleRegistry key getLongValue:" + " underlying RegistryKey::getValue() = RegError::INVALID_VALUE", static_cast< OWeakObject * >(this)); default: throw css::registry::InvalidRegistryException( @@ -288,9 +288,9 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue() return css::uno::Sequence< sal_Int32 >(); case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getLongListValue:" - " underlying RegistryKey::getLongListValue() =" - " RegError::INVALID_VALUE"), + "com.sun.star.registry.SimpleRegistry key getLongListValue:" + " underlying RegistryKey::getLongListValue() =" + " RegError::INVALID_VALUE", static_cast< OWeakObject * >(this)); default: throw css::registry::InvalidRegistryException( @@ -302,8 +302,8 @@ css::uno::Sequence< sal_Int32 > Key::getLongListValue() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getLongListValue:" - " underlying RegistryKey::getLongListValue() too large"), + "com.sun.star.registry.SimpleRegistry key getLongListValue:" + " underlying RegistryKey::getLongListValue() too large", static_cast< OWeakObject * >(this)); } css::uno::Sequence< sal_Int32 > value(static_cast< sal_Int32 >(n)); @@ -354,15 +354,15 @@ OUString Key::getAsciiValue() // size contains terminating null (error in underlying registry.cxx): if (size == 0) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:" - " underlying RegistryKey size 0 cannot happen due to" - " design error"), + "com.sun.star.registry.SimpleRegistry key getAsciiValue:" + " underlying RegistryKey size 0 cannot happen due to" + " design error", static_cast< OWeakObject * >(this)); } if (size > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:" - " underlying RegistryKey size too large"), + "com.sun.star.registry.SimpleRegistry key getAsciiValue:" + " underlying RegistryKey size too large", static_cast< OWeakObject * >(this)); } std::vector< char > list(size); @@ -376,9 +376,9 @@ OUString Key::getAsciiValue() } if (list[size - 1] != '\0') { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:" - " underlying RegistryKey value must be null-terminated due" - " to design error"), + "com.sun.star.registry.SimpleRegistry key getAsciiValue:" + " underlying RegistryKey value must be null-terminated due" + " to design error", static_cast< OWeakObject * >(this)); } OUString value; @@ -390,8 +390,8 @@ OUString Key::getAsciiValue() RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getAsciiValue:" - " underlying RegistryKey not UTF-8"), + "com.sun.star.registry.SimpleRegistry key getAsciiValue:" + " underlying RegistryKey not UTF-8" , static_cast< OWeakObject * >(this)); } return value; @@ -407,8 +407,8 @@ void Key::setAsciiValue(OUString const & value) RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { throw css::uno::RuntimeException( - OUString("com.sun.star.registry.SimpleRegistry key setAsciiValue:" - " value not UTF-16"), + "com.sun.star.registry.SimpleRegistry key setAsciiValue:" + " value not UTF-16", static_cast< OWeakObject * >(this)); } RegError err = key_.setValue( @@ -436,9 +436,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() return css::uno::Sequence< OUString >(); case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key" - " getAsciiListValue: underlying" - " RegistryKey::getStringListValue() = RegError::INVALID_VALUE"), + "com.sun.star.registry.SimpleRegistry key" + " getAsciiListValue: underlying" + " RegistryKey::getStringListValue() = RegError::INVALID_VALUE", static_cast< OWeakObject * >(this)); default: throw css::registry::InvalidRegistryException( @@ -451,9 +451,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key" - " getAsciiListValue: underlying" - " RegistryKey::getStringListValue() too large"), + "com.sun.star.registry.SimpleRegistry key" + " getAsciiListValue: underlying" + " RegistryKey::getStringListValue() too large", static_cast< OWeakObject * >(this)); } css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n)); @@ -468,9 +468,9 @@ css::uno::Sequence< OUString > Key::getAsciiListValue() RTL_TEXTTOUNICODE_FLAGS_INVALID_ERROR))) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key" - " getAsciiListValue: underlying RegistryKey not" - " UTF-8"), + "com.sun.star.registry.SimpleRegistry key" + " getAsciiListValue: underlying RegistryKey not" + " UTF-8", static_cast< OWeakObject * >(this)); } } @@ -490,8 +490,8 @@ void Key::setAsciiListValue( RTL_UNICODETOTEXT_FLAGS_INVALID_ERROR))) { throw css::uno::RuntimeException( - OUString("com.sun.star.registry.SimpleRegistry key" - " setAsciiListValue: value not UTF-16"), + "com.sun.star.registry.SimpleRegistry key" + " setAsciiListValue: value not UTF-16", static_cast< OWeakObject * >(this)); } list.push_back(utf8); @@ -538,15 +538,15 @@ OUString Key::getStringValue() // registry.cxx): if (size == 0 || (size & 1) == 1) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getStringValue:" - " underlying RegistryKey size 0 or odd cannot happen due to" - " design error"), + "com.sun.star.registry.SimpleRegistry key getStringValue:" + " underlying RegistryKey size 0 or odd cannot happen due to" + " design error", static_cast< OWeakObject * >(this)); } if (size > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getStringValue:" - " underlying RegistryKey size too large"), + "com.sun.star.registry.SimpleRegistry key getStringValue:" + " underlying RegistryKey size too large", static_cast< OWeakObject * >(this)); } std::vector< sal_Unicode > list(size); @@ -560,9 +560,9 @@ OUString Key::getStringValue() } if (list[size/2 - 1] != 0) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getStringValue:" - " underlying RegistryKey value must be null-terminated due" - " to design error"), + "com.sun.star.registry.SimpleRegistry key getStringValue:" + " underlying RegistryKey value must be null-terminated due" + " to design error", static_cast< OWeakObject * >(this)); } return OUString(&list[0], static_cast< sal_Int32 >(size/2 - 1)); @@ -597,9 +597,9 @@ css::uno::Sequence< OUString > Key::getStringListValue() return css::uno::Sequence< OUString >(); case RegError::INVALID_VALUE: throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key" - " getStringListValue: underlying" - " RegistryKey::getUnicodeListValue() = RegError::INVALID_VALUE"), + "com.sun.star.registry.SimpleRegistry key" + " getStringListValue: underlying" + " RegistryKey::getUnicodeListValue() = RegError::INVALID_VALUE", static_cast< OWeakObject * >(this)); default: throw css::registry::InvalidRegistryException( @@ -612,9 +612,9 @@ css::uno::Sequence< OUString > Key::getStringListValue() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key" - " getStringListValue: underlying" - " RegistryKey::getUnicodeListValue() too large"), + "com.sun.star.registry.SimpleRegistry key" + " getStringListValue: underlying" + " RegistryKey::getUnicodeListValue() too large", static_cast< OWeakObject * >(this)); } css::uno::Sequence< OUString > value(static_cast< sal_Int32 >(n)); @@ -666,8 +666,8 @@ css::uno::Sequence< sal_Int8 > Key::getBinaryValue() } if (size > SAL_MAX_INT32) { throw css::registry::InvalidValueException( - OUString("com.sun.star.registry.SimpleRegistry key getBinaryValue:" - " underlying RegistryKey size too large"), + "com.sun.star.registry.SimpleRegistry key getBinaryValue:" + " underlying RegistryKey size too large", static_cast< OWeakObject * >(this)); } css::uno::Sequence< sal_Int8 > value(static_cast< sal_Int32 >(size)); @@ -780,8 +780,8 @@ Key::openKeys() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidRegistryException( - OUString("com.sun.star.registry.SimpleRegistry key getKeyNames:" - " underlying RegistryKey::getKeyNames() too large"), + "com.sun.star.registry.SimpleRegistry key getKeyNames:" + " underlying RegistryKey::getKeyNames() too large", static_cast< OWeakObject * >(this)); } css::uno::Sequence< css::uno::Reference< css::registry::XRegistryKey > > @@ -808,8 +808,8 @@ css::uno::Sequence< OUString > Key::getKeyNames() sal_uInt32 n = list.getLength(); if (n > SAL_MAX_INT32) { throw css::registry::InvalidRegistryException( - OUString("com.sun.star.registry.SimpleRegistry key getKeyNames:" - " underlying RegistryKey::getKeyNames() too large"), + "com.sun.star.registry.SimpleRegistry key getKeyNames:" + " underlying RegistryKey::getKeyNames() too large", static_cast< OWeakObject * >(this)); } css::uno::Sequence< OUString > names(static_cast< sal_Int32 >(n)); @@ -948,8 +948,8 @@ void SimpleRegistry::mergeKey( break; case RegError::MERGE_ERROR: throw css::registry::MergeConflictException( - OUString("com.sun.star.registry.SimpleRegistry.mergeKey:" - " underlying Registry::mergeKey() = RegError::MERGE_ERROR"), + "com.sun.star.registry.SimpleRegistry.mergeKey:" + " underlying Registry::mergeKey() = RegError::MERGE_ERROR", static_cast< cppu::OWeakObject * >(this)); default: throw css::registry::InvalidRegistryException( diff --git a/svtools/source/control/valueacc.cxx b/svtools/source/control/valueacc.cxx index 088060b2fc4e..86d05054f001 100644 --- a/svtools/source/control/valueacc.cxx +++ b/svtools/source/control/valueacc.cxx @@ -665,7 +665,7 @@ void ValueSetAcc::ThrowIfDisposed() { SAL_WARN("svx", "Calling disposed object. Throwing exception:"); throw lang::DisposedException ( - OUString("object has been already disposed"), + "object has been already disposed", static_cast<uno::XWeak*>(this)); } else diff --git a/svtools/source/hatchwindow/documentcloser.cxx b/svtools/source/hatchwindow/documentcloser.cxx index eb51dfb8b8ac..f911712b1cd5 100644 --- a/svtools/source/hatchwindow/documentcloser.cxx +++ b/svtools/source/hatchwindow/documentcloser.cxx @@ -153,13 +153,13 @@ ODocumentCloser::ODocumentCloser(const css::uno::Sequence< css::uno::Any >& aArg sal_Int32 nLen = aArguments.getLength(); if ( nLen != 1 ) throw lang::IllegalArgumentException( - OUString("Wrong count of parameters!" ), + "Wrong count of parameters!", uno::Reference< uno::XInterface >(), 0 ); if ( !( aArguments[0] >>= m_xFrame ) || !m_xFrame.is() ) throw lang::IllegalArgumentException( - OUString("Nonempty reference is expected as the first argument!" ), + "Nonempty reference is expected as the first argument!", uno::Reference< uno::XInterface >(), 0 ); } diff --git a/svx/source/accessibility/AccessibleShape.cxx b/svx/source/accessibility/AccessibleShape.cxx index 455423730c7f..88f5f2a88bd8 100644 --- a/svx/source/accessibility/AccessibleShape.cxx +++ b/svx/source/accessibility/AccessibleShape.cxx @@ -574,8 +574,8 @@ awt::Rectangle SAL_CALL AccessibleShape::getBounds() // Transform coordinates from internal to pixel. if (maShapeTreeInfo.GetViewForwarder() == nullptr) - throw uno::RuntimeException (OUString ( - "AccessibleShape has no valid view forwarder"), + throw uno::RuntimeException ( + "AccessibleShape has no valid view forwarder", static_cast<uno::XWeak*>(this)); ::Size aPixelSize = maShapeTreeInfo.GetViewForwarder()->LogicToPixel ( ::Size (aBoundingBox.Width, aBoundingBox.Height)); 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; diff --git a/toolkit/source/controls/unocontrolcontainer.cxx b/toolkit/source/controls/unocontrolcontainer.cxx index d64d9f75562c..01172a99bc66 100644 --- a/toolkit/source/controls/unocontrolcontainer.cxx +++ b/toolkit/source/controls/unocontrolcontainer.cxx @@ -476,7 +476,7 @@ void UnoControlContainer::removeContainerListener( const uno::Reference< contain uno::Reference< awt::XControl > xControl; if ( !( _rElement >>= xControl ) || !xControl.is() ) throw lang::IllegalArgumentException( - OUString( "Elements must support the XControl interface." ), + "Elements must support the XControl interface.", *this, 1 ); @@ -491,7 +491,7 @@ void SAL_CALL UnoControlContainer::removeByIdentifier( ::sal_Int32 _nIdentifier uno::Reference< awt::XControl > xControl; if ( !mpControls->getControlForIdentifier( _nIdentifier, xControl ) ) throw container::NoSuchElementException( - OUString( "There is no element with the given identifier." ), + "There is no element with the given identifier.", *this ); @@ -505,14 +505,14 @@ void SAL_CALL UnoControlContainer::replaceByIdentifer( ::sal_Int32 _nIdentifier, uno::Reference< awt::XControl > xExistentControl; if ( !mpControls->getControlForIdentifier( _nIdentifier, xExistentControl ) ) throw container::NoSuchElementException( - OUString( "There is no element with the given identifier." ), + "There is no element with the given identifier.", *this ); uno::Reference< awt::XControl > xNewControl; if ( !( _rElement >>= xNewControl ) ) throw lang::IllegalArgumentException( - OUString( "Elements must support the XControl interface." ), + "Elements must support the XControl interface.", *this, 1 ); diff --git a/ucb/source/core/ucb.cxx b/ucb/source/core/ucb.cxx index 025d5537bb84..d363044f6d19 100644 --- a/ucb/source/core/ucb.cxx +++ b/ucb/source/core/ucb.cxx @@ -638,7 +638,7 @@ Any SAL_CALL UniversalContentBroker::execute( { ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -662,7 +662,7 @@ Any SAL_CALL UniversalContentBroker::execute( { ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx index e93f056c8e37..22734ad82256 100644 --- a/ucb/source/core/ucbcmds.cxx +++ b/ucb/source/core/ucbcmds.cxx @@ -641,7 +641,7 @@ uno::Reference< ucb::XContent > createNew( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Unknown transfer operation!" ), + "Unknown transfer operation!", rContext.xProcessor, -1 ) ), rContext.xOrigEnv ); @@ -1028,7 +1028,7 @@ void handleNameClashRename( { ucbhelper::cancelCommandExecution( uno::makeAny( beans::UnknownPropertyException( - OUString( "Unable to get property 'Title' from new object!" ), + "Unable to get property 'Title' from new object!", rContext.xProcessor ) ), rContext.xOrigEnv ); // Unreachable @@ -1143,7 +1143,7 @@ void handleNameClashRename( ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedNameClashException( - OUString( "Unable to resolve name clash!" ), + "Unable to resolve name clash!", rContext.xProcessor, ucb::NameClash::RENAME ) ), rContext.xOrigEnv ); @@ -1164,8 +1164,7 @@ void globalTransfer_( { ucbhelper::cancelCommandExecution( uno::makeAny( beans::UnknownPropertyException( - OUString( "Unable to get property 'IsFolder' " - "from source object!" ), + "Unable to get property 'IsFolder' from source object!", rContext.xProcessor ) ), rContext.xOrigEnv ); // Unreachable @@ -1177,8 +1176,7 @@ void globalTransfer_( { ucbhelper::cancelCommandExecution( uno::makeAny( beans::UnknownPropertyException( - OUString( "Unable to get property 'IsDocument' " - "from source object!" ), + "Unable to get property 'IsDocument' from source object!", rContext.xProcessor ) ), rContext.xOrigEnv ); // Unreachable @@ -1338,9 +1336,8 @@ void globalTransfer_( // No chance to solve name clashes, because I'm not able to detect // whether there is one. throw ucb::UnsupportedNameClashException( - OUString( - "Unable to resolve name clashes, no chance to detect " - "that there is one!" ), + "Unable to resolve name clashes, no chance to detect " + "that there is one!", rContext.xProcessor, rContext.aArg.NameClash ); } @@ -1366,9 +1363,8 @@ void globalTransfer_( ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedNameClashException( - OUString( - "BUG: insert + replace == true MUST NOT " - "throw NameClashException." ), + "BUG: insert + replace == true MUST NOT " + "throw NameClashException.", rContext.xProcessor, rContext.aArg.NameClash ) ), rContext.xOrigEnv ); @@ -1414,9 +1410,8 @@ void globalTransfer_( case ABORT: throw ucb::CommandFailedException( - OUString( - "abort requested via interaction " - "handler" ), + "abort requested via interaction " + "handler", uno::Reference< uno::XInterface >(), aExc ); // break; @@ -1446,7 +1441,7 @@ void globalTransfer_( { // error setting title. Abort. throw ucb::CommandFailedException( - OUString( "error setting Title property!" ), + "error setting Title property!", uno::Reference< uno::XInterface >(), aExc ); } @@ -1464,9 +1459,8 @@ void globalTransfer_( ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedNameClashException( - OUString( - "default action, don't know how to " - "handle name clash" ), + "default action, don't know how to " + "handle name clash", rContext.xProcessor, rContext.aArg.NameClash ) ), rContext.xOrigEnv ); @@ -1786,9 +1780,8 @@ void UniversalContentBroker::globalTransfer( case ABORT: throw ucb::CommandFailedException( - OUString( - "abort requested via interaction " - "handler" ), + "abort requested via interaction " + "handler", uno::Reference< uno::XInterface >(), aExc ); // break; diff --git a/ucb/source/ucp/cmis/cmis_content.cxx b/ucb/source/ucp/cmis/cmis_content.cxx index 7d0ab609edce..5296e79fa4b8 100644 --- a/ucb/source/ucp/cmis/cmis_content.cxx +++ b/ucb/source/ucp/cmis/cmis_content.cxx @@ -595,7 +595,7 @@ namespace cmis uno::Any Content::getBadArgExcept() { return uno::makeAny( lang::IllegalArgumentException( - OUString("Wrong argument type!"), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1) ); } @@ -1272,7 +1272,7 @@ namespace cmis ucbhelper::cancelCommandExecution( uno::makeAny( ucb::InteractiveBadTransferURLException( - OUString("Unsupported URL scheme!"), + "Unsupported URL scheme!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); } @@ -1479,7 +1479,7 @@ namespace cmis rValue.Name == "Size" || rValue.Name == "CreatableContentsInfo" ) { - lang::IllegalAccessException e ( OUString("Property is read-only!"), + lang::IllegalAccessException e ( "Property is read-only!", static_cast< cppu::OWeakObject* >( this ) ); aRet[ n ] <<= e; } @@ -1489,7 +1489,7 @@ namespace cmis if (!( rValue.Value >>= aNewTitle )) { aRet[ n ] <<= beans::IllegalTypeException - ( OUString("Property value has wrong type!"), + ( "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); continue; } @@ -1497,7 +1497,7 @@ namespace cmis if ( aNewTitle.getLength() <= 0 ) { aRet[ n ] <<= lang::IllegalArgumentException - ( OUString("Empty title not allowed!"), + ( "Empty title not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); continue; @@ -1509,7 +1509,7 @@ namespace cmis else { SAL_INFO( "ucb.ucp.cmis", "Couldn't set property: " << rValue.Name ); - lang::IllegalAccessException e ( OUString("Property is read-only!"), + lang::IllegalAccessException e ( "Property is read-only!", static_cast< cppu::OWeakObject* >( this ) ); aRet[ n ] <<= e; } diff --git a/ucb/source/ucp/cmis/cmis_repo_content.cxx b/ucb/source/ucp/cmis/cmis_repo_content.cxx index a1a4bd0bedcd..a008c9b92dff 100644 --- a/ucb/source/ucp/cmis/cmis_repo_content.cxx +++ b/ucb/source/ucp/cmis/cmis_repo_content.cxx @@ -72,7 +72,7 @@ namespace cmis uno::Any RepoContent::getBadArgExcept() { return uno::makeAny( lang::IllegalArgumentException( - OUString("Wrong argument type!"), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1) ); } diff --git a/ucb/source/ucp/file/filglob.cxx b/ucb/source/ucp/file/filglob.cxx index 49d08c6f166d..9700d66ddbca 100644 --- a/ucb/source/ucp/file/filglob.cxx +++ b/ucb/source/ucp/file/filglob.cxx @@ -506,7 +506,7 @@ namespace fileaccess { OUString("ContentType"); aAny <<= MissingPropertiesException( - OUString( "a property is missing, necessary to create a content"), + "a property is missing, necessary to create a content", xComProc, aSeq); cancelCommandExecution(aAny,xEnv); @@ -537,7 +537,7 @@ namespace fileaccess { { aAny <<= MissingInputStreamException( - OUString( "the inputstream is missing, necessary to create a content"), + "the inputstream is missing, necessary to create a content", xComProc); cancelCommandExecution(aAny,xEnv); } @@ -779,10 +779,9 @@ namespace fileaccess { } else if( errorCode == TASKHANDLING_TRANSFER_INVALIDSCHEME ) { - aAny <<= - InteractiveBadTransferURLException( - OUString( "bad transfer url"), - xComProc); + aAny <<= InteractiveBadTransferURLException( + "bad transfer url", + xComProc); cancelCommandExecution( aAny,xEnv ); } else if( errorCode == TASKHANDLING_OVERWRITE_FOR_MOVE || diff --git a/ucb/source/ucp/file/filstr.cxx b/ucb/source/ucp/file/filstr.cxx index 20e4952ab5f3..31cd2a4e2351 100644 --- a/ucb/source/ucp/file/filstr.cxx +++ b/ucb/source/ucp/file/filstr.cxx @@ -265,7 +265,7 @@ void XStream_impl::waitForCompletion() // afterwards, there appears to be no cheaper way than to call fsync: if (m_nIsOpen && m_aFile.sync() != osl::FileBase::E_None) { throw io::IOException( - OUString( "could not synchronize file to disc"), + "could not synchronize file to disc", static_cast< OWeakObject * >(this)); } } diff --git a/ucb/source/ucp/ftp/ftpcontent.cxx b/ucb/source/ucp/ftp/ftpcontent.cxx index 2933e73820bb..4cde1893879d 100644 --- a/ucb/source/ucp/ftp/ftpcontent.cxx +++ b/ucb/source/ucp/ftp/ftpcontent.cxx @@ -386,7 +386,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, if(!(aCommand.Argument >>= Properties)) { aRet <<= IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), -1); ucbhelper::cancelCommandExecution(aRet,Environment); @@ -400,7 +400,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, if( ! ( aCommand.Argument >>= propertyValues ) ) { aRet <<= IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), -1); ucbhelper::cancelCommandExecution(aRet,Environment); @@ -421,7 +421,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, InsertCommandArgument aInsertArgument; if ( ! ( aCommand.Argument >>= aInsertArgument ) ) { aRet <<= IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), -1); ucbhelper::cancelCommandExecution(aRet,Environment); @@ -436,7 +436,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, OpenCommandArgument2 aOpenCommand; if ( !( aCommand.Argument >>= aOpenCommand ) ) { aRet <<= IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), -1); @@ -526,7 +526,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, } else { aRet <<= IllegalArgumentException( - OUString( "Unexpected OpenMode!" ), + "Unexpected OpenMode!", static_cast< cppu::OWeakObject * >(this), -1); @@ -538,7 +538,7 @@ Any SAL_CALL FTPContent::execute( const Command& aCommand, ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >(this), -1)), Environment); @@ -849,7 +849,7 @@ Sequence<Any> FTPContent::setPropertyValues( for(sal_Int32 j = 0; j < props.getLength(); ++j) if(props[j].Name == seqPropVal[i].Name) { ret[i] <<= IllegalAccessException( - OUString( "Property is read-only!"), + "Property is read-only!", //props[j].Attributes & PropertyAttribute::READONLY // ? "Property is read-only!" // : "Access denied!"), diff --git a/ucb/source/ucp/gio/gio_content.cxx b/ucb/source/ucp/gio/gio_content.cxx index 6b193765dcf3..15712d99b170 100644 --- a/ucb/source/ucp/gio/gio_content.cxx +++ b/ucb/source/ucp/gio/gio_content.cxx @@ -311,7 +311,7 @@ uno::Any Content::mapGIOError( GError *pError ) uno::Any Content::getBadArgExcept() { return uno::makeAny( lang::IllegalArgumentException( - OUString("Wrong argument type!"), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1) ); } @@ -697,7 +697,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if (!( rValue.Value >>= aNewTitle )) { aRet[ n ] <<= beans::IllegalTypeException - ( OUString("Property value has wrong type!"), + ( "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); continue; } @@ -705,7 +705,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( aNewTitle.getLength() <= 0 ) { aRet[ n ] <<= lang::IllegalArgumentException - ( OUString("Empty title not allowed!"), + ( "Empty title not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); continue; @@ -761,7 +761,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if (!exchangeIdentity( xNewId ) ) { aRet[ nTitlePos ] <<= uno::Exception - ( OUString("Exchange failed!"), + ( "Exchange failed!", static_cast< cppu::OWeakObject * >( this ) ); } } diff --git a/ucb/source/ucp/hierarchy/hierarchycontent.cxx b/ucb/source/ucp/hierarchy/hierarchycontent.cxx index 2d6d3dedf114..114a37df3fe8 100644 --- a/ucb/source/ucp/hierarchy/hierarchycontent.cxx +++ b/ucb/source/ucp/hierarchy/hierarchycontent.cxx @@ -343,7 +343,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -363,7 +363,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -374,7 +374,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "No properties!" ), + "No properties!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -410,7 +410,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -433,7 +433,7 @@ uno::Any SAL_CALL HierarchyContent::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -492,7 +492,7 @@ uno::Any SAL_CALL HierarchyContent::execute( OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -514,7 +514,7 @@ uno::Any SAL_CALL HierarchyContent::execute( OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -1080,28 +1080,28 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "Title" ) @@ -1109,7 +1109,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( if ( isReadOnly() ) { aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else @@ -1144,7 +1144,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( else { aRet[ n ] <<= lang::IllegalArgumentException( - OUString( "Empty title not allowed!" ), + "Empty title not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); } @@ -1152,7 +1152,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1162,7 +1162,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( if ( isReadOnly() ) { aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else @@ -1194,7 +1194,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( else { aRet[ n ] <<= lang::IllegalArgumentException( - OUString( "Empty target URL not allowed!" ), + "Empty target URL not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); } @@ -1202,14 +1202,14 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } else { aRet[ n ] <<= beans::UnknownPropertyException( - OUString( "TargetURL only supported by links!" ), + "TargetURL only supported by links!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1263,7 +1263,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( else { aRet[ n ] <<= uno::Exception( - OUString( "No property set for storing the value!" ), + "No property set for storing the value!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1297,7 +1297,7 @@ uno::Sequence< uno::Any > HierarchyContent::setPropertyValues( // Set error . aRet[ nTitlePos ] <<= uno::Exception( - OUString("Exchange failed!"), + "Exchange failed!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1358,7 +1358,7 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not supported by root folder!" ), + "Not supported by root folder!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable @@ -1426,7 +1426,7 @@ void HierarchyContent::insert( sal_Int32 nNameClashResolve, ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedNameClashException( - OUString( "Unable to resolve name clash!" ), + "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), nNameClashResolve ) ), xEnv ); @@ -1507,7 +1507,7 @@ void HierarchyContent::destroy( bool bDeletePhysical, { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not persistent!" ), + "Not persistent!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable @@ -1518,7 +1518,7 @@ void HierarchyContent::destroy( bool bDeletePhysical, { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not supported by root folder!" ), + "Not supported by root folder!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable @@ -1559,7 +1559,7 @@ void HierarchyContent::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not persistent!" ), + "Not persistent!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable diff --git a/ucb/source/ucp/package/pkgcontent.cxx b/ucb/source/ucp/package/pkgcontent.cxx index 5a4153124bd6..7d7285b61d94 100644 --- a/ucb/source/ucp/package/pkgcontent.cxx +++ b/ucb/source/ucp/package/pkgcontent.cxx @@ -438,7 +438,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -458,7 +458,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -469,7 +469,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "No properties!" ), + "No properties!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -507,7 +507,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -527,7 +527,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -584,7 +584,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -606,7 +606,7 @@ uno::Any SAL_CALL Content::execute( OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -1038,32 +1038,28 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "Title" ) @@ -1072,8 +1068,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else @@ -1102,8 +1097,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { aRet[ n ] <<= lang::IllegalArgumentException( - OUString( - "Empty title not allowed!" ), + "Empty title not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); } @@ -1112,8 +1106,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { aRet[ n ] <<= beans::IllegalTypeException( - OUString( - "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1138,8 +1131,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( - "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1147,8 +1139,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "Compressed" ) @@ -1174,16 +1165,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( - "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } else { aRet[ n ] <<= beans::UnknownPropertyException( - OUString( - "Compressed only supported by streams!" ), + "Compressed only supported by streams!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1210,16 +1199,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( - "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } else { aRet[ n ] <<= beans::UnknownPropertyException( - OUString( - "Encrypted only supported by streams!" ), + "Encrypted only supported by streams!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1227,8 +1214,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( - "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "EncryptionKey" ) @@ -1259,16 +1245,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( - "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } else { aRet[ n ] <<= beans::UnknownPropertyException( - OUString( - "EncryptionKey not supported by non-root folder!" ), + "EncryptionKey not supported by non-root folder!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1321,8 +1305,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= uno::Exception( - OUString( - "No property set for storing the value!" ), + "No property set for storing the value!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1356,7 +1339,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // Set error . aRet[ nTitlePos ] <<= uno::Exception( - OUString("Exchange failed!"), + "Exchange failed!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1639,7 +1622,7 @@ void Content::insert( ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedNameClashException( - OUString( "Unable to resolve name clash!" ), + "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), nNameClashResolve ) ), xEnv ); @@ -1729,7 +1712,7 @@ void Content::destroy( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not persistent!" ), + "Not persistent!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable @@ -1770,7 +1753,7 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not persistent!" ), + "Not persistent!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx index 5b5e5ec9f506..91eb14ca520c 100644 --- a/ucb/source/ucp/tdoc/tdoc_content.cxx +++ b/ucb/source/ucp/tdoc/tdoc_content.cxx @@ -363,7 +363,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -383,7 +383,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -394,7 +394,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "No properties!" ), + "No properties!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -430,7 +430,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -450,8 +450,8 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "insert command only supported by " - "folders and streams!" ), + "insert command only supported by " + "folders and streams!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable @@ -466,9 +466,9 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "insert command not supported by " - "streams that are direct children " - "of document root!" ), + "insert command not supported by " + "streams that are direct children " + "of document root!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); @@ -481,7 +481,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -507,8 +507,8 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "delete command only supported by " - "folders and streams!" ), + "delete command only supported by " + "folders and streams!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); @@ -557,8 +557,8 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "transfer command only supported " - "by folders and documents!" ), + "transfer command only supported " + "by folders and documents!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); @@ -572,7 +572,7 @@ uno::Any SAL_CALL Content::execute( OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -595,9 +595,9 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "createNewContent command only " - "supported by folders and " - "documents!" ), + "createNewContent command only " + "supported by folders and " + "documents!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); @@ -611,7 +611,7 @@ uno::Any SAL_CALL Content::execute( OSL_FAIL( "Wrong argument type!" ); ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -1129,28 +1129,28 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rValue.Name == "Title" ) @@ -1160,7 +1160,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( ( eType == ROOT ) || ( eType == DOCUMENT ) ) { aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else @@ -1190,7 +1190,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= lang::IllegalArgumentException( - OUString( "Empty Title not allowed!" ), + "Empty Title not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); } @@ -1198,7 +1198,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( "Title Property value has wrong type!" ), + "Title Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1209,14 +1209,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( eType == FOLDER ) { aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else { // Storage is only supported by folders. aRet[ n ] <<= beans::UnknownPropertyException( - OUString( "Storage property only supported by folders" ), + "Storage property only supported by folders", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1226,15 +1226,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues( if ( eType == DOCUMENT ) { aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else { // Storage is only supported by folders. aRet[ n ] <<= beans::UnknownPropertyException( - OUString( "DocumentModel property only supported by " - "documents" ), + "DocumentModel property only supported by documents", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1287,7 +1286,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= uno::Exception( - OUString( "No property set for storing the value!" ), + "No property set for storing the value!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1318,7 +1317,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // Set error . aRet[ nTitlePos ] <<= uno::Exception( - OUString("Exchange failed!"), + "Exchange failed!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1650,7 +1649,7 @@ void Content::insert( const uno::Reference< io::XInputStream >& xData, ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedNameClashException( - OUString( "Unable to resolve name clash!" ), + "Unable to resolve name clash!", static_cast< cppu::OWeakObject * >( this ), nNameClashResolve ) ), xEnv ); @@ -1742,7 +1741,7 @@ void Content::destroy( bool bDeletePhysical, { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not persistent!" ), + "Not persistent!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable @@ -1881,7 +1880,7 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::UnsupportedCommandException( - OUString( "Not persistent!" ), + "Not persistent!", static_cast< cppu::OWeakObject * >( this ) ) ), xEnv ); // Unreachable @@ -1920,7 +1919,7 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Invalid source URI! Syntax!" ), + "Invalid source URI! Syntax!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), xEnv ); @@ -1931,8 +1930,7 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Invalid source URI! " - "Must describe a folder or stream!" ), + "Invalid source URI! Must describe a folder or stream!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), xEnv ); @@ -1984,9 +1982,9 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Invalid source URI! " - "Streams cannot be created as " - "children of document root!" ), + "Invalid source URI! " + "Streams cannot be created as " + "children of document root!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), @@ -2013,8 +2011,7 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Invalid source URI! " - "Unable to determine source type!" ), + "Invalid source URI! Unable to determine source type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), xEnv ); @@ -2729,7 +2726,7 @@ static OUString obtainPassword( if ( xAbort.is() ) { throw ucb::CommandFailedException( - OUString( "Abort requested by Interaction Handler." ), + "Abort requested by Interaction Handler.", uno::Reference< uno::XInterface >(), xRequest->getRequest() ); } @@ -2743,7 +2740,7 @@ static OUString obtainPassword( // Unknown selection. Should never happen. throw ucb::CommandFailedException( - OUString( "Interaction Handler selected unknown continuation!" ), + "Interaction Handler selected unknown continuation!", uno::Reference< uno::XInterface >(), xRequest->getRequest() ); } diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx index 0ec5fbfe00e3..aa459df2601e 100644 --- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx +++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx @@ -113,8 +113,7 @@ DocumentContentFactory::createDocumentContent( return xDocFac->createDocumentContent( Model ); throw uno::RuntimeException( - OUString( - "Unable to obtain document content factory!" ), + "Unable to obtain document content factory!", static_cast< cppu::OWeakObject * >( this ) ); } diff --git a/ucb/source/ucp/tdoc/tdoc_provider.cxx b/ucb/source/ucp/tdoc/tdoc_provider.cxx index 4c80a626035d..f3b7e36e4baf 100644 --- a/ucb/source/ucp/tdoc/tdoc_provider.cxx +++ b/ucb/source/ucp/tdoc/tdoc_provider.cxx @@ -134,7 +134,7 @@ ContentProvider::queryContent( Uri aUri( Identifier->getContentIdentifier() ); if ( !aUri.isValid() ) throw ucb::IllegalIdentifierException( - OUString( "Invalid URL!" ), + "Invalid URL!", Identifier ); // Normalize URI. @@ -196,16 +196,14 @@ ContentProvider::createDocumentContent( // no content. throw lang::IllegalArgumentException( - OUString( - "Illegal Content Identifier!" ), + "Illegal Content Identifier!", static_cast< cppu::OWeakObject * >( this ), 1 ); } else { throw lang::IllegalArgumentException( - OUString( - "Unable to obtain document id from model!" ), + "Unable to obtain document id from model!", static_cast< cppu::OWeakObject * >( this ), 1 ); } @@ -213,8 +211,7 @@ ContentProvider::createDocumentContent( else { throw lang::IllegalArgumentException( - OUString( - "No Document Manager!" ), + "No Document Manager!", static_cast< cppu::OWeakObject * >( this ), 1 ); } diff --git a/ucb/source/ucp/tdoc/tdoc_storage.cxx b/ucb/source/ucp/tdoc/tdoc_storage.cxx index a8055241522b..2fcc63561a40 100644 --- a/ucb/source/ucp/tdoc/tdoc_storage.cxx +++ b/ucb/source/ucp/tdoc/tdoc_storage.cxx @@ -85,8 +85,7 @@ StorageElementFactory::createStorage( const OUString & rUri, ( eMode != READ_WRITE_NOCREATE ) && ( eMode != READ_WRITE_CREATE ) ) throw lang::IllegalArgumentException( - OUString( - "Invalid open mode!" ), + "Invalid open mode!", uno::Reference< uno::XInterface >(), sal_Int16( 2 ) ); @@ -94,8 +93,7 @@ StorageElementFactory::createStorage( const OUString & rUri, if ( aUri.isRoot() ) { throw lang::IllegalArgumentException( - OUString( - "Root never has a storage!" ), + "Root never has a storage!", uno::Reference< uno::XInterface >(), sal_Int16( 1 ) ); } @@ -369,14 +367,12 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( { if ( eMode == READ_WRITE_CREATE ) throw lang::IllegalArgumentException( - OUString( - "Invalid open mode: document storages cannot be " - "created!" ), + "Invalid open mode: document storages cannot be created!", uno::Reference< uno::XInterface >(), sal_Int16( 2 ) ); else throw embed::InvalidStorageException( - OUString( "Invalid document id!" ), + "Invalid document id!", uno::Reference< uno::XInterface >() ); } @@ -432,8 +428,7 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( OSL_FAIL( "Property OpenMode not supported!" ); throw embed::StorageWrappedTargetException( - OUString( - "Bug! Value of property OpenMode has wrong type!" ), + "Bug! Value of property OpenMode has wrong type!", uno::Reference< uno::XInterface >(), uno::makeAny( e ) ); } @@ -442,8 +437,7 @@ uno::Reference< embed::XStorage > StorageElementFactory::queryStorage( OSL_FAIL( "Caught WrappedTargetException!" ); throw embed::StorageWrappedTargetException( - OUString( - "WrappedTargetException during getPropertyValue!" ), + "WrappedTargetException during getPropertyValue!", uno::Reference< uno::XInterface >(), uno::makeAny( e ) ); } @@ -500,8 +494,7 @@ StorageElementFactory::queryStream( if ( !xParentStorage.is() ) { throw lang::IllegalArgumentException( - OUString( - "No parent storage!" ), + "No parent storage!", uno::Reference< uno::XInterface >(), sal_Int16( 2 ) ); } @@ -510,16 +503,14 @@ StorageElementFactory::queryStream( if ( aUri.isRoot() ) { throw lang::IllegalArgumentException( - OUString( - "Root never is a stream!" ), + "Root never is a stream!", uno::Reference< uno::XInterface >(), sal_Int16( 2 ) ); } else if ( aUri.isDocument() ) { throw lang::IllegalArgumentException( - OUString( - "A document never is a stream!" ), + "A document never is a stream!", uno::Reference< uno::XInterface >(), sal_Int16( 2 ) ); } @@ -556,8 +547,7 @@ StorageElementFactory::queryStream( OSL_FAIL( "StorageElementFactory::queryStream : Unknown open mode!" ); throw embed::InvalidStorageException( - OUString( - "Unknown open mode!" ), + "Unknown open mode!", uno::Reference< uno::XInterface >() ); } @@ -613,8 +603,7 @@ StorageElementFactory::queryStream( if ( !xStream.is() ) { throw embed::InvalidStorageException( - OUString( - "No stream!" ), + "No stream!", uno::Reference< uno::XInterface >() ); } diff --git a/ucb/source/ucp/webdav-neon/webdavcontent.cxx b/ucb/source/ucp/webdav-neon/webdavcontent.cxx index 3b332fa36ce7..1279eaa2a85e 100644 --- a/ucb/source/ucp/webdav-neon/webdavcontent.cxx +++ b/ucb/source/ucp/webdav-neon/webdavcontent.cxx @@ -508,7 +508,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -528,7 +528,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -539,7 +539,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "No properties!" ), + "No properties!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -579,7 +579,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -609,7 +609,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -673,7 +673,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -693,7 +693,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -742,7 +742,7 @@ uno::Any SAL_CALL Content::execute( { ucbhelper::cancelCommandExecution( uno::makeAny( lang::IllegalArgumentException( - OUString( "Wrong argument type!" ), + "Wrong argument type!", static_cast< cppu::OWeakObject * >( this ), -1 ) ), Environment ); @@ -1819,7 +1819,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); continue; } @@ -1832,21 +1832,21 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName == "IsDocument" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName == "IsFolder" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName == "Title" ) @@ -1879,7 +1879,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( catch ( DAVException const & ) { aRet[ n ] <<= lang::IllegalArgumentException( - OUString( "Invalid content identifier!" ), + "Invalid content identifier!", static_cast< cppu::OWeakObject * >( this ), -1 ); } @@ -1887,7 +1887,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= lang::IllegalArgumentException( - OUString( "Empty title not allowed!" ), + "Empty title not allowed!", static_cast< cppu::OWeakObject * >( this ), -1 ); } @@ -1895,7 +1895,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= beans::IllegalTypeException( - OUString( "Property value has wrong type!" ), + "Property value has wrong type!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -1920,7 +1920,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // PROPPATCH::set would add the property automatically, which // is not allowed for "setPropertyValues" command! aRet[ n ] <<= beans::UnknownPropertyException( - OUString( "Property is unknown!" ), + "Property is unknown!", static_cast< cppu::OWeakObject * >( this ) ); continue; } @@ -1929,21 +1929,21 @@ uno::Sequence< uno::Any > Content::setPropertyValues( { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName == "DateCreated" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName == "DateModified" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else if ( rName == "MediaType" ) @@ -1951,14 +1951,14 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // Read-only property! // (but could be writable, if 'getcontenttype' would be) aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } if ( rName == "CreatableContentsInfo" ) { // Read-only property! aRet[ n ] <<= lang::IllegalAccessException( - OUString( "Property is read-only!" ), + "Property is read-only!", static_cast< cppu::OWeakObject * >( this ) ); } else @@ -2023,7 +2023,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( else { aRet[ n ] <<= uno::Exception( - OUString( "No property set for storing the value!" ), + "No property set for storing the value!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -2122,7 +2122,7 @@ uno::Sequence< uno::Any > Content::setPropertyValues( // Set error . aRet[ nTitlePos ] <<= uno::Exception( - OUString("Exchange failed!"), + "Exchange failed!", static_cast< cppu::OWeakObject * >( this ) ); } } @@ -2551,7 +2551,7 @@ void Content::insert( if ( !bTransient || !bCollection ) { ucb::UnsupportedNameClashException aEx( - OUString( "Unable to write without overwrite!" ), + "Unable to write without overwrite!", static_cast< cppu::OWeakObject * >( this ), ucb::NameClash::ERROR ); @@ -2596,7 +2596,7 @@ void Content::insert( SAL_WARN( "ucb.ucp.webdav", "Content::insert - " "Unknown interaction selection!" ); throw ucb::CommandFailedException( - OUString( "Unknown interaction selection!" ), + "Unknown interaction selection!", uno::Reference< uno::XInterface >(), aExAsAny ); // break; @@ -2813,7 +2813,7 @@ void Content::transfer( ucbhelper::cancelCommandExecution( uno::makeAny( ucb::InteractiveBadTransferURLException( - OUString( "Unsupported URL scheme!" ), + "Unsupported URL scheme!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable @@ -2845,7 +2845,7 @@ void Content::transfer( { ucbhelper::cancelCommandExecution( uno::makeAny( ucb::InteractiveBadTransferURLException( - OUString( "Different hosts!" ), + "Different hosts!", static_cast< cppu::OWeakObject * >( this ) ) ), Environment ); // Unreachable @@ -3294,7 +3294,7 @@ void Content::lock( << m_xIdentifier->getContentIdentifier() << ">"); throw ucb::InteractiveLockingLockedException( - OUString( "Locked!" ), + "Locked!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, aURL, @@ -3317,7 +3317,7 @@ void Content::lock( // since it mostly happens on read/only part of webdav, this appears to be the most correct exception available throw ucb::InteractiveNetworkWriteException( - OUString( "Authentication error while trying to lock! Write only WebDAV perhaps?" ), + "Authentication error while trying to lock! Write only WebDAV perhaps?", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, e.getData() ); @@ -3580,7 +3580,7 @@ uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) aException <<= ucb::InteractiveAugmentedIOException( - OUString("Not found!"), + "Not found!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, ucb::IOErrorCode_NOT_EXISTING, @@ -3658,7 +3658,7 @@ uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) case DAVException::DAV_LOCKED: aException <<= ucb::InteractiveLockingLockedException( - OUString("Locked!"), + "Locked!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, aURL, @@ -3668,7 +3668,7 @@ uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) case DAVException::DAV_LOCKED_SELF: aException <<= ucb::InteractiveLockingLockedException( - OUString("Locked (self!)"), + "Locked (self!)", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, aURL, @@ -3678,7 +3678,7 @@ uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) case DAVException::DAV_NOT_LOCKED: aException <<= ucb::InteractiveLockingNotLockedException( - OUString("Not locked!"), + "Not locked!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, aURL ); @@ -3687,7 +3687,7 @@ uno::Any Content::MapDAVException( const DAVException & e, bool bWrite ) case DAVException::DAV_LOCK_EXPIRED: aException <<= ucb::InteractiveLockingLockExpiredException( - OUString("Lock expired!"), + "Lock expired!", static_cast< cppu::OWeakObject * >( this ), task::InteractionClassification_ERROR, aURL ); diff --git a/ucbhelper/source/client/content.cxx b/ucbhelper/source/client/content.cxx index d1e7feb3b6dc..cdf39ef5bc78 100644 --- a/ucbhelper/source/client/content.cxx +++ b/ucbhelper/source/client/content.cxx @@ -506,9 +506,8 @@ Sequence< Any > Content::setPropertyValues( { ucbhelper::cancelCommandExecution( makeAny( IllegalArgumentException( - OUString( - "Length of property names sequence and value " - "sequence are unequal!" ), + "Length of property names sequence and value " + "sequence are unequal!", get(), -1 ) ), m_xImpl->getEnvironment() ); @@ -1013,8 +1012,7 @@ bool Content::isFolder() ucbhelper::cancelCommandExecution( makeAny( UnknownPropertyException( - OUString( - "Unable to retrieve value of property 'IsFolder'!" ), + "Unable to retrieve value of property 'IsFolder'!", get() ) ), m_xImpl->getEnvironment() ); @@ -1037,8 +1035,7 @@ bool Content::isDocument() ucbhelper::cancelCommandExecution( makeAny( UnknownPropertyException( - OUString( - "Unable to retrieve value of property 'IsDocument'!" ), + "Unable to retrieve value of property 'IsDocument'!", get() ) ), m_xImpl->getEnvironment() ); diff --git a/unoxml/source/rdf/CBlankNode.cxx b/unoxml/source/rdf/CBlankNode.cxx index 5d687876d223..b9a41668fdc8 100644 --- a/unoxml/source/rdf/CBlankNode.cxx +++ b/unoxml/source/rdf/CBlankNode.cxx @@ -83,15 +83,13 @@ void SAL_CALL CBlankNode::initialize(const css::uno::Sequence< css::uno::Any > & { if (aArguments.getLength() != 1) { throw css::lang::IllegalArgumentException( - OUString("CBlankNode::initialize: " - "must give exactly 1 argument"), *this, 1); + "CBlankNode::initialize: must give exactly 1 argument", *this, 1); } OUString arg; if (!(aArguments[0] >>= arg)) { throw css::lang::IllegalArgumentException( - OUString("CBlankNode::initialize: " - "argument must be string"), *this, 0); + "CBlankNode::initialize: argument must be string", *this, 0); } //FIXME: what is legal? @@ -99,8 +97,7 @@ void SAL_CALL CBlankNode::initialize(const css::uno::Sequence< css::uno::Any > & m_NodeID = arg; } else { throw css::lang::IllegalArgumentException( - OUString("CBlankNode::initialize: " - "argument is not valid blank node ID"), *this, 0); + "CBlankNode::initialize: argument is not valid blank node ID", *this, 0); } } diff --git a/unoxml/source/rdf/CLiteral.cxx b/unoxml/source/rdf/CLiteral.cxx index 6643df240acd..fc1b2044ec3d 100644 --- a/unoxml/source/rdf/CLiteral.cxx +++ b/unoxml/source/rdf/CLiteral.cxx @@ -93,23 +93,20 @@ void SAL_CALL CLiteral::initialize(const css::uno::Sequence< css::uno::Any > & a const sal_Int32 len( aArguments.getLength() ); if (len < 1 || len > 2) { throw css::lang::IllegalArgumentException( - OUString("CLiteral::initialize: " - "must give 1 or 2 argument(s)"), *this, 2); + "CLiteral::initialize: must give 1 or 2 argument(s)", *this, 2); } OUString arg0; if (!(aArguments[0] >>= arg0)) { throw css::lang::IllegalArgumentException( - OUString("CLiteral::initialize: " - "argument must be string"), *this, 0); + "CLiteral::initialize: argument must be string", *this, 0); } //FIXME: what is legal? if (true) { m_Value = arg0; } else { throw css::lang::IllegalArgumentException( - OUString("CLiteral::initialize: " - "argument is not valid literal value"), *this, 0); + "CLiteral::initialize: argument is not valid literal value", *this, 0); } if (len > 1) { @@ -120,21 +117,18 @@ void SAL_CALL CLiteral::initialize(const css::uno::Sequence< css::uno::Any > & a m_Language = arg1; } else { throw css::lang::IllegalArgumentException( - OUString("CLiteral::initialize: " - "argument is not valid language"), *this, 1); + "CLiteral::initialize: argument is not valid language", *this, 1); } } else if ((aArguments[1] >>= xURI)) { if (xURI.is()) { m_xDatatype = xURI; } else { throw css::lang::IllegalArgumentException( - OUString("CLiteral::initialize: " - "argument is null"), *this, 1); + "CLiteral::initialize: argument is null", *this, 1); } } else { throw css::lang::IllegalArgumentException( - OUString("CLiteral::initialize: " - "argument must be string or URI"), *this, 1); + "CLiteral::initialize: argument must be string or URI", *this, 1); } } } diff --git a/unoxml/source/rdf/CURI.cxx b/unoxml/source/rdf/CURI.cxx index 0a6d903b1088..2b45f65a77d2 100644 --- a/unoxml/source/rdf/CURI.cxx +++ b/unoxml/source/rdf/CURI.cxx @@ -700,8 +700,7 @@ void SAL_CALL CURI::initFromConstant(const sal_Int16 i_Constant) default: throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "invalid URIs constant argument"), *this, 0); + "CURI::initialize: invalid URIs constant argument", *this, 0); } m_Namespace = OUString::createFromAscii(ns).intern(); m_LocalName = OUString::createFromAscii(ln).intern(); @@ -714,8 +713,7 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< css::uno::Any > & aArgu sal_Int32 len = aArguments.getLength(); if ((len < 1) || (len > 2)) { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "must give 1 or 2 argument(s)"), *this, 2); + "CURI::initialize: must give 1 or 2 argument(s)", *this, 2); } sal_Int16 arg(0); @@ -725,22 +723,19 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< css::uno::Any > & aArgu // integer argument: constant from rdf::URIs if (len != 1) { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "must give 1 int argument"), *this, 1); + "CURI::initialize: must give 1 int argument", *this, 1); } initFromConstant(arg); return; } if (!(aArguments[0] >>= arg0)) { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "argument must be string or short"), *this, 0); + "CURI::initialize: argument must be string or short", *this, 0); } if (len > 1) { if (!(aArguments[1] >>= arg1)) { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "argument must be string"), *this, 1); + "CURI::initialize: argument must be string", *this, 1); } // just append the parameters and then split them again; seems simplest arg0 = arg0 + arg1; @@ -760,8 +755,7 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< css::uno::Any > & aArgu } } else { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "argument not splittable: no separator [#/:]"), *this, 0); + "CURI::initialize: argument not splittable: no separator [#/:]", *this, 0); } //FIXME: what is legal? @@ -769,16 +763,14 @@ void SAL_CALL CURI::initialize(const css::uno::Sequence< css::uno::Any > & aArgu m_Namespace = arg0; } else { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "argument is not valid namespace"), *this, 0); + "CURI::initialize: argument is not valid namespace", *this, 0); } //FIXME: what is legal? if (true) { m_LocalName = arg1; } else { throw css::lang::IllegalArgumentException( - OUString("CURI::initialize: " - "argument is not valid local name"), *this, 1); + "CURI::initialize: argument is not valid local name", *this, 1); } } diff --git a/vcl/source/gdi/virdev.cxx b/vcl/source/gdi/virdev.cxx index fbd59bdb83b4..06560be47f08 100644 --- a/vcl/source/gdi/virdev.cxx +++ b/vcl/source/gdi/virdev.cxx @@ -148,7 +148,7 @@ void VirtualDevice::ImplInitVirDev( const OutputDevice* pOutDev, { // do not abort but throw an exception, may be the current thread terminates anyway (plugin-scenario) throw css::uno::RuntimeException( - OUString( "Could not create system bitmap!" ), + "Could not create system bitmap!", css::uno::Reference< css::uno::XInterface >() ); } diff --git a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx index 541f640484d2..50a28ab9f477 100644 --- a/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx +++ b/vcl/unx/gtk/fpicker/SalGtkFilePicker.cxx @@ -1545,7 +1545,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu uno::Any aAny; if( 0 == aArguments.getLength() ) throw lang::IllegalArgumentException( - OUString( "no arguments" ), + "no arguments", static_cast<XFilePicker2*>( this ), 1 ); aAny = aArguments[0]; @@ -1553,7 +1553,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu if( ( aAny.getValueType() != cppu::UnoType<sal_Int16>::get()) && (aAny.getValueType() != cppu::UnoType<sal_Int8>::get()) ) throw lang::IllegalArgumentException( - OUString( "invalid argument type" ), + "invalid argument type", static_cast<XFilePicker2*>( this ), 1 ); sal_Int16 templateId = -1; @@ -1648,7 +1648,7 @@ void SAL_CALL SalGtkFilePicker::initialize( const uno::Sequence<uno::Any>& aArgu break; default: throw lang::IllegalArgumentException( - OUString( "Unknown template" ), + "Unknown template", static_cast< XFilePicker2* >( this ), 1 ); } diff --git a/xmloff/source/meta/MetaImportComponent.cxx b/xmloff/source/meta/MetaImportComponent.cxx index 98fe47608ca3..2ba733d1abc0 100644 --- a/xmloff/source/meta/MetaImportComponent.cxx +++ b/xmloff/source/meta/MetaImportComponent.cxx @@ -77,9 +77,9 @@ SvXMLImportContext* XMLMetaImportComponent::CreateContext( IsXMLToken(rLocalName, XML_DOCUMENT_META) ) { if (!mxDocProps.is()) { - throw uno::RuntimeException(OUString( + throw uno::RuntimeException( "XMLMetaImportComponent::CreateContext: setTargetDocument " - "has not been called"), *this); + "has not been called", *this); } return new SvXMLMetaDocumentContext( *this, nPrefix, rLocalName, mxDocProps); @@ -95,9 +95,9 @@ void SAL_CALL XMLMetaImportComponent::setTargetDocument( { mxDocProps.set( xDoc, uno::UNO_QUERY ); if( !mxDocProps.is() ) - throw lang::IllegalArgumentException(OUString( + throw lang::IllegalArgumentException( "XMLMetaImportComponent::setTargetDocument: argument is no " - "XDocumentProperties"), uno::Reference<uno::XInterface>(*this), 0); + "XDocumentProperties", uno::Reference<uno::XInterface>(*this), 0); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmloff/source/meta/xmlmetai.cxx b/xmloff/source/meta/xmlmetai.cxx index 459f3cfd7c8f..82e2d8e4c979 100644 --- a/xmloff/source/meta/xmlmetai.cxx +++ b/xmloff/source/meta/xmlmetai.cxx @@ -116,9 +116,8 @@ lcl_initDocumentProperties(SvXMLImport & rImport, throw; } catch (const uno::Exception& e) { throw lang::WrappedTargetRuntimeException( - OUString( - "SvXMLMetaDocumentContext::initDocumentProperties: " - "properties init exception"), + "SvXMLMetaDocumentContext::initDocumentProperties: " + "properties init exception", rImport, makeAny(e)); } } diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx index f37993e2bd91..49878a0bffb3 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_impmodels.cxx @@ -224,9 +224,7 @@ Reference< xml::input::XElement > ProgressBarElement::startChildElement( } else { - throw xml::sax::SAXException( - OUString( "expected event element!" ), - Reference< XInterface >(), Any() ); + throw xml::sax::SAXException( "expected event element!", Reference< XInterface >(), Any() ); } } void ProgressBarElement::endElement() diff --git a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx index e9d2b67505b7..09afb0b4851d 100644 --- a/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx +++ b/xmlscript/source/xmldlg_imexp/xmldlg_import.cxx @@ -1371,8 +1371,7 @@ bool ImportContext::importImageScaleModeProperty( } else { - throw xml::sax::SAXException( - OUString( "invalid scale image mode value!" ), + throw xml::sax::SAXException( "invalid scale image mode value!", Reference< XInterface >(), Any() ); } diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index afe09b97b1c1..1955bd3d5d80 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -91,13 +91,13 @@ namespace m_nODF = nTmp; else throw uno::RuntimeException( - OUString("[xmlsecurity]SaveODFItem::SaveODFItem(): Wrong Type!"), + "[xmlsecurity]SaveODFItem::SaveODFItem(): Wrong Type!", nullptr ); } else throw uno::RuntimeException( - OUString("[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion"), + "[xmlsecurity] Could not open property Office.Common/Save/ODF/DefaultVersion", nullptr); } } |