[Libreoffice-commits] core.git: chart2/source compilerplugins/clang connectivity/source dbaccess/source desktop/source filter/source framework/source i18nutil/source include/svl include/ucbhelper pyuno/source reportdesign/source sc/source sfx2/source svgio/source svtools/source svx/source sw/source toolkit/source ucbhelper/source ucb/source uui/source vbahelper/source xmlhelp/source xmlsecurity/source

Noel Grandin noel.grandin at collabora.co.uk
Mon Mar 12 06:37:46 UTC 2018


 chart2/source/controller/sidebar/ChartAreaPanel.cxx          |    4 -
 chart2/source/model/template/DataInterpreter.cxx             |    2 
 chart2/source/tools/CachedDataSequence.cxx                   |    2 
 chart2/source/tools/UncachedDataSequence.cxx                 |    2 
 chart2/source/view/diagram/VDiagram.cxx                      |    4 -
 compilerplugins/clang/redundantfcast.cxx                     |   40 +++++++++++
 compilerplugins/clang/test/redundantfcast.cxx                |    9 ++
 connectivity/source/drivers/firebird/StatementCommonBase.cxx |    2 
 dbaccess/source/ui/misc/DExport.cxx                          |    2 
 desktop/source/deployment/inc/dp_ucb.h                       |    3 
 filter/source/svg/svgdialog.cxx                              |    2 
 framework/source/services/pathsettings.cxx                   |    3 
 framework/source/uielement/statusbaritem.cxx                 |    2 
 i18nutil/source/utility/oneToOneMapping.cxx                  |   12 +--
 include/svl/zforlist.hxx                                     |    2 
 include/ucbhelper/macros.hxx                                 |    6 -
 pyuno/source/module/pyuno.cxx                                |    2 
 reportdesign/source/core/sdr/RptObject.cxx                   |    2 
 sc/source/ui/vba/vbaapplication.cxx                          |   12 +--
 sc/source/ui/vba/vbaglobals.cxx                              |    4 -
 sc/source/ui/vba/vbainterior.cxx                             |    2 
 sc/source/ui/vba/vbaworkbook.cxx                             |    6 -
 sc/source/ui/vba/vbaworksheet.cxx                            |    2 
 sfx2/source/view/classificationcontroller.cxx                |    2 
 svgio/source/svgreader/svgtools.cxx                          |    2 
 svtools/source/table/tablecontrol.cxx                        |    2 
 svx/source/svdraw/sdrpaintwindow.cxx                         |    2 
 sw/source/ui/vba/vbadocument.cxx                             |    4 -
 sw/source/ui/vba/vbawindow.cxx                               |    2 
 sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx           |    4 -
 toolkit/source/controls/roadmapentry.cxx                     |    3 
 ucb/source/core/cmdenv.cxx                                   |    5 -
 ucb/source/core/ucbcmds.cxx                                  |    4 -
 ucb/source/sorter/sortdynres.cxx                             |    5 -
 ucb/source/ucp/file/filrset.hxx                              |    2 
 ucb/source/ucp/file/prov.cxx                                 |    4 -
 ucb/source/ucp/ftp/ftpcontentprovider.cxx                    |    6 -
 ucb/source/ucp/ftp/ftpresultsetbase.hxx                      |    2 
 ucb/source/ucp/tdoc/tdoc_content.cxx                         |   13 +--
 ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx          |    5 -
 ucbhelper/source/provider/propertyvalueset.cxx               |    2 
 uui/source/passwordcontainer.cxx                             |    5 -
 vbahelper/source/msforms/vbaframe.cxx                        |    2 
 xmlhelp/source/cxxhelp/provider/provider.cxx                 |    6 -
 xmlhelp/source/cxxhelp/provider/resultsetbase.hxx            |    2 
 xmlhelp/source/treeview/tvfactory.cxx                        |    5 -
 xmlsecurity/source/component/certificatecontainer.cxx        |    2 
 47 files changed, 125 insertions(+), 93 deletions(-)

New commits:
commit 2f5868c4309d49ad495e0763b5b57d1f7f98e377
Author: Noel Grandin <noel.grandin at collabora.co.uk>
Date:   Fri Mar 9 13:59:52 2018 +0200

    loplugin:redundantfcast look for redundant copies in return statements
    
    Change-Id: I5f416c865dfe1c36018784246a8007452eb42008
    Reviewed-on: https://gerrit.libreoffice.org/50996
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/chart2/source/controller/sidebar/ChartAreaPanel.cxx b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
index c057ebc5e0ad..0423aca7e8d1 100644
--- a/chart2/source/controller/sidebar/ChartAreaPanel.cxx
+++ b/chart2/source/controller/sidebar/ChartAreaPanel.cxx
@@ -112,7 +112,7 @@ XGradient getXGradientForName(const css::uno::Reference<css::frame::XModel>& xMo
                 continue;
 
             if (pGradient->GetName() == rName)
-                return XGradient(pGradient->GetGradient());
+                return pGradient->GetGradient();
         }
     }
     catch (...)
@@ -163,7 +163,7 @@ XHatch getXHatchFromName(const css::uno::Reference<css::frame::XModel>& xModel,
             {
                 // we need to update the hatch name
                 rName = pHatch->GetName();
-                return XHatch(pHatch->GetHatch());
+                return pHatch->GetHatch();
             }
         }
     }
diff --git a/chart2/source/model/template/DataInterpreter.cxx b/chart2/source/model/template/DataInterpreter.cxx
index a29d49afd2c0..940287572b51 100644
--- a/chart2/source/model/template/DataInterpreter.cxx
+++ b/chart2/source/model/template/DataInterpreter.cxx
@@ -297,7 +297,7 @@ Reference< data::XDataSource > SAL_CALL DataInterpreter::mergeInterpretedData(
         }
     }
 
-    return Reference< data::XDataSource >( DataSourceHelper::createDataSource( comphelper::containerToSequence( aResultVec ) ) );
+    return DataSourceHelper::createDataSource( comphelper::containerToSequence( aResultVec ) );
 }
 
 // convenience methods
diff --git a/chart2/source/tools/CachedDataSequence.cxx b/chart2/source/tools/CachedDataSequence.cxx
index 72f2e544e79e..6c3024726585 100644
--- a/chart2/source/tools/CachedDataSequence.cxx
+++ b/chart2/source/tools/CachedDataSequence.cxx
@@ -226,7 +226,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( CachedDataSequence, CachedDataSequence_Base, O
 // ____ XPropertySet ____
 Reference< beans::XPropertySetInfo > SAL_CALL CachedDataSequence::getPropertySetInfo()
 {
-    return Reference< beans::XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) );
+    return createPropertySetInfo( getInfoHelper() );
 }
 
 // ____ ::comphelper::OPropertySetHelper ____
diff --git a/chart2/source/tools/UncachedDataSequence.cxx b/chart2/source/tools/UncachedDataSequence.cxx
index 682500515416..6ace68e005de 100644
--- a/chart2/source/tools/UncachedDataSequence.cxx
+++ b/chart2/source/tools/UncachedDataSequence.cxx
@@ -125,7 +125,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( UncachedDataSequence, UncachedDataSequence_Bas
 // ____ XPropertySet ____
 Reference< beans::XPropertySetInfo > SAL_CALL UncachedDataSequence::getPropertySetInfo()
 {
-    return Reference< beans::XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) );
+    return createPropertySetInfo( getInfoHelper() );
 }
 
 // ____ ::comphelper::OPropertySetHelper ____
diff --git a/chart2/source/view/diagram/VDiagram.cxx b/chart2/source/view/diagram/VDiagram.cxx
index 829cb3265260..4c5bac5abfc0 100644
--- a/chart2/source/view/diagram/VDiagram.cxx
+++ b/chart2/source/view/diagram/VDiagram.cxx
@@ -142,7 +142,7 @@ void VDiagram::createShapes( const awt::Point& rPos, const awt::Size& rSize )
         m_xWall2D->setPosition(m_aCurrentPosWithoutAxes);
     }
 
-    return ::basegfx::B2IRectangle( BaseGFXHelper::makeRectangle(m_aCurrentPosWithoutAxes,m_aCurrentSizeWithoutAxes) );
+    return BaseGFXHelper::makeRectangle(m_aCurrentPosWithoutAxes,m_aCurrentSizeWithoutAxes);
 }
 
 void VDiagram::createShapes_2d()
@@ -462,7 +462,7 @@ void VDiagram::adjustAspectRatio3d( const awt::Size& rAvailableSize )
          rPos, rAvailableSize, m_aCurrentSizeWithoutAxes );
     m_xOuterGroupShape->setPosition(m_aCurrentPosWithoutAxes);
 
-    return ::basegfx::B2IRectangle( BaseGFXHelper::makeRectangle(m_aCurrentPosWithoutAxes,m_aCurrentSizeWithoutAxes) );
+    return BaseGFXHelper::makeRectangle(m_aCurrentPosWithoutAxes,m_aCurrentSizeWithoutAxes);
 }
 
 void VDiagram::createShapes_3d()
diff --git a/compilerplugins/clang/redundantfcast.cxx b/compilerplugins/clang/redundantfcast.cxx
index 811c6d48647c..89e5618e19da 100644
--- a/compilerplugins/clang/redundantfcast.cxx
+++ b/compilerplugins/clang/redundantfcast.cxx
@@ -21,6 +21,45 @@ public:
     {
     }
 
+    bool TraverseFunctionDecl(FunctionDecl* functionDecl)
+    {
+        auto prev = m_CurrentFunctionDecl;
+        m_CurrentFunctionDecl = functionDecl;
+        auto rv = RecursiveASTVisitor<RedundantFCast>::TraverseFunctionDecl(functionDecl);
+        m_CurrentFunctionDecl = prev;
+        return rv;
+    }
+
+    bool VisitReturnStmt(ReturnStmt const* returnStmt)
+    {
+        if (ignoreLocation(returnStmt))
+            return true;
+        Expr const* expr = returnStmt->getRetValue();
+        if (!expr)
+            return true;
+        if (auto exprWithCleanups = dyn_cast<ExprWithCleanups>(expr))
+            expr = exprWithCleanups->getSubExpr();
+        if (auto cxxConstructExpr = dyn_cast<CXXConstructExpr>(expr))
+        {
+            if (cxxConstructExpr->getNumArgs() != 1)
+                return true;
+            expr = cxxConstructExpr->getArg(0);
+        }
+        if (auto materializeTemporaryExpr = dyn_cast<MaterializeTemporaryExpr>(expr))
+            expr = materializeTemporaryExpr->GetTemporaryExpr();
+        auto cxxFunctionalCastExpr = dyn_cast<CXXFunctionalCastExpr>(expr);
+        if (!cxxFunctionalCastExpr)
+            return true;
+        auto const t1 = cxxFunctionalCastExpr->getTypeAsWritten();
+        auto const t2 = compat::getSubExprAsWritten(cxxFunctionalCastExpr)->getType();
+        if (t1.getCanonicalType().getTypePtr() != t2.getCanonicalType().getTypePtr())
+            return true;
+        report(DiagnosticsEngine::Warning, "redundant functional cast from %0 to %1",
+               cxxFunctionalCastExpr->getExprLoc())
+            << t2 << t1 << cxxFunctionalCastExpr->getSourceRange();
+        return true;
+    }
+
     /* Check for the creation of unnecessary temporaries when calling a method that takes a param by const & */
     bool VisitCallExpr(CallExpr const* callExpr)
     {
@@ -104,6 +143,7 @@ private:
             TraverseDecl(compiler.getASTContext().getTranslationUnitDecl());
         }
     }
+    FunctionDecl const* m_CurrentFunctionDecl;
 };
 
 static loplugin::Plugin::Registration<RedundantFCast> reg("redundantfcast");
diff --git a/compilerplugins/clang/test/redundantfcast.cxx b/compilerplugins/clang/test/redundantfcast.cxx
index 609b787347e1..da7e8be5a027 100644
--- a/compilerplugins/clang/test/redundantfcast.cxx
+++ b/compilerplugins/clang/test/redundantfcast.cxx
@@ -56,4 +56,13 @@ int main()
         foo)); // expected-error at -1 {{redundant functional cast from 'Foo' to 'Foo' [loplugin:redundantfcast]}}
 }
 
+class Class1
+{
+    Foo foo;
+    Foo func2()
+    {
+        return Foo(
+            foo); // expected-error at -1 {{redundant functional cast from 'Foo' to 'Foo' [loplugin:redundantfcast]}}
+    }
+};
 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */
diff --git a/connectivity/source/drivers/firebird/StatementCommonBase.cxx b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
index 3b6c0040e67b..dafc9e3d1972 100644
--- a/connectivity/source/drivers/firebird/StatementCommonBase.cxx
+++ b/connectivity/source/drivers/firebird/StatementCommonBase.cxx
@@ -451,7 +451,7 @@ sal_Int32 OStatementCommonBase::getStatementChangeCount()
 
             if (aToken == aDesiredInfoType)
             {
-                return sal_Int32(isc_vax_integer(pResults + 3, aLength));
+                return isc_vax_integer(pResults + 3, aLength);
             }
 
             pResults += (3 + aLength);
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index 10a08db16bba..e66632f02487 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -856,7 +856,7 @@ Reference< XPreparedStatement > ODatabaseExport::createPreparedStatment( const R
 
     aSql += aValues;
     // now create,fill and execute the prepared statement
-    return Reference< XPreparedStatement >(_xMetaData->getConnection()->prepareStatement(aSql));
+    return _xMetaData->getConnection()->prepareStatement(aSql);
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/desktop/source/deployment/inc/dp_ucb.h b/desktop/source/deployment/inc/dp_ucb.h
index 85d6b358c46f..a5fa819cec94 100644
--- a/desktop/source/deployment/inc/dp_ucb.h
+++ b/desktop/source/deployment/inc/dp_ucb.h
@@ -51,8 +51,7 @@ struct DESKTOP_DEPLOYMENTMISC_DLLPUBLIC StrTitle
         createCursor( ::ucbhelper::Content &rContent,
                       ucbhelper::ResultSetInclude eInclude )
     {
-        return css::uno::Reference< css::sdbc::XResultSet >(
-                rContent.createCursor( StrTitle::getTitleSequence(), eInclude ) );
+        return rContent.createCursor( StrTitle::getTitleSequence(), eInclude );
     }
 };
 
diff --git a/filter/source/svg/svgdialog.cxx b/filter/source/svg/svgdialog.cxx
index fcaaa05f24eb..ddf3693c37df 100644
--- a/filter/source/svg/svgdialog.cxx
+++ b/filter/source/svg/svgdialog.cxx
@@ -136,7 +136,7 @@ void SVGDialog::executedDialog( sal_Int16 nExecutionResult )
 
 Reference< XPropertySetInfo > SAL_CALL SVGDialog::getPropertySetInfo()
 {
-    return Reference< XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) );
+    return createPropertySetInfo( getInfoHelper() );
 }
 
 
diff --git a/framework/source/services/pathsettings.cxx b/framework/source/services/pathsettings.cxx
index 2ccbb899a03a..a4169b48f1f7 100644
--- a/framework/source/services/pathsettings.cxx
+++ b/framework/source/services/pathsettings.cxx
@@ -1387,8 +1387,7 @@ void SAL_CALL PathSettings::getFastPropertyValue(css::uno::Any& aValue ,
 
 css::uno::Reference< css::beans::XPropertySetInfo > SAL_CALL PathSettings::getPropertySetInfo()
 {
-    return css::uno::Reference< css::beans::XPropertySetInfo >(
-            ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper()));
+    return ::cppu::OPropertySetHelper::createPropertySetInfo(getInfoHelper());
 }
 
 css::uno::Reference< css::util::XStringSubstitution > PathSettings::fa_getSubstitution()
diff --git a/framework/source/uielement/statusbaritem.cxx b/framework/source/uielement/statusbaritem.cxx
index a4b02738fe9a..959ea4fbec29 100644
--- a/framework/source/uielement/statusbaritem.cxx
+++ b/framework/source/uielement/statusbaritem.cxx
@@ -119,7 +119,7 @@ OUString SAL_CALL StatusbarItem::getCommand()
     if ( m_pStatusBar )
         return m_pStatusBar->GetItemOffset( m_nId );
 
-    return ::sal_Int32(0);
+    return 0;
 }
 
 css::awt::Rectangle SAL_CALL StatusbarItem::getItemRect()
diff --git a/i18nutil/source/utility/oneToOneMapping.cxx b/i18nutil/source/utility/oneToOneMapping.cxx
index 2488f7950fae..388722bfc7b5 100644
--- a/i18nutil/source/utility/oneToOneMapping.cxx
+++ b/i18nutil/source/utility/oneToOneMapping.cxx
@@ -49,11 +49,11 @@ sal_Unicode oneToOneMapping::find(const sal_Unicode nKey) const
                 return mpTable[current].second;
 
             if( bottom > top )
-                return sal_Unicode( nKey );
+                return nKey;
         }
     }
     else
-        return sal_Unicode( nKey );
+        return nKey;
 }
 
 oneToOneMappingWithFlag::oneToOneMappingWithFlag( UnicodePairWithFlag *rpTableWF, const size_t rnSize, const UnicodePairFlag rnFlag )
@@ -117,7 +117,7 @@ sal_Unicode oneToOneMappingWithFlag::find( const sal_Unicode nKey ) const
                 mpIndex[high][low]->flag & mnFlag )
                 return mpIndex[high][low]->second;
             else
-                return sal_Unicode( nKey );
+                return nKey;
         }
         else
         {
@@ -136,16 +136,16 @@ sal_Unicode oneToOneMappingWithFlag::find( const sal_Unicode nKey ) const
                     if( mpTableWF[current].flag & mnFlag )
                         return mpTableWF[current].second;
                     else
-                        return sal_Unicode( nKey );
+                        return nKey;
                 }
 
                 if( bottom > top )
-                    return sal_Unicode( nKey );
+                    return nKey;
             }
         }
     }
     else
-        return sal_Unicode( nKey );
+        return nKey;
 }
 
 
diff --git a/include/svl/zforlist.hxx b/include/svl/zforlist.hxx
index e0c2b95d61c9..dbc4929fef50 100644
--- a/include/svl/zforlist.hxx
+++ b/include/svl/zforlist.hxx
@@ -62,7 +62,7 @@ constexpr size_t NF_MAX_FORMAT_SYMBOLS = 100;
 /// number formatter was constructed with.
 constexpr sal_uInt32 NF_STANDARD_FORMAT_TEXT = SV_MAX_COUNT_STANDARD_FORMATS;
 
-#define NUMBERFORMAT_ENTRY_NOT_FOUND sal_uInt32(0xffffffff)   /// MAX_ULONG
+constexpr sal_uInt32 NUMBERFORMAT_ENTRY_NOT_FOUND  = 0xffffffff;   /// MAX_ULONG
 
 enum class SvNumFormatType : sal_Int16
 {
diff --git a/include/ucbhelper/macros.hxx b/include/ucbhelper/macros.hxx
index da0b2dea8feb..36cf524f1fda 100644
--- a/include/ucbhelper/macros.hxx
+++ b/include/ucbhelper/macros.hxx
@@ -179,13 +179,11 @@ Class::getSupportedServiceNames()                                           \
 css::uno::Reference< css::lang::XSingleServiceFactory >       \
 Class::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )    \
 {                                                                           \
-    return css::uno::Reference<                                  \
-        css::lang::XSingleServiceFactory >(                      \
-            cppu::createOneInstanceFactory(                                 \
+    return cppu::createOneInstanceFactory(                                  \
                 rxServiceMgr,                                               \
                 Class::getImplementationName_Static(),                      \
                 Class##_CreateInstance,                                     \
-                Class::getSupportedServiceNames_Static() ) );               \
+                Class::getSupportedServiceNames_Static() );                 \
 }
 
 #endif /* ! INCLUDED_UCBHELPER_MACROS_HXX */
diff --git a/pyuno/source/module/pyuno.cxx b/pyuno/source/module/pyuno.cxx
index 5098c803b5f8..ee66c7537d8d 100644
--- a/pyuno/source/module/pyuno.cxx
+++ b/pyuno/source/module/pyuno.cxx
@@ -1713,7 +1713,7 @@ PyRef PyUNO_new (
         {
             sal_Int64 that = xUnoTunnel->getSomething( ::pyuno::Adapter::getUnoTunnelImplementationId() );
             if( that )
-                return PyRef( reinterpret_cast<Adapter*>(that)->getWrappedObject() );
+                return reinterpret_cast<Adapter*>(that)->getWrappedObject();
         }
     }
     if( !Py_IsInitialized() )
diff --git a/reportdesign/source/core/sdr/RptObject.cxx b/reportdesign/source/core/sdr/RptObject.cxx
index 563457987da3..d8a341119882 100644
--- a/reportdesign/source/core/sdr/RptObject.cxx
+++ b/reportdesign/source/core/sdr/RptObject.cxx
@@ -640,7 +640,7 @@ void OUnoObject::impl_setReportComponent_nothrow()
 
 sal_uInt16 OUnoObject::GetObjIdentifier() const
 {
-    return sal_uInt16(m_nObjectType);
+    return m_nObjectType;
 }
 
 SdrInventor OUnoObject::GetObjInventor() const
diff --git a/sc/source/ui/vba/vbaapplication.cxx b/sc/source/ui/vba/vbaapplication.cxx
index 978de7118fce..5cb76a9d6192 100644
--- a/sc/source/ui/vba/vbaapplication.cxx
+++ b/sc/source/ui/vba/vbaapplication.cxx
@@ -352,7 +352,7 @@ ScVbaApplication::Workbooks( const uno::Any& aIndex )
         return uno::Any( xWorkBooks );
     }
 
-    return uno::Any ( xWorkBooks->Item( aIndex, uno::Any() ) );
+    return xWorkBooks->Item( aIndex, uno::Any() );
 }
 
 uno::Any SAL_CALL
@@ -384,7 +384,7 @@ ScVbaApplication::Dialogs( const uno::Any &aIndex )
     uno::Reference< excel::XDialogs > xDialogs( new ScVbaDialogs( uno::Reference< XHelperInterface >( this ), mxContext, getCurrentDocument() ) );
     if( !aIndex.hasValue() )
         return uno::Any( xDialogs );
-    return uno::Any( xDialogs->Item( aIndex ) );
+    return xDialogs->Item( aIndex );
 }
 
 uno::Reference< excel::XWindow > SAL_CALL
@@ -480,7 +480,7 @@ ScVbaApplication::Windows( const uno::Any& aIndex  )
     uno::Reference< excel::XWindows >  xWindows( new ScVbaWindows( this, mxContext ) );
     if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
         return uno::Any( xWindows );
-    return uno::Any( xWindows->Item( aIndex, uno::Any() ) );
+    return xWindows->Item( aIndex, uno::Any() );
 }
 void SAL_CALL
 ScVbaApplication::wait( double time )
@@ -520,8 +520,8 @@ ScVbaApplication::Names( const css::uno::Any& aIndex )
     if (  aIndex.getValueTypeClass() == uno::TypeClass_VOID )
     {
         return uno::Any( xNames );
-}
-    return uno::Any( xNames->Item( aIndex, uno::Any() ) );
+    }
+    return xNames->Item( aIndex, uno::Any() );
 }
 
 uno::Reference< excel::XWorksheet > SAL_CALL
@@ -1332,7 +1332,7 @@ ScVbaApplication::MenuBars( const uno::Any& aIndex )
     uno::Reference< XCollection > xMenuBars( new ScVbaMenuBars( this, mxContext, xCommandBars ) );
     if (  aIndex.hasValue() )
     {
-        return uno::Any ( xMenuBars->Item( aIndex, uno::Any() ) );
+        return xMenuBars->Item( aIndex, uno::Any() );
     }
 
     return uno::Any( xMenuBars );
diff --git a/sc/source/ui/vba/vbaglobals.cxx b/sc/source/ui/vba/vbaglobals.cxx
index c4636c7bf1f0..bc5c4ef22edb 100644
--- a/sc/source/ui/vba/vbaglobals.cxx
+++ b/sc/source/ui/vba/vbaglobals.cxx
@@ -93,7 +93,7 @@ ScVbaGlobals::getActiveSheet()
 uno::Any SAL_CALL
 ScVbaGlobals::WorkBooks( const uno::Any& aIndex )
 {
-    return uno::Any( getApplication()->Workbooks(aIndex) );
+    return getApplication()->Workbooks(aIndex);
 }
 
 uno::Any SAL_CALL
@@ -221,7 +221,7 @@ ScVbaGlobals::getDebug()
 uno::Any SAL_CALL
 ScVbaGlobals::MenuBars( const uno::Any& aIndex )
 {
-    return uno::Any( getApplication()->MenuBars(aIndex) );
+    return getApplication()->MenuBars(aIndex);
 }
 
 uno::Sequence< OUString > SAL_CALL
diff --git a/sc/source/ui/vba/vbainterior.cxx b/sc/source/ui/vba/vbainterior.cxx
index 783baa466705..9e0019dbdf29 100644
--- a/sc/source/ui/vba/vbainterior.cxx
+++ b/sc/source/ui/vba/vbainterior.cxx
@@ -257,7 +257,7 @@ ScVbaInterior::GetAttributeData( uno::Any const & aValue )
     {
         return aDataValue.Value.toInt32();
     }
-    return sal_Int32( 0 );
+    return 0;
 }
 uno::Any
 ScVbaInterior::SetAttributeData( sal_Int32 nValue )
diff --git a/sc/source/ui/vba/vbaworkbook.cxx b/sc/source/ui/vba/vbaworkbook.cxx
index f0a6432df330..de08c8b59114 100644
--- a/sc/source/ui/vba/vbaworkbook.cxx
+++ b/sc/source/ui/vba/vbaworkbook.cxx
@@ -245,7 +245,7 @@ ScVbaWorkbook::Worksheets( const uno::Any& aIndex )
         return uno::Any( xWorkSheets );
     }
     // pass on to collection
-    return uno::Any( xWorkSheets->Item( aIndex, uno::Any() ) );
+    return xWorkSheets->Item( aIndex, uno::Any() );
 }
 uno::Any SAL_CALL
 ScVbaWorkbook::Windows( const uno::Any& aIndex )
@@ -254,7 +254,7 @@ ScVbaWorkbook::Windows( const uno::Any& aIndex )
     uno::Reference< excel::XWindows >  xWindows( new ScVbaWindows( getParent(), mxContext ) );
     if ( aIndex.getValueTypeClass() == uno::TypeClass_VOID )
         return uno::Any( xWindows );
-    return uno::Any( xWindows->Item( aIndex, uno::Any() ) );
+    return xWindows->Item( aIndex, uno::Any() );
 }
 
 void SAL_CALL
@@ -373,7 +373,7 @@ ScVbaWorkbook::Names( const uno::Any& aIndex )
     uno::Reference< sheet::XNamedRanges > xNamedRanges(  xProps->getPropertyValue("NamedRanges"), uno::UNO_QUERY_THROW );
     uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, xModel ) );
     if ( aIndex.hasValue() )
-        return uno::Any( xNames->Item( aIndex, uno::Any() ) );
+        return xNames->Item( aIndex, uno::Any() );
     return uno::Any( xNames );
 }
 
diff --git a/sc/source/ui/vba/vbaworksheet.cxx b/sc/source/ui/vba/vbaworksheet.cxx
index ff3aa2895ca0..427c5b8eecf5 100644
--- a/sc/source/ui/vba/vbaworksheet.cxx
+++ b/sc/source/ui/vba/vbaworksheet.cxx
@@ -789,7 +789,7 @@ ScVbaWorksheet::Names( const css::uno::Any& aIndex )
     uno::Reference< sheet::XNamedRanges > xNamedRanges(  xProps->getPropertyValue("NamedRanges"), uno::UNO_QUERY_THROW );
     uno::Reference< XCollection > xNames( new ScVbaNames( this, mxContext, xNamedRanges, mxModel ) );
     if ( aIndex.hasValue() )
-        return uno::Any( xNames->Item( aIndex, uno::Any() ) );
+        return xNames->Item( aIndex, uno::Any() );
     return uno::Any( xNames );
 }
 
diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx
index 7388da69d427..56e404560f48 100644
--- a/sfx2/source/view/classificationcontroller.cxx
+++ b/sfx2/source/view/classificationcontroller.cxx
@@ -168,7 +168,7 @@ uno::Reference<awt::XWindow> ClassificationCategoriesController::createItemWindo
         m_pClassification->getCategory()->SetSelectHdl(LINK(this, ClassificationCategoriesController, SelectHdl));
     }
 
-    return uno::Reference<awt::XWindow>(VCLUnoHelper::GetInterface(m_pClassification));
+    return VCLUnoHelper::GetInterface(m_pClassification);
 }
 
 IMPL_LINK(ClassificationCategoriesController, SelectHdl, ListBox&, rCategory, void)
diff --git a/svgio/source/svgreader/svgtools.cxx b/svgio/source/svgreader/svgtools.cxx
index a0024730f89a..b6e1d23f2a24 100644
--- a/svgio/source/svgreader/svgtools.cxx
+++ b/svgio/source/svgreader/svgtools.cxx
@@ -612,7 +612,7 @@ namespace svgio
         {
             if(nChar >= '0' && nChar <= '9')
             {
-                return sal_Int32(nChar - u'0');
+                return nChar - u'0';
             }
             else if(nChar >= 'A' && nChar <= 'F')
             {
diff --git a/svtools/source/table/tablecontrol.cxx b/svtools/source/table/tablecontrol.cxx
index 13a30e37a2c1..bfe82edbe926 100644
--- a/svtools/source/table/tablecontrol.cxx
+++ b/svtools/source/table/tablecontrol.cxx
@@ -207,7 +207,7 @@ namespace svt { namespace table
 
     sal_Int32 TableControl::GetSelectedRowIndex( sal_Int32 const i_selectionIndex ) const
     {
-        return sal_Int32( m_pImpl->getSelectedRowIndex( i_selectionIndex ) );
+        return m_pImpl->getSelectedRowIndex( i_selectionIndex );
     }
 
 
diff --git a/svx/source/svdraw/sdrpaintwindow.cxx b/svx/source/svdraw/sdrpaintwindow.cxx
index 5373093eb5b4..1a2c6b3d3dab 100644
--- a/svx/source/svdraw/sdrpaintwindow.cxx
+++ b/svx/source/svdraw/sdrpaintwindow.cxx
@@ -271,7 +271,7 @@ rtl::Reference< sdr::overlay::OverlayManager > const & SdrPaintWindow::GetOverla
 tools::Rectangle SdrPaintWindow::GetVisibleArea() const
 {
     Size aVisSizePixel(GetOutputDevice().GetOutputSizePixel());
-    return tools::Rectangle(GetOutputDevice().PixelToLogic(tools::Rectangle(Point(0,0), aVisSizePixel)));
+    return GetOutputDevice().PixelToLogic(tools::Rectangle(Point(0,0), aVisSizePixel));
 }
 
 bool SdrPaintWindow::OutputToRecordingMetaFile() const
diff --git a/sw/source/ui/vba/vbadocument.cxx b/sw/source/ui/vba/vbadocument.cxx
index f987b31e7717..ca77dc62a799 100644
--- a/sw/source/ui/vba/vbadocument.cxx
+++ b/sw/source/ui/vba/vbadocument.cxx
@@ -155,7 +155,7 @@ SwVbaDocument::Bookmarks( const uno::Any& rIndex )
     if (  rIndex.getValueTypeClass() == uno::TypeClass_VOID )
         return uno::makeAny( xBookmarksVba );
 
-    return uno::Any( xBookmarksVba->Item( rIndex, uno::Any() ) );
+    return xBookmarksVba->Item( rIndex, uno::Any() );
 }
 
 uno::Any SAL_CALL
@@ -169,7 +169,7 @@ SwVbaDocument::Variables( const uno::Any& rIndex )
     if (  rIndex.getValueTypeClass() == uno::TypeClass_VOID )
         return uno::makeAny( xVariables );
 
-    return uno::Any( xVariables->Item( rIndex, uno::Any() ) );
+    return xVariables->Item( rIndex, uno::Any() );
 }
 
 uno::Any SAL_CALL
diff --git a/sw/source/ui/vba/vbawindow.cxx b/sw/source/ui/vba/vbawindow.cxx
index 5f5749d0f5c4..458fb400d758 100644
--- a/sw/source/ui/vba/vbawindow.cxx
+++ b/sw/source/ui/vba/vbawindow.cxx
@@ -120,7 +120,7 @@ SwVbaWindow::Panes( const uno::Any& aIndex )
     if(  aIndex.getValueTypeClass() == uno::TypeClass_VOID )
         return uno::makeAny( xPanes );
 
-    return uno::Any( xPanes->Item( aIndex, uno::Any() ) );
+    return xPanes->Item( aIndex, uno::Any() );
 }
 
 uno::Any SAL_CALL
diff --git a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
index 2452cea5b51e..c5175c6b8585 100644
--- a/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
+++ b/sw/source/uibase/dbui/mailmergetoolbarcontrols.cxx
@@ -181,7 +181,7 @@ uno::Reference<awt::XWindow> MMCurrentEntryController::createItemWindow(const un
         m_pCurrentEdit->SetModifyHdl(LINK(this, MMCurrentEntryController, CurrentEditUpdatedHdl));
     }
 
-    return uno::Reference<awt::XWindow>(VCLUnoHelper::GetInterface(m_pCurrentEdit));
+    return VCLUnoHelper::GetInterface(m_pCurrentEdit);
 }
 
 IMPL_LINK(MMCurrentEntryController, CurrentEditUpdatedHdl, Edit&, rEdit, void)
@@ -252,7 +252,7 @@ uno::Reference<awt::XWindow> MMExcludeEntryController::createItemWindow(const un
         m_pExcludeCheckbox->SetToggleHdl(LINK(this, MMExcludeEntryController, ExcludeHdl));
     }
 
-    return uno::Reference<awt::XWindow>(VCLUnoHelper::GetInterface(m_pExcludeCheckbox));
+    return VCLUnoHelper::GetInterface(m_pExcludeCheckbox);
 }
 
 IMPL_STATIC_LINK(MMExcludeEntryController, ExcludeHdl, CheckBox&, rCheckbox, void)
diff --git a/toolkit/source/controls/roadmapentry.cxx b/toolkit/source/controls/roadmapentry.cxx
index 1efe5b39ee57..5a35fca98d01 100644
--- a/toolkit/source/controls/roadmapentry.cxx
+++ b/toolkit/source/controls/roadmapentry.cxx
@@ -70,8 +70,7 @@ IMPLEMENT_FORWARD_XTYPEPROVIDER2( ORoadmapEntry, ORoadmapEntry_Base, ::comphelpe
 css::uno::Reference< css:: beans::XPropertySetInfo > SAL_CALL
     ORoadmapEntry::getPropertySetInfo()
 {
-    return css::uno::Reference< css::beans::XPropertySetInfo >(
-        createPropertySetInfo( getInfoHelper() ) );
+    return createPropertySetInfo( getInfoHelper() );
 }
 
 OUString SAL_CALL ORoadmapEntry::getImplementationName(  )
diff --git a/ucb/source/core/cmdenv.cxx b/ucb/source/core/cmdenv.cxx
index 03f84b893189..8c84e37a90cb 100644
--- a/ucb/source/core/cmdenv.cxx
+++ b/ucb/source/core/cmdenv.cxx
@@ -140,12 +140,11 @@ uno::Reference< lang::XSingleServiceFactory >
 UcbCommandEnvironment::createServiceFactory(
     const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
 {
-    return uno::Reference< lang::XSingleServiceFactory >(
-            cppu::createSingleFactory(
+    return cppu::createSingleFactory(
                 rxServiceMgr,
                 UcbCommandEnvironment::getImplementationName_Static(),
                 UcbCommandEnvironment_CreateInstance,
-                UcbCommandEnvironment::getSupportedServiceNames_Static() ) );
+                UcbCommandEnvironment::getSupportedServiceNames_Static() );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucb/source/core/ucbcmds.cxx b/ucb/source/core/ucbcmds.cxx
index bcedf21be3d6..9bfcd10883e2 100644
--- a/ucb/source/core/ucbcmds.cxx
+++ b/ucb/source/core/ucbcmds.cxx
@@ -252,7 +252,7 @@ CommandProcessorInfo::getCommandInfoByName( const OUString& Name )
     for ( sal_Int32 n = 0; n < m_pInfo->getLength(); ++n )
     {
         if ( (*m_pInfo)[ n ].Name == Name )
-            return ucb::CommandInfo( (*m_pInfo)[ n ] );
+            return (*m_pInfo)[ n ];
     }
 
     throw ucb::UnsupportedCommandException();
@@ -266,7 +266,7 @@ CommandProcessorInfo::getCommandInfoByHandle( sal_Int32 Handle )
     for ( sal_Int32 n = 0; n < m_pInfo->getLength(); ++n )
     {
         if ( (*m_pInfo)[ n ].Handle == Handle )
-            return ucb::CommandInfo( (*m_pInfo)[ n ] );
+            return (*m_pInfo)[ n ];
     }
 
     throw ucb::UnsupportedCommandException();
diff --git a/ucb/source/sorter/sortdynres.cxx b/ucb/source/sorter/sortdynres.cxx
index 114d29c5f2e6..e3b20bd62539 100644
--- a/ucb/source/sorter/sortdynres.cxx
+++ b/ucb/source/sorter/sortdynres.cxx
@@ -459,12 +459,11 @@ css::uno::Sequence< OUString > SortedDynamicResultSetFactory::getSupportedServic
 css::uno::Reference< css::lang::XSingleServiceFactory >
 SortedDynamicResultSetFactory::createServiceFactory( const css::uno::Reference< css::lang::XMultiServiceFactory >& rxServiceMgr )
 {
-    return css::uno::Reference< css::lang::XSingleServiceFactory >(
-            cppu::createOneInstanceFactory(
+    return cppu::createOneInstanceFactory(
                     rxServiceMgr,
                     SortedDynamicResultSetFactory::getImplementationName_Static(),
                     SortedDynamicResultSetFactory_CreateInstance,
-                    SortedDynamicResultSetFactory::getSupportedServiceNames_Static() ) );
+                    SortedDynamicResultSetFactory::getSupportedServiceNames_Static() );
 }
 
 // SortedDynamicResultSetFactory methods.
diff --git a/ucb/source/ucp/file/filrset.hxx b/ucb/source/ucp/file/filrset.hxx
index fb6ec0a59313..61322afe7be5 100644
--- a/ucb/source/ucp/file/filrset.hxx
+++ b/ucb/source/ucp/file/filrset.hxx
@@ -158,7 +158,7 @@ class XResultSet_impl : public Notifier,
             if( 0 <= m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) )
                 return m_aItems[m_nRow]->getInt( columnIndex );
             else
-                return sal_Int32( 0 );
+                return 0;
         }
 
         virtual sal_Int64 SAL_CALL
diff --git a/ucb/source/ucp/file/prov.cxx b/ucb/source/ucp/file/prov.cxx
index 1c41642e30ce..e4cd53b40d99 100644
--- a/ucb/source/ucp/file/prov.cxx
+++ b/ucb/source/ucp/file/prov.cxx
@@ -140,11 +140,11 @@ Reference< XSingleServiceFactory >
 FileProvider::createServiceFactory(
                    const Reference< XMultiServiceFactory >& rxServiceMgr )
 {
-    return Reference< XSingleServiceFactory > ( cppu::createSingleFactory(
+    return cppu::createSingleFactory(
         rxServiceMgr,
         fileaccess::TaskManager::getImplementationName_static(),
         FileProvider::CreateInstance,
-        fileaccess::TaskManager::getSupportedServiceNames_static() ) );
+        fileaccess::TaskManager::getSupportedServiceNames_static() );
 }
 
 Reference< XInterface > SAL_CALL
diff --git a/ucb/source/ucp/ftp/ftpcontentprovider.cxx b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
index 1719d53efc47..80dffdce8659 100644
--- a/ucb/source/ucp/ftp/ftpcontentprovider.cxx
+++ b/ucb/source/ucp/ftp/ftpcontentprovider.cxx
@@ -136,13 +136,11 @@ css::uno::Reference< css::lang::XSingleServiceFactory >
 FTPContentProvider::createServiceFactory( const css::uno::Reference<
             css::lang::XMultiServiceFactory >& rxServiceMgr )
 {
-    return css::uno::Reference<
-        css::lang::XSingleServiceFactory >(
-            cppu::createOneInstanceFactory(
+    return cppu::createOneInstanceFactory(
                 rxServiceMgr,
                 FTPContentProvider::getImplementationName_Static(),
                 FTPContentProvider_CreateInstance,
-                FTPContentProvider::getSupportedServiceNames_Static() ) );
+                FTPContentProvider::getSupportedServiceNames_Static() );
 }
 
 // XContentProvider methods.
diff --git a/ucb/source/ucp/ftp/ftpresultsetbase.hxx b/ucb/source/ucp/ftp/ftpresultsetbase.hxx
index 0cf1e638a468..aae070a6a38e 100644
--- a/ucb/source/ucp/ftp/ftpresultsetbase.hxx
+++ b/ucb/source/ucp/ftp/ftpresultsetbase.hxx
@@ -134,7 +134,7 @@ namespace ftp {
             if( 0 <= m_nRow && m_nRow < sal::static_int_cast<sal_Int32>(m_aItems.size()) )
                 return m_aItems[m_nRow]->getInt( columnIndex );
             else
-                return sal_Int32( 0 );
+                return 0;
         }
 
         virtual sal_Int64 SAL_CALL
diff --git a/ucb/source/ucp/tdoc/tdoc_content.cxx b/ucb/source/ucp/tdoc/tdoc_content.cxx
index e046b118a22d..67984008aabd 100644
--- a/ucb/source/ucp/tdoc/tdoc_content.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_content.cxx
@@ -2696,8 +2696,7 @@ uno::Reference< io::XInputStream > Content::getInputStream(
         try
         {
             osl::Guard< osl::Mutex > aGuard( m_aMutex );
-            return uno::Reference< io::XInputStream >(
-                m_pProvider->queryInputStream( aUri, aPassword ) );
+            return m_pProvider->queryInputStream( aUri, aPassword );
         }
         catch ( packages::WrongPasswordException const & )
         {
@@ -2727,9 +2726,8 @@ static uno::Reference< io::XOutputStream > lcl_getTruncatedOutputStream(
     {
         try
         {
-            return uno::Reference< io::XOutputStream >(
-                pProvider->queryOutputStream(
-                    rUri, aPassword, true /* truncate */ ) );
+            return pProvider->queryOutputStream(
+                    rUri, aPassword, true /* truncate */ );
         }
         catch ( packages::WrongPasswordException const & )
         {
@@ -2774,9 +2772,8 @@ uno::Reference< io::XStream > Content::getStream(
     {
         try
         {
-            return uno::Reference< io::XStream >(
-                m_pProvider->queryStream(
-                    aUri, aPassword, false /* no truncate */ ) );
+            return m_pProvider->queryStream(
+                    aUri, aPassword, false /* no truncate */ );
         }
         catch ( packages::WrongPasswordException const & )
         {
diff --git a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
index 1bf916d3c35e..9a33a88bcc66 100644
--- a/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
+++ b/ucb/source/ucp/tdoc/tdoc_documentcontentfactory.cxx
@@ -136,12 +136,11 @@ uno::Reference< lang::XSingleServiceFactory >
 DocumentContentFactory::createServiceFactory(
     const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
 {
-    return uno::Reference< lang::XSingleServiceFactory >(
-            cppu::createOneInstanceFactory(
+    return cppu::createOneInstanceFactory(
                 rxServiceMgr,
                 DocumentContentFactory::getImplementationName_Static(),
                 DocumentContentFactory_CreateInstance,
-                DocumentContentFactory::getSupportedServiceNames_Static() ) );
+                DocumentContentFactory::getSupportedServiceNames_Static() );
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/ucbhelper/source/provider/propertyvalueset.cxx b/ucbhelper/source/provider/propertyvalueset.cxx
index 9bc72f9ebb9f..0ac8509ab60c 100644
--- a/ucbhelper/source/provider/propertyvalueset.cxx
+++ b/ucbhelper/source/provider/propertyvalueset.cxx
@@ -565,7 +565,7 @@ sal_Int32 SAL_CALL PropertyValueSet::findColumn( const OUString& columnName )
         for ( sal_Int32 n = 0; n < nCount; ++n )
         {
             if ( (*m_pValues)[ n ].sPropertyName == columnName  )
-                return sal_Int32( n + 1 ); // Index is 1-based.
+                return n + 1; // Index is 1-based.
         }
     }
     return 0;
diff --git a/uui/source/passwordcontainer.cxx b/uui/source/passwordcontainer.cxx
index 92a54f53fae7..82ee8ddf8b32 100644
--- a/uui/source/passwordcontainer.cxx
+++ b/uui/source/passwordcontainer.cxx
@@ -417,12 +417,11 @@ uno::Reference< lang::XSingleServiceFactory >
 PasswordContainerInteractionHandler::createServiceFactory(
     const uno::Reference< lang::XMultiServiceFactory >& rxServiceMgr )
 {
-    return uno::Reference< lang::XSingleServiceFactory >(
-        cppu::createOneInstanceFactory(
+    return cppu::createOneInstanceFactory(
             rxServiceMgr,
             PasswordContainerInteractionHandler::getImplementationName_Static(),
             PasswordContainerInteractionHandler_CreateInstance,
-            PasswordContainerInteractionHandler::getSupportedServiceNames_Static() ) );
+            PasswordContainerInteractionHandler::getSupportedServiceNames_Static() );
 }
 
 } // namespace uui
diff --git a/vbahelper/source/msforms/vbaframe.cxx b/vbahelper/source/msforms/vbaframe.cxx
index e85e313148b6..9fe25e5b554a 100644
--- a/vbahelper/source/msforms/vbaframe.cxx
+++ b/vbahelper/source/msforms/vbaframe.cxx
@@ -89,7 +89,7 @@ uno::Any SAL_CALL ScVbaFrame::Controls( const uno::Any& rIndex )
 
     uno::Reference< XCollection > xControls( new ScVbaControls( this, mxContext, mxDialog, m_xModel, fOffsetX, fOffsetY ) );
     if( rIndex.hasValue() )
-        return uno::Any( xControls->Item( rIndex, uno::Any() ) );
+        return xControls->Item( rIndex, uno::Any() );
     return uno::Any( xControls );
 }
 
diff --git a/xmlhelp/source/cxxhelp/provider/provider.cxx b/xmlhelp/source/cxxhelp/provider/provider.cxx
index 78912d06b0c5..4c4532569848 100644
--- a/xmlhelp/source/cxxhelp/provider/provider.cxx
+++ b/xmlhelp/source/cxxhelp/provider/provider.cxx
@@ -152,13 +152,11 @@ css::uno::Reference< css::lang::XSingleServiceFactory >
 ContentProvider::createServiceFactory( const css::uno::Reference<
             css::lang::XMultiServiceFactory >& rxServiceMgr )
 {
-    return css::uno::Reference<
-        css::lang::XSingleServiceFactory >(
-            cppu::createOneInstanceFactory(
+    return cppu::createOneInstanceFactory(
                 rxServiceMgr,
                 ContentProvider::getImplementationName_Static(),
                 ContentProvider_CreateInstance,
-                ContentProvider::getSupportedServiceNames_Static() ) );
+                ContentProvider::getSupportedServiceNames_Static() );
 }
 
 // XContentProvider methods.
diff --git a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx
index 9c1a016030dd..d684db8f5b66 100644
--- a/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx
+++ b/xmlhelp/source/cxxhelp/provider/resultsetbase.hxx
@@ -133,7 +133,7 @@ namespace chelp {
             if( 0 <= m_nRow && sal::static_int_cast<sal_uInt32>( m_nRow ) < m_aItems.size() )
                 return m_aItems[m_nRow]->getInt( columnIndex );
             else
-                return sal_Int32( 0 );
+                return 0;
         }
 
         virtual sal_Int64 SAL_CALL
diff --git a/xmlhelp/source/treeview/tvfactory.cxx b/xmlhelp/source/treeview/tvfactory.cxx
index 9edb304cd791..30fcd22bff43 100644
--- a/xmlhelp/source/treeview/tvfactory.cxx
+++ b/xmlhelp/source/treeview/tvfactory.cxx
@@ -142,12 +142,11 @@ Reference< XSingleServiceFactory >
 TVFactory::createServiceFactory(
     const Reference< XMultiServiceFactory >& rxServiceMgr )
 {
-    return Reference< XSingleServiceFactory > (
-        cppu::createSingleFactory(
+    return cppu::createSingleFactory(
             rxServiceMgr,
             TVFactory::getImplementationName_static(),
             TVFactory::CreateInstance,
-            TVFactory::getSupportedServiceNames_static() ) );
+            TVFactory::getSupportedServiceNames_static() );
 }
 
 Reference< XInterface > SAL_CALL
diff --git a/xmlsecurity/source/component/certificatecontainer.cxx b/xmlsecurity/source/component/certificatecontainer.cxx
index 1e6c4facc8b2..c110ebb64e6f 100644
--- a/xmlsecurity/source/component/certificatecontainer.cxx
+++ b/xmlsecurity/source/component/certificatecontainer.cxx
@@ -109,7 +109,7 @@ CertificateContainer::hasCertificate( const OUString & url, const OUString & cer
     if ( isTemporaryCertificate( url, certificate_name ) )
     {
         if ( isCertificateTrust( url, certificate_name ) )
-            return security::CertificateContainerStatus( security::CertificateContainerStatus_TRUSTED );
+            return security::CertificateContainerStatus_TRUSTED;
         else
             return security::CertificateContainerStatus_UNTRUSTED;
     } else


More information about the Libreoffice-commits mailing list