diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-27 16:09:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-01-28 09:22:55 +0000 |
commit | f1d83ac45f08270f7f2dd7128056effd0251dc5e (patch) | |
tree | 55d924eaa7f55627039d44458d869ef65130fdf8 /framework | |
parent | 53d3755972bfd3bd2cd650edf91f1483038028c8 (diff) |
loplugin:stringconstant check for unnecessary OUString constructor..
..calls when creating exceptions
Change-Id: I3bc58a5aa4dc6f0508ecb88b3a843b96b8c7ebfe
Reviewed-on: https://gerrit.libreoffice.org/33617
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'framework')
8 files changed, 38 insertions, 38 deletions
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); } } |