[Libreoffice-commits] core.git: 3 commits - animations/source basic/source comphelper/source cpputools/source desktop/source editeng/source embeddedobj/source extensions/source filter/source forms/source fpicker/source framework/source io/source package/source reportdesign/source scripting/source sc/source sdext/source sd/source sfx2/source slideshow/source stoc/source svl/source svtools/source svx/source sw/source toolkit/source unoxml/source xmlsecurity/source

Noel Grandin noel at peralex.com
Mon May 26 23:20:42 PDT 2014


 animations/source/animcore/animcore.cxx                    |    2 
 basic/source/uno/namecont.cxx                              |    2 
 comphelper/source/container/enumerablemap.cxx              |    6 
 comphelper/source/property/propertybag.cxx                 |    8 
 comphelper/source/streaming/memorystream.cxx               |    4 
 comphelper/source/streaming/seqinputstreamserv.cxx         |    8 
 cpputools/source/unoexe/unoexe.cxx                         |    4 
 desktop/source/deployment/gui/dp_gui_theextmgr.cxx         |    4 
 editeng/source/uno/unotext.cxx                             |    2 
 embeddedobj/source/commonembedding/embedobj.cxx            |   57 ++--
 embeddedobj/source/commonembedding/inplaceobj.cxx          |    4 
 embeddedobj/source/commonembedding/miscobj.cxx             |    4 
 embeddedobj/source/commonembedding/persistence.cxx         |  106 ++++-----
 embeddedobj/source/commonembedding/specialobject.cxx       |   28 +-
 embeddedobj/source/commonembedding/visobj.cxx              |   28 +-
 embeddedobj/source/commonembedding/xfactory.cxx            |   32 +-
 embeddedobj/source/general/dummyobject.cxx                 |   80 +++---
 embeddedobj/source/general/xcreator.cxx                    |   46 +--
 embeddedobj/source/msole/oleembed.cxx                      |   40 +--
 embeddedobj/source/msole/olemisc.cxx                       |    4 
 embeddedobj/source/msole/olepersist.cxx                    |  100 ++++----
 embeddedobj/source/msole/olevisual.cxx                     |   52 ++--
 embeddedobj/source/msole/xdialogcreator.cxx                |   16 -
 embeddedobj/source/msole/xolefactory.cxx                   |   42 +--
 extensions/source/update/check/updatehdl.cxx               |    2 
 filter/source/config/cache/basecontainer.cxx               |    2 
 filter/source/xsltdialog/xmlfilterdialogcomponent.cxx      |    4 
 forms/source/misc/InterfaceContainer.cxx                   |    2 
 fpicker/source/aqua/SalAquaFilePicker.mm                   |    8 
 fpicker/source/aqua/SalAquaFolderPicker.mm                 |    4 
 fpicker/source/win32/filepicker/FilePicker.cxx             |   12 -
 framework/source/fwe/helper/propertysetcontainer.cxx       |    4 
 framework/source/fwe/helper/undomanagerhelper.cxx          |    6 
 framework/source/fwi/uielement/rootitemcontainer.cxx       |    6 
 framework/source/services/autorecovery.cxx                 |    2 
 framework/source/services/frame.cxx                        |    4 
 framework/source/services/tabwindowservice.cxx             |    8 
 io/source/acceptor/acc_socket.cxx                          |    8 
 io/source/connector/ctr_socket.cxx                         |    8 
 package/source/xstor/owriteablestream.cxx                  |    9 
 package/source/xstor/xstorage.cxx                          |   87 +++----
 reportdesign/source/core/api/ReportDefinition.cxx          |    2 
 sc/source/ui/unoobj/styleuno.cxx                           |    2 
 sc/source/ui/vba/vbaworksheet.cxx                          |    4 
 sc/source/ui/vba/vbaworksheets.cxx                         |    2 
 scripting/source/dlgprov/dlgprov.cxx                       |   10 
 sd/source/ui/presenter/PresenterHelper.cxx                 |    3 
 sdext/source/presenter/PresenterAccessibility.cxx          |    8 
 sdext/source/presenter/PresenterWindowManager.cxx          |    2 
 sfx2/source/doc/DocumentMetadataAccess.cxx                 |  150 +++++--------
 sfx2/source/doc/sfxbasemodel.cxx                           |   52 +---
 slideshow/source/engine/shapes/viewmediashape.cxx          |    2 
 stoc/source/javaloader/javaloader.cxx                      |   10 
 svl/source/fsstor/fsstorage.cxx                            |   28 +-
 svtools/source/uno/genericunodialog.cxx                    |    2 
 svtools/source/uno/wizard/unowizard.cxx                    |    2 
 svx/source/form/fmpgeimp.cxx                               |    4 
 svx/source/sidebar/line/LinePropertyPanel.cxx              |    6 
 svx/source/table/tabledesign.cxx                           |    2 
 sw/source/core/uibase/uno/unomailmerge.cxx                 |    4 
 sw/source/core/unocore/SwXTextDefaults.cxx                 |   14 -
 sw/source/core/unocore/unofield.cxx                        |   12 -
 sw/source/core/unocore/unoframe.cxx                        |    8 
 sw/source/core/unocore/unoport.cxx                         |    6 
 toolkit/source/controls/tabpagecontainer.cxx               |    3 
 unoxml/source/dom/attributesmap.cxx                        |   16 -
 xmlsecurity/source/component/documentdigitalsignatures.cxx |    8 
 67 files changed, 580 insertions(+), 637 deletions(-)

New commits:
commit 0f2824b117b65bd9c9db2870edc159419ae0c1d9
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 26 16:59:44 2014 +0200

    remove more unnecessary use of OUString constructor
    
    Change-Id: Iae14cb3df65295b6894fd9e05411c5698e9c8aba

diff --git a/basic/source/uno/namecont.cxx b/basic/source/uno/namecont.cxx
index 924c488..e7cf8f3 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 b2e7def..7dc2df1 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 f751bbc..78e6a65 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 e659c03..8284460 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 3f06ee7..1d4f13a 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 b7a9141..e09e840 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 63178ad..5960369 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 2eb9b6c..6c999dc 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 26e42a4..35af9e2 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 3b33627..335356a 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 9d70209..f02d99c 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 3e3e851..c3f2027 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 d6878c1..b0e7b3b 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 e3d6ebf..36135ad 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);
         }
commit 9af0abebfd61641c9d028505caa864cdf898e35b
Author: Noel Grandin <noel at peralex.com>
Date:   Mon May 26 15:26:03 2014 +0200

    remove unnecessary use of Reference constructor in throw
    
    Convert code like this:
      throw IOException("xx",
         Reference< XInterface >(static_cast<OWeakObject*>(this)) );
    to this:
      throw IOException("xx",
         static_cast<OWeakObject*>(this) );
    
    Change-Id: Ife9f645f0f1810a8e80219126193015502c43dbb

diff --git a/animations/source/animcore/animcore.cxx b/animations/source/animcore/animcore.cxx
index b77675d..9aed809 100644
--- a/animations/source/animcore/animcore.cxx
+++ b/animations/source/animcore/animcore.cxx
@@ -514,7 +514,7 @@ AnimationNode::~AnimationNode()
 #define IMPL_NODE_FACTORY(N,IN,SN)\
 Reference< XInterface > SAL_CALL createInstance_##N( const Reference< XComponentContext > &  ) throw (Exception)\
 {\
-    return Reference < XInterface > ( (static_cast< ::cppu::OWeakObject *  >(new AnimationNode( N )) ) );\
+    return static_cast< ::cppu::OWeakObject *  >(new AnimationNode( N ));\
 }\
 OUString getImplementationName_##N()\
 {\
diff --git a/comphelper/source/streaming/memorystream.cxx b/comphelper/source/streaming/memorystream.cxx
index c4379cd..b8b3f4c 100644
--- a/comphelper/source/streaming/memorystream.cxx
+++ b/comphelper/source/streaming/memorystream.cxx
@@ -148,7 +148,7 @@ void SAL_CALL UNOMemoryStream::closeInput() throw (NotConnectedException, IOExce
 void SAL_CALL UNOMemoryStream::seek( sal_Int64 location ) throw (IllegalArgumentException, IOException, RuntimeException, std::exception)
 {
     if( (location < 0) || (location > SAL_MAX_INT32) )
-        throw IllegalArgumentException("this implementation does not support more than 2GB!", Reference< XInterface >(static_cast<OWeakObject*>(this)), 0 );
+        throw IllegalArgumentException("this implementation does not support more than 2GB!", static_cast<OWeakObject*>(this), 0 );
 
     // seek operation should be able to resize the stream
     if ( location > static_cast< sal_Int64 >( maData.size() ) )
@@ -180,7 +180,7 @@ void SAL_CALL UNOMemoryStream::writeBytes( const Sequence< sal_Int8 >& aData ) t
         if( nNewSize > SAL_MAX_INT32 )
         {
             OSL_ASSERT(false);
-            throw IOException("this implementation does not support more than 2GB!", Reference< XInterface >(static_cast<OWeakObject*>(this)) );
+            throw IOException("this implementation does not support more than 2GB!", static_cast<OWeakObject*>(this) );
         }
 
         if( static_cast< sal_Int32 >( nNewSize ) > static_cast< sal_Int32 >( maData.size() ) )
diff --git a/comphelper/source/streaming/seqinputstreamserv.cxx b/comphelper/source/streaming/seqinputstreamserv.cxx
index b5750d4..1ea60fa 100644
--- a/comphelper/source/streaming/seqinputstreamserv.cxx
+++ b/comphelper/source/streaming/seqinputstreamserv.cxx
@@ -208,7 +208,7 @@ void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< ::com
 
     if ( aArguments.getLength() != 1 )
         throw lang::IllegalArgumentException( "Wrong number of arguments!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     uno::Sequence< sal_Int8 > aSeq;
@@ -224,7 +224,7 @@ void SAL_CALL SequenceInputStreamService::initialize( const uno::Sequence< ::com
     }
     else
         throw lang::IllegalArgumentException( "Unexpected type of argument!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 }
 
diff --git a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
index e8a9844..bea8c67 100644
--- a/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
+++ b/desktop/source/deployment/gui/dp_gui_theextmgr.cxx
@@ -446,8 +446,8 @@ void TheExtensionManager::queryTermination( ::lang::EventObject const & )
     {
         ToTop( TOTOP_RESTOREWHENMIN );
         throw frame::TerminationVetoException(
-            OUString("The office cannot be closed while the Extension Manager is running"),
-            uno::Reference<XInterface>(static_cast<frame::XTerminateListener*>(this), uno::UNO_QUERY));
+            "The office cannot be closed while the Extension Manager is running",
+            static_cast<frame::XTerminateListener*>(this));
     }
     else
     {
diff --git a/embeddedobj/source/commonembedding/embedobj.cxx b/embeddedobj/source/commonembedding/embedobj.cxx
index 2be1904..d96aab2 100644
--- a/embeddedobj/source/commonembedding/embedobj.cxx
+++ b/embeddedobj/source/commonembedding/embedobj.cxx
@@ -102,7 +102,7 @@ void OCommonEmbeddedObject::Deactivate()
         {
             throw embed::StorageWrappedTargetException(
                 "The client could not store the object!",
-                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >( this ) ),
+                static_cast< ::cppu::OWeakObject* >( this ),
                 uno::makeAny( e ) );
         }
     }
@@ -384,7 +384,7 @@ void OCommonEmbeddedObject::SwitchStateTo_Impl( sal_Int32 nNextState )
     }
     else
         throw embed::WrongStateException( "The object is in unacceptable state!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 }
 
 
@@ -397,7 +397,7 @@ uno::Sequence< sal_Int32 > OCommonEmbeddedObject::GetIntermediateStatesSequence_
 
     if ( nCurInd == m_aAcceptedStates.getLength() )
         throw embed::WrongStateException( "The object is in unacceptable state!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     sal_Int32 nDestInd = 0;
     for ( nDestInd = 0; nDestInd < m_aAcceptedStates.getLength(); nDestInd++ )
@@ -407,7 +407,7 @@ uno::Sequence< sal_Int32 > OCommonEmbeddedObject::GetIntermediateStatesSequence_
     if ( nDestInd == m_aAcceptedStates.getLength() )
         throw embed::UnreachableStateException(
             "The state either not reachable, or the object allows the state only as an intermediate one!",
-            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+            static_cast< ::cppu::OWeakObject* >(this),
             m_nObjectState,
             nNewState );
 
@@ -429,7 +429,7 @@ void SAL_CALL OCommonEmbeddedObject::changeState( sal_Int32 nNewState )
 
         if ( m_nObjectState == -1 )
             throw embed::WrongStateException( "The object has no persistence!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                              static_cast< ::cppu::OWeakObject* >(this) );
 
         sal_Int32 nOldState = m_nObjectState;
 
@@ -495,7 +495,7 @@ uno::Sequence< sal_Int32 > SAL_CALL OCommonEmbeddedObject::getReachableStates()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                           static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_aAcceptedStates;
 }
@@ -510,7 +510,7 @@ sal_Int32 SAL_CALL OCommonEmbeddedObject::getCurrentState()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_nObjectState;
 }
@@ -539,7 +539,7 @@ void SAL_CALL OCommonEmbeddedObject::doVerb( sal_Int32 nVerbID )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     // for internal documents this call is just a duplicate of changeState
     sal_Int32 nNewState = -1;
@@ -572,7 +572,7 @@ uno::Sequence< embed::VerbDescriptor > SAL_CALL OCommonEmbeddedObject::getSuppor
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_aObjectVerbs;
 }
@@ -592,7 +592,7 @@ void SAL_CALL OCommonEmbeddedObject::setClientSite(
         if ( m_nObjectState != embed::EmbedStates::LOADED && m_nObjectState != embed::EmbedStates::RUNNING )
             throw embed::WrongStateException(
                                     "The client site can not be set currently!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                     static_cast< ::cppu::OWeakObject* >(this) );
 
         m_xClientSite = xClient;
     }
@@ -608,7 +608,7 @@ uno::Reference< embed::XEmbeddedClient > SAL_CALL OCommonEmbeddedObject::getClie
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_xClientSite;
 }
@@ -625,7 +625,7 @@ void SAL_CALL OCommonEmbeddedObject::update()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     PostEvent_Impl( OUString( "OnVisAreaChanged" ) );
 }
@@ -641,7 +641,7 @@ void SAL_CALL OCommonEmbeddedObject::setUpdateMode( sal_Int32 nMode )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     OSL_ENSURE( nMode == embed::EmbedUpdateModes::ALWAYS_UPDATE
                     || nMode == embed::EmbedUpdateModes::EXPLICIT_UPDATE,
diff --git a/embeddedobj/source/commonembedding/inplaceobj.cxx b/embeddedobj/source/commonembedding/inplaceobj.cxx
index 207c88e..0fff4c3 100644
--- a/embeddedobj/source/commonembedding/inplaceobj.cxx
+++ b/embeddedobj/source/commonembedding/inplaceobj.cxx
@@ -47,7 +47,7 @@ void SAL_CALL OCommonEmbeddedObject::setObjectRectangles( const awt::Rectangle&
     if ( m_nObjectState != embed::EmbedStates::INPLACE_ACTIVE
       && m_nObjectState != embed::EmbedStates::UI_ACTIVE )
         throw embed::WrongStateException( "The object is not activated inplace!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                          static_cast< ::cppu::OWeakObject* >(this) );
 
     awt::Rectangle aNewRectToShow = GetRectangleInterception( aPosRect, aClipRect );
     awt::Rectangle aOldRectToShow = GetRectangleInterception( m_aOwnRectangle, m_aClipRectangle );
diff --git a/embeddedobj/source/commonembedding/miscobj.cxx b/embeddedobj/source/commonembedding/miscobj.cxx
index 6bfbf5a..fb560aa 100644
--- a/embeddedobj/source/commonembedding/miscobj.cxx
+++ b/embeddedobj/source/commonembedding/miscobj.cxx
@@ -492,7 +492,7 @@ uno::Reference< util::XCloseable > SAL_CALL OCommonEmbeddedObject::getComponent(
     {
         // the object is still not loaded
         throw uno::RuntimeException( "Can't store object without persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                     static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     return uno::Reference< util::XCloseable >( m_pDocHolder->GetComponent(), uno::UNO_QUERY );
diff --git a/embeddedobj/source/commonembedding/persistence.cxx b/embeddedobj/source/commonembedding/persistence.cxx
index aebfb81..4a057f8 100644
--- a/embeddedobj/source/commonembedding/persistence.cxx
+++ b/embeddedobj/source/commonembedding/persistence.cxx
@@ -911,12 +911,12 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     // May be LOADED should be forbidden here ???
@@ -931,7 +931,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
 
         throw embed::WrongStateException(
                     "Can't change persistent representation of activated object!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                     static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
@@ -955,7 +955,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
         else
             throw embed::WrongStateException(
                         "The object waits for saveCompleted() call!",
-                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     // for now support of this interface is required to allow breaking of links and converting them to normal embedded
@@ -1112,7 +1112,7 @@ void SAL_CALL OCommonEmbeddedObject::setPersistentEntry(
         //}
         else
             throw lang::IllegalArgumentException( "Wrong connection mode is provided!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                        static_cast< ::cppu::OWeakObject* >(this),
                                         3 );
     }
 }
@@ -1136,13 +1136,13 @@ void SAL_CALL OCommonEmbeddedObject::storeToEntry( const uno::Reference< embed::
     {
         // the object is still not loaded
         throw embed::WrongStateException( "Can't store object without persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     // for now support of this interface is required to allow breaking of links and converting them to normal embedded
     // objects, so the persist name must be handled correctly ( althowgh no real persist entry is used )
@@ -1268,13 +1268,13 @@ void SAL_CALL OCommonEmbeddedObject::storeAsEntry( const uno::Reference< embed::
     {
         // the object is still not loaded
         throw embed::WrongStateException( "Can't store object without persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     // for now support of this interface is required to allow breaking of links and converting them to normal embedded
     // objects, so the persist name must be handled correctly ( althowgh no real persist entry is used )
@@ -1407,7 +1407,7 @@ void SAL_CALL OCommonEmbeddedObject::saveCompleted( sal_Bool bUseNew )
     {
         // the object is still not loaded
         throw embed::WrongStateException( "Can't store object without persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     // for now support of this interface is required to allow breaking of links and converting them to normal embedded
@@ -1486,7 +1486,7 @@ sal_Bool SAL_CALL OCommonEmbeddedObject::hasEntry()
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_xObjectStorage.is() )
         return sal_True;
@@ -1507,13 +1507,13 @@ OUString SAL_CALL OCommonEmbeddedObject::getEntryName()
     {
         // the object is still not loaded
         throw embed::WrongStateException( "The object persistence is not initialized!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_aEntryName;
 }
@@ -1537,13 +1537,13 @@ void SAL_CALL OCommonEmbeddedObject::storeOwn()
     {
         // the object is still not loaded
         throw embed::WrongStateException( "Can't store object without persistence!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_bReadOnly )
         throw io::IOException(); // TODO: access denied
@@ -1623,13 +1623,13 @@ sal_Bool SAL_CALL OCommonEmbeddedObject::isReadonly()
     {
         // the object is still not loaded
         throw embed::WrongStateException( "The object persistence is not initialized!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_bReadOnly;
 }
@@ -1655,7 +1655,7 @@ void SAL_CALL OCommonEmbeddedObject::reload(
     {
         // the object is still not loaded
         throw embed::WrongStateException( "The object persistence is not initialized!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_nObjectState != embed::EmbedStates::LOADED )
@@ -1663,13 +1663,13 @@ void SAL_CALL OCommonEmbeddedObject::reload(
         // the object is still not loaded
         throw embed::WrongStateException(
                                 "The object must be in loaded state to be reloaded!",
-                                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_bIsLink )
     {
@@ -1777,7 +1777,7 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt
         // it must be a linked initialized object
         throw embed::WrongStateException(
                     "The object is not a valid linked object!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
     }
     else
     {
@@ -1787,12 +1787,12 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     if ( !m_bIsLink || m_nObjectState == -1 )
@@ -1800,13 +1800,13 @@ void SAL_CALL OCommonEmbeddedObject::breakLink( const uno::Reference< embed::XSt
         // it must be a linked initialized object
         throw embed::WrongStateException(
                     "The object is not a valid linked object!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
     if ( !xNameAccess.is() )
@@ -1878,7 +1878,7 @@ OUString SAL_CALL OCommonEmbeddedObject::getLinkURL()
     if ( !m_bIsLink )
         throw embed::WrongStateException(
                     "The object is not a link object!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_aLinkURL;
 }
diff --git a/embeddedobj/source/commonembedding/specialobject.cxx b/embeddedobj/source/commonembedding/specialobject.cxx
index 86ec2a7..4ff96a1 100644
--- a/embeddedobj/source/commonembedding/specialobject.cxx
+++ b/embeddedobj/source/commonembedding/specialobject.cxx
@@ -108,13 +108,13 @@ embed::VisualRepresentation SAL_CALL OSpecialEmbeddedObject::getPreferredVisualR
     // TODO: if object is in loaded state it should switch itself to the running state
     if ( m_nObjectState == -1 || m_nObjectState == embed::EmbedStates::LOADED )
         throw embed::WrongStateException( "The own object has no model!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     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( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     // TODO: return for the aspect of the document
     embed::VisualRepresentation aVisualRepresentation;
@@ -135,7 +135,7 @@ void SAL_CALL OSpecialEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, cons
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     maSize = aSize;
 }
@@ -154,11 +154,11 @@ awt::Size SAL_CALL OSpecialEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The own object has no model!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     awt::Size aResult;
     return maSize;
@@ -176,7 +176,7 @@ sal_Int32 SAL_CALL OSpecialEmbeddedObject::getMapUnit( sal_Int64 nAspect )
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     return embed::EmbedMapUnits::ONE_100TH_MM;
 }
@@ -205,7 +205,7 @@ void SAL_CALL OSpecialEmbeddedObject::doVerb( sal_Int32 nVerbID )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( nVerbID == -7 )
     {
diff --git a/embeddedobj/source/commonembedding/visobj.cxx b/embeddedobj/source/commonembedding/visobj.cxx
index 6243897..9f2af1e 100644
--- a/embeddedobj/source/commonembedding/visobj.cxx
+++ b/embeddedobj/source/commonembedding/visobj.cxx
@@ -43,11 +43,11 @@ void SAL_CALL OCommonEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The own object has no persistence!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     m_bHasClonedSize = false;
 
@@ -81,7 +81,7 @@ awt::Size SAL_CALL OCommonEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The own object has no persistence!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified objects no graphical replacement is required!" );
 
@@ -121,11 +121,11 @@ sal_Int32 SAL_CALL OCommonEmbeddedObject::getMapUnit( sal_Int64 nAspect )
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The own object has no persistence!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_bHasClonedSize )
         return m_nClonedMapUnit;
@@ -162,14 +162,14 @@ embed::VisualRepresentation SAL_CALL OCommonEmbeddedObject::getPreferredVisualRe
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The own object has no persistence!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
 
     SAL_WARN_IF( nAspect == embed::Aspects::MSOLE_ICON, "embeddedobj.common", "For iconified objects no graphical replacement is required!" );
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     bool bBackToLoaded = false;
     if ( m_nObjectState == embed::EmbedStates::LOADED )
diff --git a/embeddedobj/source/commonembedding/xfactory.cxx b/embeddedobj/source/commonembedding/xfactory.cxx
index 1253040..42ddfb3 100644
--- a/embeddedobj/source/commonembedding/xfactory.cxx
+++ b/embeddedobj/source/commonembedding/xfactory.cxx
@@ -67,12 +67,12 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
 {
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
@@ -155,12 +155,12 @@ uno::Reference< uno::XInterface > SAL_CALL OOoEmbeddedObjectFactory::createInsta
 {
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     uno::Sequence< beans::PropertyValue > aTempMedDescr( aMediaDescr );
diff --git a/embeddedobj/source/general/dummyobject.cxx b/embeddedobj/source/general/dummyobject.cxx
index 76f982f..603b8f3 100644
--- a/embeddedobj/source/general/dummyobject.cxx
+++ b/embeddedobj/source/general/dummyobject.cxx
@@ -45,7 +45,7 @@ void ODummyEmbeddedObject::CheckInit_WrongState()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 }
 
 void ODummyEmbeddedObject::CheckInit_Runtime()
@@ -55,7 +55,7 @@ void ODummyEmbeddedObject::CheckInit_Runtime()
 
     if ( m_nObjectState == -1 )
         throw uno::RuntimeException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                     static_cast< ::cppu::OWeakObject* >(this) );
 }
 void ODummyEmbeddedObject::PostEvent_Impl( const OUString& aEventName )
 {
@@ -237,7 +237,7 @@ void SAL_CALL ODummyEmbeddedObject::setVisualAreaSize( sal_Int64 nAspect, const
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     m_nCachedAspect = nAspect;
     m_aCachedSize = aSize;
@@ -258,12 +258,12 @@ awt::Size SAL_CALL ODummyEmbeddedObject::getVisualAreaSize( sal_Int64 nAspect )
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( !m_bHasCachedSize || m_nCachedAspect != nAspect )
         throw embed::NoVisualAreaSizeException(
                 "No size available!",
-                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_aCachedSize;
 }
@@ -280,7 +280,7 @@ sal_Int32 SAL_CALL ODummyEmbeddedObject::getMapUnit( sal_Int64 nAspect )
     if ( nAspect == embed::Aspects::MSOLE_ICON )
         // no representation can be retrieved
         throw embed::WrongStateException( "Illegal call!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     return embed::EmbedMapUnits::ONE_100TH_MM;
 }
@@ -297,7 +297,7 @@ embed::VisualRepresentation SAL_CALL ODummyEmbeddedObject::getPreferredVisualRep
 
     // no representation can be retrieved
     throw embed::WrongStateException( "Illegal call!",
-                                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                static_cast< ::cppu::OWeakObject* >(this) );
 }
 
 
@@ -319,12 +319,12 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     if ( ( m_nObjectState != -1 || nEntryConnectionMode == embed::EntryInitModes::NO_INIT )
@@ -332,7 +332,7 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
     {
         throw embed::WrongStateException(
                     "Can't change persistent representation of activated object!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
@@ -342,7 +342,7 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
         else
             throw embed::WrongStateException(
                         "The object waits for saveCompleted() call!",
-                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( nEntryConnectionMode == embed::EntryInitModes::DEFAULT_INIT
@@ -357,13 +357,13 @@ void SAL_CALL ODummyEmbeddedObject::setPersistentEntry(
         }
         else
             throw lang::IllegalArgumentException( "Wrong entry is provided!",
-                                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                static_cast< ::cppu::OWeakObject* >(this),
                                 2 );
 
     }
     else
         throw lang::IllegalArgumentException( "Wrong connection mode is provided!",
-                                uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                static_cast< ::cppu::OWeakObject* >(this),
                                 3 );
 }
 
@@ -384,7 +384,7 @@ void SAL_CALL ODummyEmbeddedObject::storeToEntry( const uno::Reference< embed::X
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     m_xParentStorage->copyElementTo( m_aEntryName, xStorage, sEntName );
 }
@@ -406,7 +406,7 @@ void SAL_CALL ODummyEmbeddedObject::storeAsEntry( const uno::Reference< embed::X
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     PostEvent_Impl( OUString( "OnSaveAs" ) );
 
@@ -462,7 +462,7 @@ sal_Bool SAL_CALL ODummyEmbeddedObject::hasEntry()
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( !m_aEntryName.isEmpty() )
         return sal_True;
@@ -481,7 +481,7 @@ OUString SAL_CALL ODummyEmbeddedObject::getEntryName()
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_aEntryName;
 }
@@ -499,7 +499,7 @@ void SAL_CALL ODummyEmbeddedObject::storeOwn()
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     // the object can not be activated or changed
     return;
@@ -516,7 +516,7 @@ sal_Bool SAL_CALL ODummyEmbeddedObject::isReadonly()
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     // this object can not be changed
     return sal_True;
@@ -538,7 +538,7 @@ void SAL_CALL ODummyEmbeddedObject::reload(
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     // nothing to reload
 }
diff --git a/embeddedobj/source/general/xcreator.cxx b/embeddedobj/source/general/xcreator.cxx
index df26256..b3db0f0 100644
--- a/embeddedobj/source/general/xcreator.cxx
+++ b/embeddedobj/source/general/xcreator.cxx
@@ -77,12 +77,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             3 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             4 );
 
     OUString aEmbedFactory = m_aConfigHelper.GetFactoryNameByClassID( aClassID );
@@ -118,12 +118,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
 {
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
@@ -237,12 +237,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     uno::Reference< uno::XInterface > xResult;
@@ -300,12 +300,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             3 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             4 );
 
     OUString aEmbedFactory = m_aConfigHelper.GetFactoryNameByClassID( aClassID );
@@ -347,7 +347,7 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
 
     if ( aURL.isEmpty() )
         throw lang::IllegalArgumentException( "No URL for the link is provided!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                        static_cast< ::cppu::OWeakObject* >(this),
                                         3 );
 
     OUString aFilterName = m_aConfigHelper.UpdateMediaDescriptorWithFilterName( aTempMedDescr, false );
@@ -376,14 +376,12 @@ uno::Reference< uno::XInterface > SAL_CALL UNOEmbeddedObjectCreator::createInsta
 
         if ( !xStorage.is() )
             throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                                uno::Reference< uno::XInterface >(
-                                                    static_cast< ::cppu::OWeakObject* >(this) ),
+                                                static_cast< ::cppu::OWeakObject* >(this),
                                                 3 );
 
         if ( sEntName.isEmpty() )
             throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                                uno::Reference< uno::XInterface >(
-                                                    static_cast< ::cppu::OWeakObject* >(this) ),
+                                                static_cast< ::cppu::OWeakObject* >(this),
                                                 4 );
 
         uno::Reference< embed::XEmbeddedObjectCreator > xLinkCreator =
diff --git a/embeddedobj/source/msole/oleembed.cxx b/embeddedobj/source/msole/oleembed.cxx
index 4de8ae6..144ecf5 100644
--- a/embeddedobj/source/msole/oleembed.cxx
+++ b/embeddedobj/source/msole/oleembed.cxx
@@ -459,7 +459,7 @@ void SAL_CALL OleEmbeddedObject::changeState( sal_Int32 nNewState )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
     // in case the object is already in requested state
     if ( m_nObjectState == nNewState )
@@ -613,7 +613,7 @@ uno::Sequence< sal_Int32 > SAL_CALL OleEmbeddedObject::getReachableStates()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
 #ifdef WNT
     if ( m_pOleComponent )
@@ -655,7 +655,7 @@ sal_Int32 SAL_CALL OleEmbeddedObject::getCurrentState()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
     // TODO: Shouldn't we ask object? ( I guess no )
     return m_nObjectState;
@@ -771,7 +771,7 @@ void SAL_CALL OleEmbeddedObject::doVerb( sal_Int32 nVerbID )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
 #ifdef WNT
     if ( m_pOleComponent )
@@ -904,7 +904,7 @@ uno::Sequence< embed::VerbDescriptor > SAL_CALL OleEmbeddedObject::getSupportedV
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 #ifdef WNT
     if ( m_pOleComponent )
     {
@@ -949,7 +949,7 @@ void SAL_CALL OleEmbeddedObject::setClientSite(
         if ( m_nObjectState != embed::EmbedStates::LOADED && m_nObjectState != embed::EmbedStates::RUNNING )
             throw embed::WrongStateException(
                                     "The client site can not be set currently!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
         m_xClientSite = xClient;
     }
@@ -975,7 +975,7 @@ uno::Reference< embed::XEmbeddedClient > SAL_CALL OleEmbeddedObject::getClientSi
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
     return m_xClientSite;
 }
@@ -1002,7 +1002,7 @@ void SAL_CALL OleEmbeddedObject::update()
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
 
     if ( m_nUpdateMode == embed::EmbedUpdateModes::EXPLICIT_UPDATE )
     {
@@ -1036,7 +1036,7 @@ void SAL_CALL OleEmbeddedObject::setUpdateMode( sal_Int32 nMode )
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object has no persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                       static_cast< ::cppu::OWeakObject* >(this) );
 
     OSL_ENSURE( nMode == embed::EmbedUpdateModes::ALWAYS_UPDATE
                     || nMode == embed::EmbedUpdateModes::EXPLICIT_UPDATE,
@@ -1066,7 +1066,7 @@ sal_Int64 SAL_CALL OleEmbeddedObject::getStatus( sal_Int64
 
     if ( m_nObjectState == -1 )
         throw embed::WrongStateException( "The object must be in running state!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                    static_cast< ::cppu::OWeakObject* >(this) );
 
     sal_Int64 nResult = 0;
 
diff --git a/embeddedobj/source/msole/olemisc.cxx b/embeddedobj/source/msole/olemisc.cxx
index 2a05a70..dc1accb 100644
--- a/embeddedobj/source/msole/olemisc.cxx
+++ b/embeddedobj/source/msole/olemisc.cxx
@@ -384,7 +384,7 @@ uno::Reference< util::XCloseable > SAL_CALL OleEmbeddedObject::getComponent()
     {
         // the object is still not running
         throw uno::RuntimeException( "The object is not loaded!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
 #if defined WNT
diff --git a/embeddedobj/source/msole/olepersist.cxx b/embeddedobj/source/msole/olepersist.cxx
index 44f68bc..d3b0901 100644
--- a/embeddedobj/source/msole/olepersist.cxx
+++ b/embeddedobj/source/msole/olepersist.cxx
@@ -1080,13 +1080,13 @@ void OleEmbeddedObject::StoreToLocation_Impl(
     {
         // the object is still not loaded
         throw embed::WrongStateException( "Can't store object without persistence!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
         throw embed::WrongStateException(
                     "The object waits for saveCompleted() call!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
 
     OSL_ENSURE( m_xParentStorage.is() && m_xObjectStream.is(), "The object has no valid persistence!\n" );
 
@@ -1313,12 +1313,12 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
 
     if ( !xStorage.is() )
         throw lang::IllegalArgumentException( "No parent storage is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             1 );
 
     if ( sEntName.isEmpty() )
         throw lang::IllegalArgumentException( "Empty element name is provided!",
-                                            uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                            static_cast< ::cppu::OWeakObject* >(this),
                                             2 );
 
     // May be LOADED should be forbidden here ???
@@ -1333,7 +1333,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
 
         throw embed::WrongStateException(
                     "Can't change persistent representation of activated object!",
-                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                    static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     if ( m_bWaitSaveCompleted )
@@ -1343,7 +1343,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
         else
             throw embed::WrongStateException(
                         "The object waits for saveCompleted() call!",
-                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ) );
+                        static_cast< ::cppu::OWeakObject* >(this) );
     }
 
     uno::Reference< container::XNameAccess > xNameAccess( xStorage, uno::UNO_QUERY );
@@ -1439,7 +1439,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
             if ( aURL.isEmpty() )
                 throw lang::IllegalArgumentException(
                                     "Empty URL is provided in the media descriptor!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                    static_cast< ::cppu::OWeakObject* >(this),
                                     4 );
 
             CreateOleComponent_Impl();
@@ -1461,7 +1461,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
         //}
         else
             throw lang::IllegalArgumentException( "Wrong connection mode is provided!",
-                                        uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                        static_cast< ::cppu::OWeakObject* >(this),
                                         3 );
     }
 #else
@@ -1479,7 +1479,7 @@ void SAL_CALL OleEmbeddedObject::setPersistentEntry(
     }
     else
         throw lang::IllegalArgumentException( "Wrong connection mode is provided!",
-                                    uno::Reference< uno::XInterface >( static_cast< ::cppu::OWeakObject* >(this) ),
+                                    static_cast< ::cppu::OWeakObject* >(this),
                                     3 );
 
 #endif
@@ -1573,7 +1573,7 @@ void SAL_CALL OleEmbeddedObject::saveCompleted( sal_Bool bUseNew )
     {

... etc. - the rest is truncated


More information about the Libreoffice-commits mailing list