Kaydet (Commit) 897493fb authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:sequentialassign in ucb..vbahelper

Change-Id: I0fff9ee06225d4ff2e9c0611b1b11f1d3b896be2
Reviewed-on: https://gerrit.libreoffice.org/70733
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst 7facde27
...@@ -2136,8 +2136,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetFactory ...@@ -2136,8 +2136,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetFactory
const Reference< XResultSet > & xSource, const Reference< XResultSet > & xSource,
const Reference< XContentIdentifierMapping > & xMapping ) const Reference< XContentIdentifierMapping > & xMapping )
{ {
Reference< XResultSet > xRet; Reference< XResultSet > xRet = new CachedContentResultSet( m_xContext, xSource, xMapping );
xRet = new CachedContentResultSet( m_xContext, xSource, xMapping );
return xRet; return xRet;
} }
......
...@@ -572,8 +572,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetStubFactory ...@@ -572,8 +572,7 @@ Reference< XResultSet > SAL_CALL CachedContentResultSetStubFactory
{ {
if( xSource.is() ) if( xSource.is() )
{ {
Reference< XResultSet > xRet; Reference< XResultSet > xRet = new CachedContentResultSetStub( xSource );
xRet = new CachedContentResultSetStub( xSource );
return xRet; return xRet;
} }
return nullptr; return nullptr;
......
...@@ -227,8 +227,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetFactory ...@@ -227,8 +227,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetFactory
const Reference< XDynamicResultSet > & SourceStub const Reference< XDynamicResultSet > & SourceStub
, const Reference< XContentIdentifierMapping > & ContentIdentifierMapping ) , const Reference< XContentIdentifierMapping > & ContentIdentifierMapping )
{ {
Reference< XDynamicResultSet > xRet; Reference< XDynamicResultSet > xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, m_xContext );
xRet = new CachedDynamicResultSet( SourceStub, ContentIdentifierMapping, m_xContext );
return xRet; return xRet;
} }
......
...@@ -218,8 +218,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetStubFactory ...@@ -218,8 +218,7 @@ Reference< XDynamicResultSet > SAL_CALL CachedDynamicResultSetStubFactory
::createCachedDynamicResultSetStub( ::createCachedDynamicResultSetStub(
const Reference< XDynamicResultSet > & Source ) const Reference< XDynamicResultSet > & Source )
{ {
Reference< XDynamicResultSet > xRet; Reference< XDynamicResultSet > xRet = new CachedDynamicResultSetStub( Source, m_xContext );
xRet = new CachedDynamicResultSetStub( Source, m_xContext );
return xRet; return xRet;
} }
......
...@@ -473,8 +473,7 @@ SortedDynamicResultSetFactory::createSortedDynamicResultSet( ...@@ -473,8 +473,7 @@ SortedDynamicResultSetFactory::createSortedDynamicResultSet(
const Sequence< NumberedSortingInfo > & Info, const Sequence< NumberedSortingInfo > & Info,
const Reference< XAnyCompareFactory > & CompareFactory ) const Reference< XAnyCompareFactory > & CompareFactory )
{ {
Reference< XDynamicResultSet > xRet; Reference< XDynamicResultSet > xRet = new SortedDynamicResultSet( Source, Info, CompareFactory, m_xContext );
xRet = new SortedDynamicResultSet( Source, Info, CompareFactory, m_xContext );
return xRet; return xRet;
} }
......
...@@ -584,8 +584,7 @@ void Content::queryChildren( ContentRefList& rChildren ) ...@@ -584,8 +584,7 @@ void Content::queryChildren( ContentRefList& rChildren )
// Is aURL a prefix of aChildURL? // Is aURL a prefix of aChildURL?
if ( ( aChildURL.getLength() > nLen ) && aChildURL.startsWith( aURL ) ) if ( ( aChildURL.getLength() > nLen ) && aChildURL.startsWith( aURL ) )
{ {
sal_Int32 nPos = nLen; sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
nPos = aChildURL.indexOf( '/', nPos );
if ( ( nPos == -1 ) || ( nPos == ( aChildURL.getLength() - 1 ) ) ) if ( ( nPos == -1 ) || ( nPos == ( aChildURL.getLength() - 1 ) ) )
{ {
......
...@@ -751,8 +751,7 @@ void HierarchyContent::queryChildren( HierarchyContentRefVector& rChildren ) ...@@ -751,8 +751,7 @@ void HierarchyContent::queryChildren( HierarchyContentRefVector& rChildren )
if ( ( aChildURL.getLength() > nLen ) && if ( ( aChildURL.getLength() > nLen ) &&
( aChildURL.startsWith( aURL ) ) ) ( aChildURL.startsWith( aURL ) ) )
{ {
sal_Int32 nPos = nLen; sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
nPos = aChildURL.indexOf( '/', nPos );
if ( ( nPos == -1 ) || if ( ( nPos == -1 ) ||
( nPos == ( aChildURL.getLength() - 1 ) ) ) ( nPos == ( aChildURL.getLength() - 1 ) ) )
......
...@@ -214,9 +214,7 @@ Content* Content::create( ...@@ -214,9 +214,7 @@ Content* Content::create(
getContentType( aURI.getScheme(), false ) ) ) getContentType( aURI.getScheme(), false ) ) )
return nullptr; return nullptr;
uno::Reference< container::XHierarchicalNameAccess > xPackage; uno::Reference< container::XHierarchicalNameAccess > xPackage = pProvider->createPackage( aURI );
xPackage = pProvider->createPackage( aURI );
uno::Reference< ucb::XContentIdentifier > xId uno::Reference< ucb::XContentIdentifier > xId
= new ::ucbhelper::ContentIdentifier( aURI.getUri() ); = new ::ucbhelper::ContentIdentifier( aURI.getUri() );
......
...@@ -738,8 +738,7 @@ void Content::queryChildren( ContentRefList& rChildren ) ...@@ -738,8 +738,7 @@ void Content::queryChildren( ContentRefList& rChildren )
if ( ( aChildURL.getLength() > nLen ) && if ( ( aChildURL.getLength() > nLen ) &&
( aChildURL.startsWith( aURL ) ) ) ( aChildURL.startsWith( aURL ) ) )
{ {
sal_Int32 nPos = nLen; sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
nPos = aChildURL.indexOf( '/', nPos );
if ( ( nPos == -1 ) || if ( ( nPos == -1 ) ||
( nPos == ( aChildURL.getLength() - 1 ) ) ) ( nPos == ( aChildURL.getLength() - 1 ) ) )
......
...@@ -107,8 +107,7 @@ bool DAVOptionsCache::getDAVOptions( const OUString & rURL, DAVOptions & rDAVOpt ...@@ -107,8 +107,7 @@ bool DAVOptionsCache::getDAVOptions( const OUString & rURL, DAVOptions & rDAVOpt
normalizeURLLastChar( aEncodedUrl ); normalizeURLLastChar( aEncodedUrl );
// search the URL in the static map // search the URL in the static map
DAVOptionsMap::iterator it; DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
it = m_aTheCache.find( aEncodedUrl );
if ( it == m_aTheCache.end() ) if ( it == m_aTheCache.end() )
return false; return false;
else else
...@@ -134,8 +133,7 @@ void DAVOptionsCache::removeDAVOptions( const OUString & rURL ) ...@@ -134,8 +133,7 @@ void DAVOptionsCache::removeDAVOptions( const OUString & rURL )
OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) ); OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) );
normalizeURLLastChar( aEncodedUrl ); normalizeURLLastChar( aEncodedUrl );
DAVOptionsMap::iterator it; DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
it = m_aTheCache.find( aEncodedUrl );
if ( it != m_aTheCache.end() ) if ( it != m_aTheCache.end() )
{ {
m_aTheCache.erase( it ); m_aTheCache.erase( it );
...@@ -156,8 +154,7 @@ void DAVOptionsCache::addDAVOptions( DAVOptions & rDAVOptions, const sal_uInt32 ...@@ -156,8 +154,7 @@ void DAVOptionsCache::addDAVOptions( DAVOptions & rDAVOptions, const sal_uInt32
rDAVOptions.setRedirectedURL( aRedirURL ); rDAVOptions.setRedirectedURL( aRedirURL );
// check if already cached // check if already cached
DAVOptionsMap::iterator it; DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
it = m_aTheCache.find( aEncodedUrl );
if ( it != m_aTheCache.end() ) if ( it != m_aTheCache.end() )
{ // already in cache, check LifeTime { // already in cache, check LifeTime
if ( (*it).second.getRequestedTimeLife() == nLifeTime ) if ( (*it).second.getRequestedTimeLife() == nLifeTime )
...@@ -177,8 +174,7 @@ void DAVOptionsCache::setHeadAllowed( const OUString & rURL, const bool HeadAllo ...@@ -177,8 +174,7 @@ void DAVOptionsCache::setHeadAllowed( const OUString & rURL, const bool HeadAllo
OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) ); OUString aEncodedUrl( ucb_impl::urihelper::encodeURI( NeonUri::unescape( rURL ) ) );
normalizeURLLastChar( aEncodedUrl ); normalizeURLLastChar( aEncodedUrl );
DAVOptionsMap::iterator it; DAVOptionsMap::iterator it = m_aTheCache.find( aEncodedUrl );
it = m_aTheCache.find( aEncodedUrl );
if ( it != m_aTheCache.end() ) if ( it != m_aTheCache.end() )
{ {
// first check for stale // first check for stale
......
...@@ -43,8 +43,7 @@ namespace webdav_ucp ...@@ -43,8 +43,7 @@ namespace webdav_ucp
{ {
// search the URL in the static map // search the URL in the static map
osl::MutexGuard aGuard( m_aMutex ); osl::MutexGuard aGuard( m_aMutex );
PropNameCache::const_iterator it; PropNameCache::const_iterator it = m_aTheCache.find( rURL );
it = m_aTheCache.find( rURL );
if ( it == m_aTheCache.end() ) if ( it == m_aTheCache.end() )
return false; return false;
else else
...@@ -67,8 +66,7 @@ namespace webdav_ucp ...@@ -67,8 +66,7 @@ namespace webdav_ucp
void PropertyNamesCache::removeCachedPropertyNames( const OUString& rURL ) void PropertyNamesCache::removeCachedPropertyNames( const OUString& rURL )
{ {
osl::MutexGuard aGuard( m_aMutex ); osl::MutexGuard aGuard( m_aMutex );
PropNameCache::const_iterator it; PropNameCache::const_iterator it = m_aTheCache.find( rURL );
it = m_aTheCache.find( rURL );
if ( it != m_aTheCache.end() ) if ( it != m_aTheCache.end() )
{ {
m_aTheCache.erase( it ); m_aTheCache.erase( it );
......
...@@ -2403,8 +2403,7 @@ void Content::queryChildren( ContentRefList& rChildren ) ...@@ -2403,8 +2403,7 @@ void Content::queryChildren( ContentRefList& rChildren )
if ( ( aChildURL.getLength() > nLen ) && if ( ( aChildURL.getLength() > nLen ) &&
( aChildURL.startsWith( aURL ) ) ) ( aChildURL.startsWith( aURL ) ) )
{ {
sal_Int32 nPos = nLen; sal_Int32 nPos = aChildURL.indexOf( '/', nLen );
nPos = aChildURL.indexOf( '/', nPos );
if ( ( nPos == -1 ) || if ( ( nPos == -1 ) ||
( nPos == ( aChildURL.getLength() - 1 ) ) ) ( nPos == ( aChildURL.getLength() - 1 ) ) )
......
...@@ -298,8 +298,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen ...@@ -298,8 +298,7 @@ Sequence< OUString > SvtCompatibilityOptions_Impl::impl_GetPropertyNames( Sequen
// Copy entries to destination and expand every item with 2 supported sub properties. // Copy entries to destination and expand every item with 2 supported sub properties.
for ( sal_Int32 nSourceStep = 0; nSourceStep < nSourceCount; ++nSourceStep ) for ( sal_Int32 nSourceStep = 0; nSourceStep < nSourceCount; ++nSourceStep )
{ {
OUString sFixPath; OUString sFixPath = SETNODE_ALLFILEFORMATS;
sFixPath = SETNODE_ALLFILEFORMATS;
sFixPath += PATHDELIMITER; sFixPath += PATHDELIMITER;
sFixPath += rItems[ nSourceStep ]; sFixPath += rItems[ nSourceStep ];
sFixPath += PATHDELIMITER; sFixPath += PATHDELIMITER;
......
...@@ -137,8 +137,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp ...@@ -137,8 +137,7 @@ void SvtOptionsDlgOptions_Impl::ReadNode( const OUString& _rNode, NodeType _eTyp
if ( _eType != NT_Option ) if ( _eType != NT_Option )
lResult[1] = sNode + sSet; lResult[1] = sNode + sSet;
Sequence< Any > aValues; Sequence< Any > aValues = GetProperties( lResult );
aValues = GetProperties( lResult );
bool bHide = false; bool bHide = false;
if ( aValues[0] >>= bHide ) if ( aValues[0] >>= bHide )
m_aOptionNodeList.emplace( sNode, bHide ); m_aOptionNodeList.emplace( sNode, bHide );
......
...@@ -682,9 +682,8 @@ static bool UCBOpenContentSync( ...@@ -682,9 +682,8 @@ static bool UCBOpenContentSync(
sal_uInt32 nTimeout(5000); // initially 5000 milliSec sal_uInt32 nTimeout(5000); // initially 5000 milliSec
while(!bResultAchieved) { while(!bResultAchieved) {
Moderator::Result res;
// try to get the result for with timeout // try to get the result for with timeout
res = pMod->getResult(nTimeout); Moderator::Result res = pMod->getResult(nTimeout);
switch(res.type) { switch(res.type) {
case Moderator::ResultType::STREAM: case Moderator::ResultType::STREAM:
......
...@@ -28,9 +28,8 @@ using namespace css; ...@@ -28,9 +28,8 @@ using namespace css;
IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl, weld::Button&, void) IMPL_LINK_NOARG(SSLWarnDialog, ViewCertHdl, weld::Button&, void)
{ {
uno::Reference< css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures; uno::Reference< css::security::XDocumentDigitalSignatures > xDocumentDigitalSignatures
= css::security::DocumentDigitalSignatures::createDefault( m_xContext );
xDocumentDigitalSignatures = css::security::DocumentDigitalSignatures::createDefault( m_xContext );
xDocumentDigitalSignatures->setParentWindow(m_xDialog->GetXWindow()); xDocumentDigitalSignatures->setParentWindow(m_xDialog->GetXWindow());
xDocumentDigitalSignatures->showCertificate(m_rXCert); xDocumentDigitalSignatures->showCertificate(m_rXCert);
} }
......
...@@ -50,8 +50,7 @@ ScVbaTextBox::setValue( const uno::Any& _value ) ...@@ -50,8 +50,7 @@ ScVbaTextBox::setValue( const uno::Any& _value )
OUString SAL_CALL OUString SAL_CALL
ScVbaTextBox::getText() ScVbaTextBox::getText()
{ {
uno::Any aValue; uno::Any aValue = m_xProps->getPropertyValue( "Text" );
aValue = m_xProps->getPropertyValue( "Text" );
OUString sString; OUString sString;
aValue >>= sString; aValue >>= sString;
return sString; return sString;
...@@ -75,8 +74,7 @@ ScVbaTextBox::setText( const OUString& _text ) ...@@ -75,8 +74,7 @@ ScVbaTextBox::setText( const OUString& _text )
sal_Int32 SAL_CALL sal_Int32 SAL_CALL
ScVbaTextBox::getMaxLength() ScVbaTextBox::getMaxLength()
{ {
uno::Any aValue; uno::Any aValue = m_xProps->getPropertyValue( "MaxTextLen" );
aValue = m_xProps->getPropertyValue( "MaxTextLen" );
sal_Int16 nMaxLength = 0; sal_Int16 nMaxLength = 0;
aValue >>= nMaxLength; aValue >>= nMaxLength;
return static_cast<sal_Int32>(nMaxLength); return static_cast<sal_Int32>(nMaxLength);
...@@ -93,8 +91,7 @@ ScVbaTextBox::setMaxLength( sal_Int32 _maxlength ) ...@@ -93,8 +91,7 @@ ScVbaTextBox::setMaxLength( sal_Int32 _maxlength )
sal_Bool SAL_CALL sal_Bool SAL_CALL
ScVbaTextBox::getMultiline() ScVbaTextBox::getMultiline()
{ {
uno::Any aValue; uno::Any aValue = m_xProps->getPropertyValue( "MultiLine" );
aValue = m_xProps->getPropertyValue( "MultiLine" );
bool bRet = false; bool bRet = false;
aValue >>= bRet; aValue >>= bRet;
return bRet; return bRet;
......
...@@ -180,10 +180,8 @@ bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUStri ...@@ -180,10 +180,8 @@ bool VbaCommandBarHelper::hasToolbar( const OUString& sResourceUrl, const OUStri
// return the resource url if found // return the resource url if found
OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName ) OUString VbaCommandBarHelper::findToolbarByName( const css::uno::Reference< css::container::XNameAccess >& xNameAccess, const OUString& sName )
{ {
OUString sResourceUrl;
// check if it is an buildin toolbar // check if it is an buildin toolbar
sResourceUrl = MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName ); OUString sResourceUrl = MSO2OOCommandbarHelper::getMSO2OOCommandbarHelper()->findBuildinToolbar( sName );
if( !sResourceUrl.isEmpty() ) if( !sResourceUrl.isEmpty() )
return sResourceUrl; return sResourceUrl;
......
...@@ -259,8 +259,7 @@ VbaFontBase::getName() ...@@ -259,8 +259,7 @@ VbaFontBase::getName()
uno::Any uno::Any
VbaFontBase::getColor() VbaFontBase::getColor()
{ {
uno::Any aAny; uno::Any aAny = OORGBToXLRGB( mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharColor", "TextColor" ) ) );
aAny = OORGBToXLRGB( mxFont->getPropertyValue( VBAFONTBASE_PROPNAME( "CharColor", "TextColor" ) ) );
return aAny; return aAny;
} }
......
...@@ -283,8 +283,7 @@ ScVbaShape::setLeft( double _left ) ...@@ -283,8 +283,7 @@ ScVbaShape::setLeft( double _left )
} }
catch( uno::Exception& ) catch( uno::Exception& )
{ {
sal_Int32 nLeft = 0; sal_Int32 nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left );
nLeft = Millimeter::getInHundredthsOfOneMillimeter( _left );
m_xPropertySet->setPropertyValue( "HoriOrientPosition" , uno::makeAny( nLeft ) ); m_xPropertySet->setPropertyValue( "HoriOrientPosition" , uno::makeAny( nLeft ) );
} }
} }
...@@ -315,8 +314,7 @@ ScVbaShape::setTop( double _top ) ...@@ -315,8 +314,7 @@ ScVbaShape::setTop( double _top )
} }
catch( uno::Exception& ) catch( uno::Exception& )
{ {
sal_Int32 nTop = 0; sal_Int32 nTop = Millimeter::getInHundredthsOfOneMillimeter( _top );
nTop = Millimeter::getInHundredthsOfOneMillimeter( _top );
m_xPropertySet->setPropertyValue( "VertOrientPosition" , uno::makeAny( nTop ) ); m_xPropertySet->setPropertyValue( "VertOrientPosition" , uno::makeAny( nTop ) );
} }
} }
......
...@@ -139,8 +139,7 @@ ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index ) ...@@ -139,8 +139,7 @@ ScVbaShapes::getShapesByArrayIndices( const uno::Any& Index )
throw uno::RuntimeException(); throw uno::RuntimeException();
const uno::Reference< script::XTypeConverter >& xConverter = getTypeConverter(mxContext); const uno::Reference< script::XTypeConverter >& xConverter = getTypeConverter(mxContext);
uno::Any aConverted; uno::Any aConverted = xConverter->convertTo( Index, cppu::UnoType<uno::Sequence< uno::Any >>::get() );
aConverted = xConverter->convertTo( Index, cppu::UnoType<uno::Sequence< uno::Any >>::get() );
uno::Sequence< uno::Any > sIndices; uno::Sequence< uno::Any > sIndices;
aConverted >>= sIndices; aConverted >>= sIndices;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment