Kaydet (Commit) 2f5868c4 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:redundantfcast look for redundant copies in return statements

Change-Id: I5f416c865dfe1c36018784246a8007452eb42008
Reviewed-on: https://gerrit.libreoffice.org/50996Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst cb34e608
......@@ -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();
}
}
}
......
......@@ -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
......
......@@ -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 ____
......
......@@ -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 ____
......
......@@ -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()
......
......@@ -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");
......
......@@ -56,4 +56,13 @@ int main()
foo)); // expected-error@-1 {{redundant functional cast from 'Foo' to 'Foo' [loplugin:redundantfcast]}}
}
class Class1
{
Foo foo;
Foo func2()
{
return Foo(
foo); // expected-error@-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: */
......@@ -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);
......
......@@ -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: */
......@@ -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 );
}
};
......
......@@ -136,7 +136,7 @@ void SVGDialog::executedDialog( sal_Int16 nExecutionResult )
Reference< XPropertySetInfo > SAL_CALL SVGDialog::getPropertySetInfo()
{
return Reference< XPropertySetInfo >( createPropertySetInfo( getInfoHelper() ) );
return createPropertySetInfo( getInfoHelper() );
}
......
......@@ -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()
......
......@@ -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()
......
......@@ -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;
}
......
......@@ -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
{
......
......@@ -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 */
......
......@@ -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() )
......
......@@ -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
......
......@@ -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 );
......
......@@ -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
......
......@@ -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 )
......
......@@ -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 );
}
......
......@@ -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 );
}
......
......@@ -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)
......
......@@ -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')
{
......
......@@ -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 );
}
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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)
......
......@@ -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( )
......
......@@ -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: */
......@@ -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();
......
......@@ -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.
......
......@@ -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
......
......@@ -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
......
......@@ -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.
......
......@@ -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
......
......@@ -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 & )
{
......
......@@ -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: */
......@@ -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;
......
......@@ -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
......
......@@ -89,7 +89,7 @@ uno::Any SAL_CALL ScVbaFrame::Controls( const uno::Any& rIndex )
<