summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-05-26 16:59:44 +0200
committerNoel Grandin <noel@peralex.com>2014-05-27 08:20:12 +0200
commit0f2824b117b65bd9c9db2870edc159419ae0c1d9 (patch)
tree2e45a7d5e0d60b97bf989fd21c0ae35392ba5823
parent9af0abebfd61641c9d028505caa864cdf898e35b (diff)
remove more unnecessary use of OUString constructor
Change-Id: Iae14cb3df65295b6894fd9e05411c5698e9c8aba
-rw-r--r--basic/source/uno/namecont.cxx2
-rw-r--r--comphelper/source/container/enumerablemap.cxx6
-rw-r--r--comphelper/source/property/propertybag.cxx8
-rw-r--r--framework/source/fwe/helper/propertysetcontainer.cxx4
-rw-r--r--framework/source/fwe/helper/undomanagerhelper.cxx6
-rw-r--r--framework/source/fwi/uielement/rootitemcontainer.cxx6
-rw-r--r--scripting/source/dlgprov/dlgprov.cxx10
-rw-r--r--sfx2/source/doc/DocumentMetadataAccess.cxx150
-rw-r--r--sfx2/source/doc/sfxbasemodel.cxx48
-rw-r--r--stoc/source/javaloader/javaloader.cxx10
-rw-r--r--svtools/source/uno/genericunodialog.cxx2
-rw-r--r--svtools/source/uno/wizard/unowizard.cxx2
-rw-r--r--toolkit/source/controls/tabpagecontainer.cxx3
-rw-r--r--unoxml/source/dom/attributesmap.cxx16
14 files changed, 119 insertions, 154 deletions
diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 924c48886887..e7cf8f34d11c 100644
--- a/basic/source/uno/namecont.cxx
+++ b/basic/source/uno/namecont.cxx
@@ -3120,7 +3120,7 @@ void SfxLibrary::impl_checkReadOnly()
if( mbReadOnly || (mbLink && mbReadOnlyLink) )
{
throw IllegalArgumentException(
- OUString("Library is readonly."),
+ "Library is readonly.",
// TODO: resource
*this, 0
);
diff --git a/comphelper/source/container/enumerablemap.cxx b/comphelper/source/container/enumerablemap.cxx
index b2e7def199fb..7dc2df10c93e 100644
--- a/comphelper/source/container/enumerablemap.cxx
+++ b/comphelper/source/container/enumerablemap.cxx
@@ -509,7 +509,7 @@ namespace comphelper
if ( _keyOrValue >>= nValue )
if ( ::rtl::math::isNan( nValue ) )
throw IllegalArgumentException(
- OUString( "NaN (not-a-number) not supported by this implementation." ),
+ "NaN (not-a-number) not supported by this implementation.",
*const_cast< EnumerableMap* >( this ), 0 );
// (note that the case of _key not containing a float/double value is handled in the
// respective IKeyPredicateLess implementation, so there's no need to handle this here.)
@@ -521,7 +521,7 @@ namespace comphelper
{
if ( !_key.hasValue() )
throw IllegalArgumentException(
- OUString( "NULL keys not supported by this implementation." ),
+ "NULL keys not supported by this implementation.",
*const_cast< EnumerableMap* >( this ), 0 );
impl_checkNaN_throw( _key, m_aData.m_aKeyType );
@@ -532,7 +532,7 @@ namespace comphelper
{
if ( !m_aData.m_bMutable )
throw NoSupportException(
- OUString( "The map is immutable." ),
+ "The map is immutable.",
*const_cast< EnumerableMap* >( this ) );
}
diff --git a/comphelper/source/property/propertybag.cxx b/comphelper/source/property/propertybag.cxx
index f751bbc7c05f..78e6a65bf3fc 100644
--- a/comphelper/source/property/propertybag.cxx
+++ b/comphelper/source/property/propertybag.cxx
@@ -81,7 +81,7 @@ namespace comphelper
{
if ( !_allowEmpty && _name.isEmpty() )
throw IllegalArgumentException(
- OUString( "The property name must not be empty." ),
+ "The property name must not be empty.",
// TODO: resource
NULL,
1
@@ -92,7 +92,7 @@ namespace comphelper
{
if ( _container.hasPropertyByName( _name ) || _container.hasPropertyByHandle( _handle ) )
throw PropertyExistException(
- OUString( "Property name or handle already used." ),
+ "Property name or handle already used.",
// TODO: resource
NULL );
@@ -104,7 +104,7 @@ namespace comphelper
{
if ( _rType.getTypeClass() == TypeClass_VOID )
throw IllegalArgumentException(
- OUString( "Illegal property type: VOID" ),
+ "Illegal property type: VOID",
// TODO: resource
NULL,
1
@@ -129,7 +129,7 @@ namespace comphelper
Type aPropertyType = _rInitialValue.getValueType();
if ( aPropertyType.getTypeClass() == TypeClass_VOID )
throw IllegalTypeException(
- OUString( "The initial value must be non-NULL to determine the property type." ),
+ "The initial value must be non-NULL to determine the property type.",
// TODO: resource
NULL );
diff --git a/framework/source/fwe/helper/propertysetcontainer.cxx b/framework/source/fwe/helper/propertysetcontainer.cxx
index e659c03bb90d..8284460e1483 100644
--- a/framework/source/fwe/helper/propertysetcontainer.cxx
+++ b/framework/source/fwe/helper/propertysetcontainer.cxx
@@ -97,7 +97,7 @@ void SAL_CALL PropertySetContainer::insertByIndex( sal_Int32 Index, const ::com:
else
{
throw IllegalArgumentException(
- OUString( WRONG_TYPE_EXCEPTION ),
+ WRONG_TYPE_EXCEPTION,
(OWeakObject *)this, 2 );
}
}
@@ -133,7 +133,7 @@ void SAL_CALL PropertySetContainer::replaceByIndex( sal_Int32 Index, const ::com
else
{
throw IllegalArgumentException(
- OUString( WRONG_TYPE_EXCEPTION ),
+ WRONG_TYPE_EXCEPTION,
(OWeakObject *)this, 2 );
}
}
diff --git a/framework/source/fwe/helper/undomanagerhelper.cxx b/framework/source/fwe/helper/undomanagerhelper.cxx
index 3f06ee7bb41b..1d4f13aabfb6 100644
--- a/framework/source/fwe/helper/undomanagerhelper.cxx
+++ b/framework/source/fwe/helper/undomanagerhelper.cxx
@@ -395,7 +395,7 @@ namespace framework
{
if ( !i_action.is() )
throw IllegalArgumentException(
- OUString( "illegal undo action object" ),
+ "illegal undo action object",
getXUndoManager(),
1
);
@@ -545,7 +545,7 @@ namespace framework
if ( i_hidden && ( rUndoManager.GetUndoActionCount( IUndoManager::CurrentLevel ) == 0 ) )
throw EmptyUndoStackException(
- OUString( "can't enter a hidden context without a previous Undo action" ),
+ "can't enter a hidden context without a previous Undo action",
m_rUndoManagerImplementation.getThis()
);
@@ -576,7 +576,7 @@ namespace framework
if ( !rUndoManager.IsInListAction() )
throw InvalidStateException(
- OUString( "no active undo context" ),
+ "no active undo context",
getXUndoManager()
);
diff --git a/framework/source/fwi/uielement/rootitemcontainer.cxx b/framework/source/fwi/uielement/rootitemcontainer.cxx
index b7a914139584..e09e840028f5 100644
--- a/framework/source/fwi/uielement/rootitemcontainer.cxx
+++ b/framework/source/fwi/uielement/rootitemcontainer.cxx
@@ -210,8 +210,7 @@ throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetExcept
throw IndexOutOfBoundsException( OUString(), (OWeakObject *)this );
}
else
- throw IllegalArgumentException( OUString( WRONG_TYPE_EXCEPTION ),
- (OWeakObject *)this, 2 );
+ throw IllegalArgumentException( WRONG_TYPE_EXCEPTION, (OWeakObject *)this, 2 );
}
void SAL_CALL RootItemContainer::removeByIndex( sal_Int32 nIndex )
@@ -239,8 +238,7 @@ throw ( IllegalArgumentException, IndexOutOfBoundsException, WrappedTargetExcept
throw IndexOutOfBoundsException( OUString(), (OWeakObject *)this );
}
else
- throw IllegalArgumentException( OUString( WRONG_TYPE_EXCEPTION ),
- (OWeakObject *)this, 2 );
+ throw IllegalArgumentException( WRONG_TYPE_EXCEPTION, (OWeakObject *)this, 2 );
}
Reference< XInterface > SAL_CALL RootItemContainer::createInstanceWithContext( const Reference< XComponentContext >& )
diff --git a/scripting/source/dlgprov/dlgprov.cxx b/scripting/source/dlgprov/dlgprov.cxx
index 63178ad88e70..5960369ea0d2 100644
--- a/scripting/source/dlgprov/dlgprov.cxx
+++ b/scripting/source/dlgprov/dlgprov.cxx
@@ -425,21 +425,21 @@ static OUString aResourceResolverPropName("ResourceResolver");
if ( !xISP.is() )
{
throw IllegalArgumentException(
- OUString( "DialogProviderImpl::getDialogModel: dialog not found!" ),
+ "DialogProviderImpl::getDialogModel: dialog not found!",
Reference< XInterface >(), 1 );
}
}
else
{
throw IllegalArgumentException(
- OUString( "DialogProviderImpl::getDialogModel: library not found!" ),
+ "DialogProviderImpl::getDialogModel: library not found!",
Reference< XInterface >(), 1 );
}
}
else
{
throw IllegalArgumentException(
- OUString( "DialogProviderImpl::getDialog: library container not found!" ),
+ "DialogProviderImpl::getDialog: library container not found!",
Reference< XInterface >(), 1 );
}
@@ -733,7 +733,7 @@ static OUString aResourceResolverPropName("ResourceResolver");
if( !xHandler.is() )
{
throw IllegalArgumentException(
- OUString( "DialogProviderImpl::createDialogWithHandler: Invalid xHandler!" ),
+ "DialogProviderImpl::createDialogWithHandler: Invalid xHandler!",
Reference< XInterface >(), 1 );
}
Reference< XWindowPeer > xDummyPeer;
@@ -776,7 +776,7 @@ static OUString aResourceResolverPropName("ResourceResolver");
if( !xParent.is() )
{
throw IllegalArgumentException(
- OUString( "DialogProviderImpl::createContainerWindow: Invalid xParent!" ),
+ "DialogProviderImpl::createContainerWindow: Invalid xParent!",
Reference< XInterface >(), 1 );
}
Reference < XControl > xControl = DialogProviderImpl::createDialogImpl( URL, xHandler, xParent, false );
diff --git a/sfx2/source/doc/DocumentMetadataAccess.cxx b/sfx2/source/doc/DocumentMetadataAccess.cxx
index 2eb9b6c381b4..6c999dc88f72 100644
--- a/sfx2/source/doc/DocumentMetadataAccess.cxx
+++ b/sfx2/source/doc/DocumentMetadataAccess.cxx
@@ -317,8 +317,7 @@ addFile(struct DocumentMetadataAccess_Impl & i_rImpl,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
- "addFile: exception"), /*this*/0, uno::makeAny(e));
+ "addFile: exception", /*this*/0, uno::makeAny(e));
}
}
@@ -366,7 +365,7 @@ removeFile(struct DocumentMetadataAccess_Impl & i_rImpl,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString("removeFile: exception"),
+ "removeFile: exception",
0, uno::makeAny(e));
}
}
@@ -395,7 +394,7 @@ getAllParts(struct DocumentMetadataAccess_Impl & i_rImpl)
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString("getAllParts: exception"),
+ "getAllParts: exception",
0, uno::makeAny(e));
}
}
@@ -417,7 +416,7 @@ isPartOfType(struct DocumentMetadataAccess_Impl & i_rImpl,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString("isPartOfType: exception"),
+ "isPartOfType: exception",
0, uno::makeAny(e));
}
}
@@ -456,8 +455,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException,
const uno::Reference<task::XInteractionHandler> & i_xHandler)
{
if (!i_xHandler.is()) {
- throw lang::WrappedTargetException(OUString(
- "DocumentMetadataAccess::loadMetadataFromStorage: exception"),
+ throw lang::WrappedTargetException(
+ "DocumentMetadataAccess::loadMetadataFromStorage: exception",
/* *this*/ 0, uno::makeAny(i_rException));
}
@@ -480,8 +479,8 @@ handleError( ucb::InteractiveAugmentedIOException const & i_rException,
return false;
} else {
OSL_ENSURE(pAbort->wasSelected(), "no continuation selected?");
- throw lang::WrappedTargetException(OUString(
- "DocumentMetadataAccess::loadMetadataFromStorage: exception"),
+ throw lang::WrappedTargetException(
+ "DocumentMetadataAccess::loadMetadataFromStorage: exception",
/* *this*/ 0, uno::makeAny(i_rException));
}
}
@@ -537,8 +536,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
i_rImpl.m_xRepository->importGraph(rdf::FileFormat::RDF_XML,
xInStream, xURI, xBaseURI);
} else {
- throw mkException(OUString(
- "readStream: is not a stream"),
+ throw mkException(
+ "readStream: is not a stream",
ucb::IOErrorCode_NO_FILE, i_rBaseURI + i_rPath, i_rPath);
}
} else {
@@ -564,8 +563,8 @@ readStream(struct DocumentMetadataAccess_Impl & i_rImpl,
buf.append(dir).append('/');
readStream(i_rImpl, xDir, rest, buf.makeStringAndClear() );
} else {
- throw mkException(OUString(
- "readStream: is not a directory"),
+ throw mkException(
+ "readStream: is not a directory",
ucb::IOErrorCode_NO_DIRECTORY, i_rBaseURI + dir, dir);
}
}
@@ -598,7 +597,7 @@ retry:
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString("importFile: exception"),
+ "importFile: exception",
0, uno::makeAny(e));
}
}
@@ -765,7 +764,7 @@ static void init(struct DocumentMetadataAccess_Impl & i_rImpl)
getURI<rdf::URIs::PKG_DOCUMENT>(i_rImpl.m_xContext).get());
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString("init: unexpected exception"), 0,
+ "init: unexpected exception", 0,
uno::makeAny(e));
}
@@ -852,8 +851,8 @@ throw (uno::RuntimeException, std::exception)
const IXmlIdRegistry * pReg(
m_pImpl->m_rXmlIdRegistrySupplier.GetXmlIdRegistry() );
if (!pReg) {
- throw uno::RuntimeException(OUString(
- "DocumentMetadataAccess::getElementByXmlId: no registry"), *this);
+ throw uno::RuntimeException(
+ "DocumentMetadataAccess::getElementByXmlId: no registry", *this);
}
return pReg->GetElementByMetadataReference(i_rReference);
}
@@ -864,8 +863,8 @@ DocumentMetadataAccess::getElementByURI(
throw (uno::RuntimeException, lang::IllegalArgumentException, std::exception)
{
if (!i_xURI.is()) {
- throw lang::IllegalArgumentException(OUString(
- "DocumentMetadataAccess::getElementByURI: URI is null"), *this, 0);
+ throw lang::IllegalArgumentException(
+ "DocumentMetadataAccess::getElementByURI: URI is null", *this, 0);
}
const OUString baseURI( m_pImpl->m_xBaseURI->getStringValue() );
@@ -890,9 +889,9 @@ DocumentMetadataAccess::getMetadataGraphsWithType(
throw (uno::RuntimeException, lang::IllegalArgumentException, std::exception)
{
if (!i_xType.is()) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::getMetadataGraphsWithType: "
- "type is null"), *this, 0);
+ "type is null", *this, 0);
}
::comphelper::SequenceAsVector< uno::Reference< rdf::XURI > > ret;
@@ -913,21 +912,20 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException, std::exception)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
- "DocumentMetadataAccess::addMetadataFile: invalid FileName"),
+ throw lang::IllegalArgumentException(
+ "DocumentMetadataAccess::addMetadataFile: invalid FileName",
*this, 0);
}
if (isReservedFile(i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::addMetadataFile:"
- "invalid FileName: reserved"), *this, 0);
+ "invalid FileName: reserved", *this, 0);
}
for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) {
if (!i_rTypes[i].is()) {
throw lang::IllegalArgumentException(
- OUString(
"DocumentMetadataAccess::addMetadataFile: "
- "null type"), *this, 2);
+ "null type", *this, 2);
}
}
@@ -938,8 +936,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
m_pImpl->m_xRepository->createGraph(xGraphName);
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
- "DocumentMetadataAccess::addMetadataFile: exception"),
+ "DocumentMetadataAccess::addMetadataFile: exception",
*this, uno::makeAny(e));
// note: all other exceptions are propagated
}
@@ -959,20 +956,19 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException, rdf::ParseException, io::IOException, std::exception)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
- "DocumentMetadataAccess::importMetadataFile: invalid FileName"),
+ throw lang::IllegalArgumentException(
+ "DocumentMetadataAccess::importMetadataFile: invalid FileName",
*this, 0);
}
if (isReservedFile(i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::importMetadataFile:"
- "invalid FileName: reserved"), *this, 0);
+ "invalid FileName: reserved", *this, 0);
}
for (sal_Int32 i = 0; i < i_rTypes.getLength(); ++i) {
if (!i_rTypes[i].is()) {
throw lang::IllegalArgumentException(
- OUString(
- "DocumentMetadataAccess::importMetadataFile: null type"),
+ "DocumentMetadataAccess::importMetadataFile: null type",
*this, 5);
}
}
@@ -985,9 +981,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
i_Format, i_xInStream, xGraphName, i_xBaseURI);
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
"DocumentMetadataAccess::importMetadataFile: "
- "RepositoryException"), *this, uno::makeAny(e));
+ "RepositoryException", *this, uno::makeAny(e));
// note: all other exceptions are propagated
}
@@ -1006,9 +1001,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
m_pImpl->m_xRepository->destroyGraph(i_xGraphName);
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
"DocumentMetadataAccess::removeMetadataFile: "
- "RepositoryException"), *this, uno::makeAny(e));
+ "RepositoryException", *this, uno::makeAny(e));
// note: all other exceptions are propagated
}
@@ -1023,15 +1017,15 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::ElementExistException, std::exception)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::addContentOrStylesFile: "
- "invalid FileName"), *this, 0);
+ "invalid FileName", *this, 0);
}
if (!addContentOrStylesFileImpl(*m_pImpl, i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::addContentOrStylesFile: "
- "invalid FileName: must end with content.xml or styles.xml"),
+ "invalid FileName: must end with content.xml or styles.xml",
*this, 0);
}
}
@@ -1043,9 +1037,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
container::NoSuchElementException, std::exception)
{
if (!isFileNameValid(i_rFileName)) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::removeContentOrStylesFile: "
- "invalid FileName"), *this, 0);
+ "invalid FileName", *this, 0);
}
try {
@@ -1058,9 +1052,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
uno::UNO_SET_THROW);
if (!xEnum->hasMoreElements()) {
throw container::NoSuchElementException(
- OUString(
- "DocumentMetadataAccess::removeContentOrStylesFile: "
- "cannot find stream in manifest graph: ") + i_rFileName,
+ "DocumentMetadataAccess::removeContentOrStylesFile: "
+ "cannot find stream in manifest graph: " + i_rFileName,
*this);
}
@@ -1071,8 +1064,7 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
- "DocumentMetadataAccess::removeContentOrStylesFile: exception"),
+ "DocumentMetadataAccess::removeContentOrStylesFile: exception",
*this, uno::makeAny(e));
}
}
@@ -1085,25 +1077,25 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException, std::exception)
{
if (!i_xStorage.is()) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "storage is null"), *this, 0);
+ "storage is null", *this, 0);
}
if (!i_xBaseURI.is()) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "base URI is null"), *this, 1);
+ "base URI is null", *this, 1);
}
const OUString baseURI( i_xBaseURI->getStringValue());
if (baseURI.indexOf('#') >= 0) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "base URI not absolute"), *this, 1);
+ "base URI not absolute", *this, 1);
}
if (baseURI.isEmpty() || !baseURI.endsWithAsciiL("/", 1)) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "base URI does not end with slash"), *this, 1);
+ "base URI does not end with slash", *this, 1);
}
initLoading(*m_pImpl, i_xStorage, i_xBaseURI, i_xHandler);
@@ -1177,9 +1169,8 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
"DocumentMetadataAccess::loadMetadataFromStorage: "
- "exception"), *this, uno::makeAny(e));
+ "exception", *this, uno::makeAny(e));
}
std::for_each(StgFiles.begin(), StgFiles.end(),
@@ -1196,9 +1187,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
lang::WrappedTargetException, std::exception)
{
if (!i_xStorage.is()) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::storeMetadataToStorage: "
- "storage is null"), *this, 0);
+ "storage is null", *this, 0);
}
// export manifest
@@ -1212,12 +1203,11 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
} catch (const uno::RuntimeException &) {
throw;
} catch (const io::IOException & e) {
- throw lang::WrappedTargetException( OUString(
- "storeMetadataToStorage: IO exception"), *this, uno::makeAny(e));
+ throw lang::WrappedTargetException(
+ "storeMetadataToStorage: IO exception", *this, uno::makeAny(e));
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
- "storeMetadataToStorage: exception"), *this, uno::makeAny(e));
+ "storeMetadataToStorage: exception", *this, uno::makeAny(e));
}
// export metadata streams
@@ -1250,20 +1240,17 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const io::IOException & e) {
throw lang::WrappedTargetException(
- OUString(
- "storeMetadataToStorage: IO exception"),
+ "storeMetadataToStorage: IO exception",
*this, uno::makeAny(e));
} catch (const uno::Exception & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
- "storeMetadataToStorage: exception"),
+ "storeMetadataToStorage: exception",
*this, uno::makeAny(e));
}
}
} catch (const rdf::RepositoryException & e) {
throw lang::WrappedTargetRuntimeException(
- OUString(
- "storeMetadataToStorage: exception"), *this, uno::makeAny(e));
+ "storeMetadataToStorage: exception", *this, uno::makeAny(e));
}
}
@@ -1283,9 +1270,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
md[ utl::MediaDescriptor::PROP_INPUTSTREAM() ] >>= xIn;
}
if (!xIn.is() && URL.isEmpty()) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::loadMetadataFromMedium: "
- "inalid medium: no URL, no input stream"), *this, 0);
+ "inalid medium: no URL, no input stream", *this, 0);
}
uno::Reference<embed::XStorage> xStorage;
try {
@@ -1302,14 +1289,13 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
throw;
} catch (const uno::Exception & e) {
throw lang::WrappedTargetException(
- OUString(
"DocumentMetadataAccess::loadMetadataFromMedium: "
- "exception"), *this, uno::makeAny(e));
+ "exception", *this, uno::makeAny(e));
}
if (!xStorage.is()) {
- throw uno::RuntimeException(OUString(
+ throw uno::RuntimeException(
"DocumentMetadataAccess::loadMetadataFromMedium: "
- "cannot get Storage"), *this);
+ "cannot get Storage", *this);
}
uno::Reference<rdf::XURI> xBaseURI;
try {
@@ -1337,9 +1323,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
OUString URL;
md[ utl::MediaDescriptor::PROP_URL() ] >>= URL;
if (URL.isEmpty()) {
- throw lang::IllegalArgumentException(OUString(
+ throw lang::IllegalArgumentException(
"DocumentMetadataAccess::storeMetadataToMedium: "
- "invalid medium: no URL"), *this, 0);
+ "invalid medium: no URL", *this, 0);
}
SfxMedium aMedium(i_rMedium);
@@ -1354,9 +1340,9 @@ throw (uno::RuntimeException, lang::IllegalArgumentException,
}
if (!xStorage.is()) {
- throw uno::RuntimeException(OUString(
+ throw uno::RuntimeException(
"DocumentMetadataAccess::storeMetadataToMedium: "
- "cannot get Storage"), *this);
+ "cannot get Storage", *this);
}
// set MIME type of the storage
utl::MediaDescriptor::const_iterator iter
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 26e42a4835ea..35af9e255b2c 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -4332,8 +4332,7 @@ SfxBaseModel::getRDFRepository() throw (RuntimeException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getRDFRepository();
@@ -4347,8 +4346,7 @@ SfxBaseModel::getStringValue() throw (RuntimeException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getStringValue();
@@ -4362,8 +4360,7 @@ SfxBaseModel::getNamespace() throw (RuntimeException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getNamespace();
@@ -4376,8 +4373,7 @@ SfxBaseModel::getLocalName() throw (RuntimeException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getLocalName();
@@ -4393,8 +4389,7 @@ throw (RuntimeException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getElementByMetadataReference(i_rReference);
@@ -4408,8 +4403,7 @@ throw (RuntimeException, lang::IllegalArgumentException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getElementByURI(i_xURI);
@@ -4424,8 +4418,7 @@ throw (RuntimeException, lang::IllegalArgumentException, std::exception)
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->getMetadataGraphsWithType(i_xType);
@@ -4441,8 +4434,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->addMetadataFile(i_rFileName, i_rTypes);
@@ -4462,8 +4454,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->importMetadataFile(i_Format,
@@ -4480,8 +4471,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->removeMetadataFile(i_xGraphName);
@@ -4496,8 +4486,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->addContentOrStylesFile(i_rFileName);
@@ -4512,8 +4501,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->removeContentOrStylesFile(i_rFileName);
@@ -4532,8 +4520,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->CreateDMAUninitialized());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
try {
@@ -4559,8 +4546,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->storeMetadataToStorage(i_xStorage);
@@ -4577,8 +4563,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(
m_pData->CreateDMAUninitialized());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
try {
@@ -4603,8 +4588,7 @@ throw (RuntimeException, lang::IllegalArgumentException,
const Reference<rdf::XDocumentMetadataAccess> xDMA(m_pData->GetDMA());
if (!xDMA.is()) {
- throw RuntimeException( OUString(
- "model has no document metadata"), *this );
+ throw RuntimeException( "model has no document metadata", *this );
}
return xDMA->storeMetadataToMedium(i_rMedium);
diff --git a/stoc/source/javaloader/javaloader.cxx b/stoc/source/javaloader/javaloader.cxx
index 3b33627f6fca..335356ad39d5 100644
--- a/stoc/source/javaloader/javaloader.cxx
+++ b/stoc/source/javaloader/javaloader.cxx
@@ -165,8 +165,8 @@ const css::uno::Reference<XImplementationLoader> & JavaComponentLoader::getJavaL
reinterpret_cast< jvmaccess::UnoVirtualMachine * >(nPointer));
if (!xVirtualMachine.is())
{
- //throw RuntimeException(OUString(
- // "javaloader error - JavaVirtualMachine service could not provide a VM"),
+ //throw RuntimeException(
+ // "javaloader error - JavaVirtualMachine service could not provide a VM",
// css::uno::Reference<XInterface>());
// We must not throw a RuntimeException, because this might end the applications.
// It is ok if java components
@@ -333,8 +333,7 @@ sal_Bool SAL_CALL JavaComponentLoader::writeRegistryInfo(
if (loader.is())
return loader->writeRegistryInfo(xKey, blabla, rLibName);
else
- throw CannotRegisterImplementationException(
- OUString("Could not create Java implementation loader"), NULL);
+ throw CannotRegisterImplementationException("Could not create Java implementation loader");
}
@@ -347,8 +346,7 @@ css::uno::Reference<XInterface> SAL_CALL JavaComponentLoader::activate(
if (loader.is())
return loader->activate(rImplName, blabla, rLibName, xKey);
else
- throw CannotActivateFactoryException(
- OUString("Could not create Java implementation loader"), NULL);
+ throw CannotActivateFactoryException("Could not create Java implementation loader");
}
static Mutex & getInitMutex()
diff --git a/svtools/source/uno/genericunodialog.cxx b/svtools/source/uno/genericunodialog.cxx
index 9d7020939629..f02d99c19138 100644
--- a/svtools/source/uno/genericunodialog.cxx
+++ b/svtools/source/uno/genericunodialog.cxx
@@ -208,7 +208,7 @@ sal_Int16 SAL_CALL OGenericUnoDialog::execute( ) throw(RuntimeException, std::e
if (m_bExecuting)
throw RuntimeException(
- OUString( "already executing the dialog (recursive call)" ),
+ "already executing the dialog (recursive call)",
*this
);
diff --git a/svtools/source/uno/wizard/unowizard.cxx b/svtools/source/uno/wizard/unowizard.cxx
index 3e3e851519ae..c3f20273c686 100644
--- a/svtools/source/uno/wizard/unowizard.cxx
+++ b/svtools/source/uno/wizard/unowizard.cxx
@@ -206,7 +206,7 @@ namespace {
{
if ( i_rPaths[i][0] != nFirstPageId )
throw IllegalArgumentException(
- OUString( "All paths must start with the same page id." ),
+ "All paths must start with the same page id.",
i_rContext, 2 );
}
}
diff --git a/toolkit/source/controls/tabpagecontainer.cxx b/toolkit/source/controls/tabpagecontainer.cxx
index d6878c17cc05..b0e7b3babda6 100644
--- a/toolkit/source/controls/tabpagecontainer.cxx
+++ b/toolkit/source/controls/tabpagecontainer.cxx
@@ -166,8 +166,7 @@ void SAL_CALL UnoControlTabPageContainerModel::insertByIndex( ::sal_Int32 nIndex
maContainerListeners.elementInserted( aEvent );
}
else
- throw IllegalArgumentException( OUString( WRONG_TYPE_EXCEPTION ),
- (OWeakObject *)this, 2 );
+ throw IllegalArgumentException( WRONG_TYPE_EXCEPTION, (OWeakObject *)this, 2 );
}
void SAL_CALL UnoControlTabPageContainerModel::removeByIndex( ::sal_Int32 /*Index*/ ) throw (lang::IndexOutOfBoundsException, lang::WrappedTargetException, uno::RuntimeException, std::exception)
diff --git a/unoxml/source/dom/attributesmap.cxx b/unoxml/source/dom/attributesmap.cxx
index e3d6ebffce1a..36135ad8c378 100644
--- a/unoxml/source/dom/attributesmap.cxx
+++ b/unoxml/source/dom/attributesmap.cxx
@@ -164,8 +164,8 @@ namespace DOM
// no MutexGuard needed: m_pElement is const
Reference< XAttr > const xAttr(m_pElement->getAttributeNode(name));
if (!xAttr.is()) {
- throw DOMException(OUString(
- "CAttributesMap::removeNamedItem: no such attribute"),
+ throw DOMException(
+ "CAttributesMap::removeNamedItem: no such attribute",
static_cast<OWeakObject*>(this),
DOMExceptionType_NOT_FOUND_ERR);
}
@@ -186,8 +186,8 @@ namespace DOM
Reference< XAttr > const xAttr(
m_pElement->getAttributeNodeNS(namespaceURI, localName));
if (!xAttr.is()) {
- throw DOMException(OUString(
- "CAttributesMap::removeNamedItemNS: no such attribute"),
+ throw DOMException(
+ "CAttributesMap::removeNamedItemNS: no such attribute",
static_cast<OWeakObject*>(this),
DOMExceptionType_NOT_FOUND_ERR);
}
@@ -205,8 +205,8 @@ namespace DOM
{
Reference< XAttr > const xAttr(xNode, UNO_QUERY);
if (!xNode.is()) {
- throw DOMException(OUString(
- "CAttributesMap::setNamedItem: XAttr argument expected"),
+ throw DOMException(
+ "CAttributesMap::setNamedItem: XAttr argument expected",
static_cast<OWeakObject*>(this),
DOMExceptionType_HIERARCHY_REQUEST_ERR);
}
@@ -225,8 +225,8 @@ namespace DOM
{
Reference< XAttr > const xAttr(xNode, UNO_QUERY);
if (!xNode.is()) {
- throw DOMException(OUString(
- "CAttributesMap::setNamedItemNS: XAttr argument expected"),
+ throw DOMException(
+ "CAttributesMap::setNamedItemNS: XAttr argument expected",
static_cast<OWeakObject*>(this),
DOMExceptionType_HIERARCHY_REQUEST_ERR);
}