summaryrefslogtreecommitdiff
path: root/embeddedobj/source/general
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2014-05-26 14:29:07 +0200
committerNoel Grandin <noel@peralex.com>2014-05-27 08:20:11 +0200
commit9b791f9c31165b82ec0fa3760a8af18c5af21294 (patch)
tree3668f3b746bc584280a01162f86a0b2fe6b46510 /embeddedobj/source/general
parent3b24dcc8a8138c1e1495c3dba5ffe5748cb183c2 (diff)
remove unnecessary use of OUString constructor when throwing
Change-Id: I4a3f3f911dcfbf88696053215a2fb7a94678244c
Diffstat (limited to 'embeddedobj/source/general')
-rw-r--r--embeddedobj/source/general/dummyobject.cxx40
-rw-r--r--embeddedobj/source/general/xcreator.cxx22
2 files changed, 31 insertions, 31 deletions
diff --git a/embeddedobj/source/general/dummyobject.cxx b/embeddedobj/source/general/dummyobject.cxx
index d4a14811a486..76f982f20d84 100644
--- a/embeddedobj/source/general/dummyobject.cxx
+++ b/embeddedobj/source/general/dummyobject.cxx
@@ -44,7 +44,7 @@ void ODummyEmbeddedObject::CheckInit_WrongState()
throw lang::DisposedException();
if ( m_nObjectState == -1 )
- throw embed::WrongStateException( OUString( "The object has no persistence!\n" ),
+ throw embed::WrongStateException( "The object has no persistence!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
}
@@ -54,7 +54,7 @@ void ODummyEmbeddedObject::CheckInit_Runtime()
throw lang::DisposedException();
if ( m_nObjectState == -1 )
- throw uno::RuntimeException( OUString( "The object has no persistence!\n" ),
+ throw uno::RuntimeException( "The object has no persistence!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
}
void ODummyEmbeddedObject::PostEvent_Impl( const OUString& aEventName )
@@ -236,7 +236,7 @@ void SAL_CALL ODummyEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const
OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
- throw embed::WrongStateException( OUString( "Illegal call!\n" ),
+ throw embed::WrongStateException( "Illegal call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
m_nCachedAspect = nAspect;
@@ -257,12 +257,12 @@ awt::Size SAL_CALL ODummyEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect )
OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
- throw embed::WrongStateException( OUString( "Illegal call!\n" ),
+ throw embed::WrongStateException( "Illegal call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
if ( !m_bHasCachedSize || m_nCachedAspect != nAspect )
throw embed::NoVisualAreaSizeException(
- OUString( "No size available!\n" ),
+ "No size available!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
return m_aCachedSize;
@@ -279,7 +279,7 @@ sal_Int32 SAL_CALL ODummyEmbeddedObject::getMapUnit( sal_Int64 nAspect )
OSL_ENSURE( nAspect != embed::Aspects::MSOLE_ICON, "For iconified objects no graphical replacement is required!\n" );
if ( nAspect == embed::Aspects::MSOLE_ICON )
// no representation can be retrieved
- throw embed::WrongStateException( OUString( "Illegal call!\n" ),
+ throw embed::WrongStateException( "Illegal call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
return embed::EmbedMapUnits::ONE_100TH_MM;
@@ -296,7 +296,7 @@ embed::VisualRepresentation SAL_CALL ODummyEmbeddedObject::getPreferredVisualRep
CheckInit_WrongState();
// no representation can be retrieved
- throw embed::WrongStateException( OUString( "Illegal call!\n" ),
+ throw embed::WrongStateException( "Illegal call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
}
@@ -318,12 +318,12 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
throw lang::DisposedException(); // TODO
if ( !xStorage.is() )
- throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
+ throw lang::IllegalArgumentException( "No parent storage is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
1 );
if ( sEntName.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
+ throw lang::IllegalArgumentException( "Empty element name is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
2 );
@@ -331,7 +331,7 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
&& ( m_nObjectState == -1 || nEntryConnectionMode != embed::EntryInitModes::NO_INIT ) )
{
throw embed::WrongStateException(
- OUString( "Can't change persistent representation of activated object!\n" ),
+ "Can't change persistent representation of activated object!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
}
@@ -341,7 +341,7 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
saveCompleted( ( m_xParentStorage != xStorage || !m_aEntryName.equals( sEntName ) ) );
else
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
}
@@ -356,13 +356,13 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
m_nObjectState = embed::EmbedStates::LOADED;
}
else
- throw lang::IllegalArgumentException( OUString( "Wrong entry is provided!\n" ),
+ throw lang::IllegalArgumentException( "Wrong entry is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
2 );
}
else
- throw lang::IllegalArgumentException( OUString( "Wrong connection mode is provided!\n" ),
+ throw lang::IllegalArgumentException( "Wrong connection mode is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
3 );
}
@@ -383,7 +383,7 @@ void SAL_CALL ODummyEmbeddedObject::storeToEntry( const uno::Reference< embed::X
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
m_xParentStorage->copyElementTo( m_aEntryName, xStorage, sEntName );
@@ -405,7 +405,7 @@ void SAL_CALL ODummyEmbeddedObject::storeAsEntry( const uno::Reference< embed::X
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
PostEvent_Impl( OUString( "OnSaveAs" ) );
@@ -461,7 +461,7 @@ sal_Bool SAL_CALL ODummyEmbeddedObject::hasEntry()
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
if ( !m_aEntryName.isEmpty() )
@@ -480,7 +480,7 @@ OUString SAL_CALL ODummyEmbeddedObject::getEntryName()
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
return m_aEntryName;
@@ -498,7 +498,7 @@ void SAL_CALL ODummyEmbeddedObject::storeOwn()
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
// the object can not be activated or changed
@@ -515,7 +515,7 @@ sal_Bool SAL_CALL ODummyEmbeddedObject::isReadonly()
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
// this object can not be changed
@@ -537,7 +537,7 @@ void SAL_CALL ODummyEmbeddedObject::reload(
if ( m_bWaitSaveCompleted )
throw embed::WrongStateException(
- OUString( "The object waits for saveCompleted() call!\n" ),
+ "The object waits for saveCompleted() call!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
// nothing to reload
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index b41feb02a5e9..df2625630581 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -76,12 +76,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
uno::Reference< uno::XInterface > xResult;
if ( !xStorage.is() )
- throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
+ throw lang::IllegalArgumentException( "No parent storage is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
3 );
if ( sEntName.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
+ throw lang::IllegalArgumentException( "Empty element name is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
4 );
@@ -117,12 +117,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
uno::RuntimeException, std::exception)
{
if ( !xStorage.is() )
- throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
+ throw lang::IllegalArgumentException( "No parent storage is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
1 );
if ( sEntName.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
+ throw lang::IllegalArgumentException( "Empty element name is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
2 );
@@ -236,12 +236,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
// TODO: use lObjArgs
if ( !xStorage.is() )
- throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
+ throw lang::IllegalArgumentException( "No parent storage is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
1 );
if ( sEntName.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
+ throw lang::IllegalArgumentException( "Empty element name is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
2 );
@@ -299,12 +299,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
uno::Reference< uno::XInterface > xResult;
if ( !xStorage.is() )
- throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
+ throw lang::IllegalArgumentException( "No parent storage is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
3 );
if ( sEntName.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
+ throw lang::IllegalArgumentException( "Empty element name is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
4 );
@@ -346,7 +346,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
aTempMedDescr[nInd].Value >>= aURL;
if ( aURL.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "No URL for the link is provided!\n" ),
+ throw lang::IllegalArgumentException( "No URL for the link is provided!",
uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
3 );
@@ -375,13 +375,13 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
// was also extended.
if ( !xStorage.is() )
- throw lang::IllegalArgumentException( OUString( "No parent storage is provided!\n" ),
+ throw lang::IllegalArgumentException( "No parent storage is provided!",
uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* >(this) ),
3 );
if ( sEntName.isEmpty() )
- throw lang::IllegalArgumentException( OUString( "Empty element name is provided!\n" ),
+ throw lang::IllegalArgumentException( "Empty element name is provided!",
uno::Reference< uno::XInterface >(
static_cast< ::cppu::OWeakObject* >(this) ),
4 );