Kaydet (Commit) 725a1f51 authored tarafından Noel Grandin's avatar Noel Grandin

loplugin:sequentialassign in comphelper..cui

Change-Id: I1a08f3684b785e31535adcfb4220ded267a77c3b
Reviewed-on: https://gerrit.libreoffice.org/70643
Tested-by: Jenkins
Reviewed-by: 's avatarNoel Grandin <noel.grandin@collabora.co.uk>
üst c36e7f44
...@@ -58,8 +58,7 @@ void setProcessServiceFactory(const Reference< XMultiServiceFactory >& xSMgr) ...@@ -58,8 +58,7 @@ void setProcessServiceFactory(const Reference< XMultiServiceFactory >& xSMgr)
Reference< XMultiServiceFactory > getProcessServiceFactory() Reference< XMultiServiceFactory > getProcessServiceFactory()
{ {
Reference< XMultiServiceFactory> xReturn; Reference< XMultiServiceFactory> xReturn = localProcessFactory( xReturn, false );
xReturn = localProcessFactory( xReturn, false );
if ( !xReturn.is() ) if ( !xReturn.is() )
{ {
throw DeploymentException( "null process service factory" ); throw DeploymentException( "null process service factory" );
......
...@@ -49,8 +49,7 @@ void CanvasTest::testComposite() ...@@ -49,8 +49,7 @@ void CanvasTest::testComposite()
// a huge canvas ... // a huge canvas ...
Size aSize (1, 1); Size aSize (1, 1);
uno::Reference<rendering::XBitmap> xBitmap; uno::Reference<rendering::XBitmap> xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap(
xBitmap = xCanvas->getDevice ()->createCompatibleAlphaBitmap(
vcl::unotools::integerSize2DFromSize( aSize ) ); vcl::unotools::integerSize2DFromSize( aSize ) );
CPPUNIT_ASSERT( xBitmap.is() ); CPPUNIT_ASSERT( xBitmap.is() );
......
...@@ -2027,9 +2027,7 @@ namespace cppcanvas ...@@ -2027,9 +2027,7 @@ namespace cppcanvas
for( const auto& rVCLPolyPolygon : aVCLPolyPolyVector ) for( const auto& rVCLPolyPolygon : aVCLPolyPolyVector )
{ {
::basegfx::B2DPolyPolygon aPolyPolygon; ::basegfx::B2DPolyPolygon aPolyPolygon = rVCLPolyPolygon.getB2DPolyPolygon();
aPolyPolygon = rVCLPolyPolygon.getB2DPolyPolygon();
aPolyPolygon.transform( aMapModeTransform ); aPolyPolygon.transform( aMapModeTransform );
// append result to collecting polypoly // append result to collecting polypoly
......
...@@ -67,9 +67,7 @@ SvxEventConfigPage::SvxEventConfigPage(TabPageParent pParent, const SfxItemSet& ...@@ -67,9 +67,7 @@ SvxEventConfigPage::SvxEventConfigPage(TabPageParent pParent, const SfxItemSet&
m_xSaveInListBox->connect_changed( LINK( this, SvxEventConfigPage, m_xSaveInListBox->connect_changed( LINK( this, SvxEventConfigPage,
SelectHdl_Impl ) ); SelectHdl_Impl ) );
uno::Reference< frame::XGlobalEventBroadcaster > xSupplier; uno::Reference< frame::XGlobalEventBroadcaster > xSupplier =
xSupplier =
frame::theGlobalEventBroadcaster::get(::comphelper::getProcessComponentContext()); frame::theGlobalEventBroadcaster::get(::comphelper::getProcessComponentContext());
m_xAppEvents = xSupplier->getEvents(); m_xAppEvents = xSupplier->getEvents();
......
...@@ -204,8 +204,7 @@ void SvxHyperlinkNewDocTp::FillDocumentList () ...@@ -204,8 +204,7 @@ void SvxHyperlinkNewDocTp::FillDocumentList ()
if ( pFilter ) if ( pFilter )
{ {
// insert doc-name and image // insert doc-name and image
OUString aTitleName( aTitle ); OUString aTitleName = aTitle.replaceFirst( "~", "" );
aTitleName = aTitleName.replaceFirst( "~", "" );
sal_Int16 nPos = m_pLbDocTypes->InsertEntry ( aTitleName ); sal_Int16 nPos = m_pLbDocTypes->InsertEntry ( aTitleName );
OUString aStrDefExt( pFilter->GetDefaultExtension () ); OUString aStrDefExt( pFilter->GetDefaultExtension () );
......
...@@ -822,8 +822,7 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry) ...@@ -822,8 +822,7 @@ void SvxScriptOrgDialog::createEntry(weld::TreeIter& rEntry)
Sequence< sal_Int16 > outIndex; Sequence< sal_Int16 > outIndex;
try try
{ {
Any aResult; Any aResult = xInv->invoke( "Creatable", args, outIndex, outArgs );
aResult = xInv->invoke( "Creatable", args, outIndex, outArgs );
Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY ); Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY );
aChildNode = newNode; aChildNode = newNode;
...@@ -907,8 +906,7 @@ void SvxScriptOrgDialog::renameEntry(weld::TreeIter& rEntry) ...@@ -907,8 +906,7 @@ void SvxScriptOrgDialog::renameEntry(weld::TreeIter& rEntry)
Sequence< sal_Int16 > outIndex; Sequence< sal_Int16 > outIndex;
try try
{ {
Any aResult; Any aResult = xInv->invoke( "Renamable", args, outIndex, outArgs );
aResult = xInv->invoke( "Renamable", args, outIndex, outArgs );
Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY ); Reference< browse::XBrowseNode > newNode( aResult, UNO_QUERY );
aChildNode = newNode; aChildNode = newNode;
...@@ -959,8 +957,7 @@ void SvxScriptOrgDialog::deleteEntry(weld::TreeIter& rEntry) ...@@ -959,8 +957,7 @@ void SvxScriptOrgDialog::deleteEntry(weld::TreeIter& rEntry)
Sequence< sal_Int16 > outIndex; Sequence< sal_Int16 > outIndex;
try try
{ {
Any aResult; Any aResult = xInv->invoke( "Deletable", args, outIndex, outArgs );
aResult = xInv->invoke( "Deletable", args, outIndex, outArgs );
aResult >>= result; // or do we just assume true if no exception ? aResult >>= result; // or do we just assume true if no exception ?
} }
catch( Exception const & ) catch( Exception const & )
......
...@@ -678,8 +678,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void ) ...@@ -678,8 +678,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
{ {
//create string sequence from comma separated string //create string sequence from comma separated string
//uno::Sequence< OUString > seqStr; //uno::Sequence< OUString > seqStr;
std::vector< OUString > seqStr; std::vector< OUString > seqStr = commaStringToSequence( sNewValue );
seqStr = commaStringToSequence( sNewValue );
//create appropriate sequence with same size as string sequence //create appropriate sequence with same size as string sequence
uno::Sequence< sal_Int16 > seqShort( seqStr.size() ); uno::Sequence< sal_Int16 > seqShort( seqStr.size() );
...@@ -692,8 +691,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void ) ...@@ -692,8 +691,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
} }
else if( sPropertyType == "[]long" ) else if( sPropertyType == "[]long" )
{ {
std::vector< OUString > seqStrLong; std::vector< OUString > seqStrLong = commaStringToSequence( sNewValue );
seqStrLong = commaStringToSequence( sNewValue );
uno::Sequence< sal_Int32 > seqLong( seqStrLong.size() ); uno::Sequence< sal_Int32 > seqLong( seqStrLong.size() );
for( size_t i = 0; i < seqStrLong.size(); ++i ) for( size_t i = 0; i < seqStrLong.size(); ++i )
...@@ -704,8 +702,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void ) ...@@ -704,8 +702,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
} }
else if( sPropertyType == "[]hyper" ) else if( sPropertyType == "[]hyper" )
{ {
std::vector< OUString > seqStrHyper; std::vector< OUString > seqStrHyper = commaStringToSequence( sNewValue );
seqStrHyper = commaStringToSequence( sNewValue );
uno::Sequence< sal_Int64 > seqHyper( seqStrHyper.size() ); uno::Sequence< sal_Int64 > seqHyper( seqStrHyper.size() );
for( size_t i = 0; i < seqStrHyper.size(); ++i ) for( size_t i = 0; i < seqStrHyper.size(); ++i )
{ {
...@@ -715,8 +712,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void ) ...@@ -715,8 +712,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
} }
else if( sPropertyType == "[]double" ) else if( sPropertyType == "[]double" )
{ {
std::vector< OUString > seqStrDoub; std::vector< OUString > seqStrDoub = commaStringToSequence( sNewValue );
seqStrDoub = commaStringToSequence( sNewValue );
uno::Sequence< double > seqDoub( seqStrDoub.size() ); uno::Sequence< double > seqDoub( seqStrDoub.size() );
for( size_t i = 0; i < seqStrDoub.size(); ++i ) for( size_t i = 0; i < seqStrDoub.size(); ++i )
{ {
...@@ -726,8 +722,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void ) ...@@ -726,8 +722,7 @@ IMPL_LINK_NOARG( CuiAboutConfigTabPage, StandardHdl_Impl, Button*, void )
} }
else if( sPropertyType == "[]float" ) else if( sPropertyType == "[]float" )
{ {
std::vector< OUString > seqStrFloat; std::vector< OUString > seqStrFloat = commaStringToSequence( sNewValue );
seqStrFloat = commaStringToSequence( sNewValue );
uno::Sequence< sal_Int16 > seqFloat( seqStrFloat.size() ); uno::Sequence< sal_Int16 > seqFloat( seqStrFloat.size() );
for( size_t i = 0; i < seqStrFloat.size(); ++i ) for( size_t i = 0; i < seqStrFloat.size(); ++i )
{ {
......
...@@ -1462,8 +1462,7 @@ IMPL_LINK(SvxLinguTabPage, ClickHdl_Impl, weld::Button&, rBtn, void) ...@@ -1462,8 +1462,7 @@ IMPL_LINK(SvxLinguTabPage, ClickHdl_Impl, weld::Button&, rBtn, void)
sal_Int32 nDics = aDics.getLength(); sal_Int32 nDics = aDics.getLength();
if (nDicPos < nDics) if (nDicPos < nDics)
{ {
uno::Reference< XDictionary > xDic; uno::Reference< XDictionary > xDic = aDics.getConstArray()[ nDicPos ];
xDic = aDics.getConstArray()[ nDicPos ];
if (xDic.is()) if (xDic.is())
{ {
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
...@@ -1488,8 +1487,7 @@ IMPL_LINK(SvxLinguTabPage, ClickHdl_Impl, weld::Button&, rBtn, void) ...@@ -1488,8 +1487,7 @@ IMPL_LINK(SvxLinguTabPage, ClickHdl_Impl, weld::Button&, rBtn, void)
sal_Int32 nDics = aDics.getLength(); sal_Int32 nDics = aDics.getLength();
if (nDicPos < nDics) if (nDicPos < nDics)
{ {
uno::Reference< XDictionary > xDic; uno::Reference< XDictionary > xDic = aDics.getConstArray()[ nDicPos ];
xDic = aDics.getConstArray()[ nDicPos ];
if (xDic.is()) if (xDic.is())
{ {
if (LinguMgr::GetIgnoreAllList() == xDic) if (LinguMgr::GetIgnoreAllList() == xDic)
......
...@@ -408,8 +408,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* ) ...@@ -408,8 +408,7 @@ void SvxSaveTabPage::Reset( const SfxItemSet* )
for(sal_Int32 n = 0; n < aDocTypeLB->GetEntryCount(); n++) for(sal_Int32 n = 0; n < aDocTypeLB->GetEntryCount(); n++)
{ {
sal_IntPtr nData = reinterpret_cast<sal_IntPtr>(aDocTypeLB->GetEntryData(n)); sal_IntPtr nData = reinterpret_cast<sal_IntPtr>(aDocTypeLB->GetEntryData(n));
OUString sCommand; OUString sCommand = "getSortedFilterList():module=%1:iflags=" +
sCommand = "getSortedFilterList():module=%1:iflags=" +
OUString::number(static_cast<int>(SfxFilterFlags::IMPORT|SfxFilterFlags::EXPORT)) + OUString::number(static_cast<int>(SfxFilterFlags::IMPORT|SfxFilterFlags::EXPORT)) +
":eflags=" + ":eflags=" +
OUString::number(static_cast<int>(SfxFilterFlags::NOTINFILEDLG)); OUString::number(static_cast<int>(SfxFilterFlags::NOTINFILEDLG));
......
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