[Libreoffice-commits] core.git: sfx2/source slideshow/source solenv/bin

Noel Grandin (via logerrit) logerrit at kemper.freedesktop.org
Tue Apr 16 10:20:28 UTC 2019


 sfx2/source/appl/appserv.cxx                   |    3 +--
 sfx2/source/appl/newhelp.cxx                   |    3 +--
 sfx2/source/appl/sfxhelp.cxx                   |    3 +--
 sfx2/source/bastyp/helper.cxx                  |    3 +--
 sfx2/source/control/dispatch.cxx               |    4 +---
 sfx2/source/dialog/backingcomp.cxx             |    4 +---
 sfx2/source/dialog/filedlghelper.cxx           |    6 ++----
 sfx2/source/doc/DocumentSigner.cxx             |   12 ++++++------
 sfx2/source/doc/doctempl.cxx                   |    4 +---
 sfx2/source/doc/doctemplates.cxx               |    4 +---
 sfx2/source/doc/objstor.cxx                    |    6 ++----
 sfx2/source/doc/saveastemplatedlg.cxx          |    3 +--
 sfx2/source/doc/sfxbasemodel.cxx               |    3 +--
 sfx2/source/doc/templatedlg.cxx                |    4 +---
 sfx2/source/sidebar/UnoDeck.cxx                |    4 +---
 sfx2/source/styles/StyleManager.cxx            |    3 +--
 slideshow/source/engine/slideshowimpl.cxx      |    3 +--
 slideshow/source/engine/smilfunctionparser.cxx |    8 ++------
 solenv/bin/concat-deps.c                       |    4 +---
 19 files changed, 27 insertions(+), 57 deletions(-)

New commits:
commit f03310eac0162c8b582a0f5f6cb0489d29aaa488
Author:     Noel Grandin <noel.grandin at collabora.co.uk>
AuthorDate: Sat Apr 13 21:26:38 2019 +0200
Commit:     Noel Grandin <noel.grandin at collabora.co.uk>
CommitDate: Tue Apr 16 12:19:49 2019 +0200

    loplugin:sequentialassign in sfx2..solenv
    
    Change-Id: I57e11d45aad48713b7c6802e2b6976fd916fc6ba
    Reviewed-on: https://gerrit.libreoffice.org/70717
    Tested-by: Jenkins
    Reviewed-by: Noel Grandin <noel.grandin at collabora.co.uk>

diff --git a/sfx2/source/appl/appserv.cxx b/sfx2/source/appl/appserv.cxx
index 10141a85b467..74af18c0e071 100644
--- a/sfx2/source/appl/appserv.cxx
+++ b/sfx2/source/appl/appserv.cxx
@@ -1667,8 +1667,7 @@ void SfxApplication::OfaExec_Impl( SfxRequest& rReq )
             try
             {
                 Reference< uno::XComponentContext > xORB = ::comphelper::getProcessComponentContext();
-                Reference< ui::dialogs::XExecutableDialog > xDialog;
-                xDialog = ui::dialogs::AddressBookSourcePilot::createWithParent(xORB, nullptr);
+                Reference< ui::dialogs::XExecutableDialog > xDialog = ui::dialogs::AddressBookSourcePilot::createWithParent(xORB, nullptr);
                 xDialog->execute();
             }
             catch(const css::uno::Exception&)
diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx
index 646b4bd77c30..68480ed2aea5 100644
--- a/sfx2/source/appl/newhelp.cxx
+++ b/sfx2/source/appl/newhelp.cxx
@@ -1275,8 +1275,7 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl(vcl::Window* pParent, SfxHelpIndexW
     m_pBookmarksPB->SetClickHdl( LINK( this, BookmarksTabPage_Impl, OpenHdl ) );
 
     // load bookmarks from configuration
-    Sequence< Sequence< PropertyValue > > aBookmarkSeq;
-    aBookmarkSeq = SvtHistoryOptions().GetList( eHELPBOOKMARKS );
+    Sequence< Sequence< PropertyValue > > aBookmarkSeq = SvtHistoryOptions().GetList( eHELPBOOKMARKS );
 
     OUString aTitle;
     OUString aURL;
diff --git a/sfx2/source/appl/sfxhelp.cxx b/sfx2/source/appl/sfxhelp.cxx
index c75ada768e88..d2593d468129 100644
--- a/sfx2/source/appl/sfxhelp.cxx
+++ b/sfx2/source/appl/sfxhelp.cxx
@@ -818,8 +818,7 @@ bool rewriteFlatpakHelpRootUrl(OUString * helpRootUrl) {
             // Extract <sha> from ...;org.libreoffice.LibreOffice.Help=<sha>;...:
             OUString sha;
             for (sal_Int32 i = 0;;) {
-                OUString elem;
-                elem = extensions.getToken(0, ';', i);
+                OUString elem = extensions.getToken(0, ';', i);
                 if (elem.startsWith("org.libreoffice.LibreOffice.Help=", &sha)) {
                     break;
                 }
diff --git a/sfx2/source/bastyp/helper.cxx b/sfx2/source/bastyp/helper.cxx
index 6588834a3096..ee05b9e56079 100644
--- a/sfx2/source/bastyp/helper.cxx
+++ b/sfx2/source/bastyp/helper.cxx
@@ -136,8 +136,7 @@ std::vector< OUString > SfxContentHelper::GetHelpTreeViewContents( const OUStrin
 
         try
         {
-            uno::Reference< ucb::XDynamicResultSet > xDynResultSet;
-            xDynResultSet = aCnt.createDynamicCursor( aProps );
+            uno::Reference< ucb::XDynamicResultSet > xDynResultSet = aCnt.createDynamicCursor( aProps );
             if ( xDynResultSet.is() )
                 xResultSet = xDynResultSet->getStaticResultSet();
         }
diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx
index 6362252d4bd7..702e6064f157 100644
--- a/sfx2/source/control/dispatch.cxx
+++ b/sfx2/source/control/dispatch.cxx
@@ -1964,9 +1964,7 @@ SfxItemState SfxDispatcher::QueryState( sal_uInt16 nSID, css::uno::Any& rAny )
     const SfxSlot *pSlot = nullptr;
     if ( GetShellAndSlot_Impl( nSID, &pShell, &pSlot, false, true ) )
     {
-        const SfxPoolItem* pItem( nullptr );
-
-        pItem = pShell->GetSlotState( nSID );
+        const SfxPoolItem* pItem = pShell->GetSlotState( nSID );
         if ( !pItem )
             return SfxItemState::DISABLED;
         else
diff --git a/sfx2/source/dialog/backingcomp.cxx b/sfx2/source/dialog/backingcomp.cxx
index abf5ca90bada..ee47f60dcb1b 100644
--- a/sfx2/source/dialog/backingcomp.cxx
+++ b/sfx2/source/dialog/backingcomp.cxx
@@ -167,10 +167,8 @@ BackingComp::BackingComp()
 
 css::uno::Any SAL_CALL BackingComp::queryInterface( /*IN*/ const css::uno::Type& aType )
 {
-    css::uno::Any aResult;
-
     // first look for own supported interfaces
-    aResult = ::cppu::queryInterface(
+    css::uno::Any aResult = ::cppu::queryInterface(
                 aType,
                 static_cast< css::lang::XTypeProvider* >(this),
                 static_cast< css::lang::XServiceInfo* >(this),
diff --git a/sfx2/source/dialog/filedlghelper.cxx b/sfx2/source/dialog/filedlghelper.cxx
index a39fb30f51cd..121e696e714c 100644
--- a/sfx2/source/dialog/filedlghelper.cxx
+++ b/sfx2/source/dialog/filedlghelper.cxx
@@ -2770,15 +2770,13 @@ ErrCode RequestPassword(const std::shared_ptr<const SfxFilter>& pCurrentFilter,
 
 OUString EncodeSpaces_Impl( const OUString& rSource )
 {
-    OUString sRet( rSource );
-    sRet = sRet.replaceAll( " ", "%20" );
+    OUString sRet = rSource.replaceAll( " ", "%20" );
     return sRet;
 }
 
 OUString DecodeSpaces_Impl( const OUString& rSource )
 {
-    OUString sRet( rSource );
-    sRet = sRet.replaceAll( "%20", " " );
+    OUString sRet = rSource.replaceAll( "%20", " " );
     return sRet;
 }
 
diff --git a/sfx2/source/doc/DocumentSigner.cxx b/sfx2/source/doc/DocumentSigner.cxx
index 7e29b02b97b4..ceef0a1b0a9d 100644
--- a/sfx2/source/doc/DocumentSigner.cxx
+++ b/sfx2/source/doc/DocumentSigner.cxx
@@ -67,9 +67,9 @@ bool DocumentSigner::signDocument(uno::Reference<security::XCertificate> const&
         }
         if (xMetaInf.is())
         {
-            uno::Reference<embed::XStorage> xStorage;
-            xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromStream(
-                ZIP_STORAGE_FORMAT_STRING, xInputStream);
+            uno::Reference<embed::XStorage> xStorage
+                = comphelper::OStorageHelper::GetStorageOfFormatFromStream(
+                    ZIP_STORAGE_FORMAT_STRING, xInputStream);
 
             // ODF.
             uno::Reference<io::XStream> xStream;
@@ -89,9 +89,9 @@ bool DocumentSigner::signDocument(uno::Reference<security::XCertificate> const&
         }
         else if (xWriteableZipStore.is())
         {
-            uno::Reference<embed::XStorage> xStorage;
-            xStorage = comphelper::OStorageHelper::GetStorageOfFormatFromStream(
-                ZIP_STORAGE_FORMAT_STRING, xInputStream);
+            uno::Reference<embed::XStorage> xStorage
+                = comphelper::OStorageHelper::GetStorageOfFormatFromStream(
+                    ZIP_STORAGE_FORMAT_STRING, xInputStream);
 
             // OOXML.
             uno::Reference<io::XStream> xStream;
diff --git a/sfx2/source/doc/doctempl.cxx b/sfx2/source/doc/doctempl.cxx
index 95e23b67c4ba..7da29f337d47 100644
--- a/sfx2/source/doc/doctempl.cxx
+++ b/sfx2/source/doc/doctempl.cxx
@@ -1734,9 +1734,7 @@ bool getTextProperty_Impl( Content& rContent,
         }
 
         // now get the property
-        Any aAnyValue;
-
-        aAnyValue = rContent.getPropertyValue( rPropName );
+        Any aAnyValue = rContent.getPropertyValue( rPropName );
         aAnyValue >>= rPropValue;
 
         if ( SfxURLRelocator_Impl::propertyCanContainOfficeDir( rPropName ) )
diff --git a/sfx2/source/doc/doctemplates.cxx b/sfx2/source/doc/doctemplates.cxx
index 31f2a7e7951b..75dc7112002d 100644
--- a/sfx2/source/doc/doctemplates.cxx
+++ b/sfx2/source/doc/doctemplates.cxx
@@ -1778,9 +1778,7 @@ bool SfxDocTplService_Impl::storeTemplate( const OUString& rGroupName,
             throw uno::RuntimeException();
 
         // find the mediatype and extension
-        uno::Reference< container::XNameAccess > xTypeDetection;
-
-        xTypeDetection =
+        uno::Reference< container::XNameAccess > xTypeDetection =
             mxType.is() ?
                 uno::Reference< container::XNameAccess >( mxType, uno::UNO_QUERY_THROW ) :
                 uno::Reference< container::XNameAccess >(
diff --git a/sfx2/source/doc/objstor.cxx b/sfx2/source/doc/objstor.cxx
index c2429a78a6b2..4d3f2cc64925 100644
--- a/sfx2/source/doc/objstor.cxx
+++ b/sfx2/source/doc/objstor.cxx
@@ -2551,8 +2551,7 @@ bool SfxObjectShell::DoSave_Impl( const SfxItemSet* pArgs )
 
         SetError(pMediumTmp->GetErrorCode());
 
-        bool bOpen( false );
-        bOpen = DoSaveCompleted( pMediumTmp );
+        bool bOpen = DoSaveCompleted( pMediumTmp );
 
         DBG_ASSERT(bOpen,"Error handling for DoSaveCompleted not implemented");
     }
@@ -2859,8 +2858,7 @@ bool SfxObjectShell::PreDoSaveAs_Impl(const OUString& rFileName, const OUString&
             if ( !bCopyTo )
             {
                 // reconnect to the old medium
-                bool bRet( false );
-                bRet = DoSaveCompleted( pMedium );
+                bool bRet = DoSaveCompleted( pMedium );
                 DBG_ASSERT( bRet, "Error in DoSaveCompleted, can't be handled!");
             }
 
diff --git a/sfx2/source/doc/saveastemplatedlg.cxx b/sfx2/source/doc/saveastemplatedlg.cxx
index 289aec287401..a17ca283ed8f 100644
--- a/sfx2/source/doc/saveastemplatedlg.cxx
+++ b/sfx2/source/doc/saveastemplatedlg.cxx
@@ -121,8 +121,7 @@ void SfxSaveAsTemplateDialog::SetCategoryLBEntries(const std::vector<OUString>&
 
 bool SfxSaveAsTemplateDialog::IsTemplateNameUnique()
 {
-    std::vector<OUString>::iterator it;
-    it=find(msCategories.begin(), msCategories.end(), msSelectedCategory);
+    std::vector<OUString>::iterator it=find(msCategories.begin(), msCategories.end(), msSelectedCategory);
     mnRegionPos = std::distance(msCategories.begin(), it);
 
     sal_uInt16 nEntries = maDocTemplates.GetCount(mnRegionPos);
diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx
index 3cdc669a1f62..4bd6ab5f83ed 100644
--- a/sfx2/source/doc/sfxbasemodel.cxx
+++ b/sfx2/source/doc/sfxbasemodel.cxx
@@ -3502,10 +3502,9 @@ Reference< ui::XUIConfigurationManager2 > SfxBaseModel::getUIConfigurationManage
         if ( m_pData->m_pObjectShell->GetCreateMode() != SfxObjectCreateMode::EMBEDDED )
         {
             // Import old UI configuration from OOo 1.x
-            Reference< embed::XStorage > xOOo1ConfigStorage;
 
             // Try to open with READ
-            xOOo1ConfigStorage = getDocumentSubStorage( "Configurations", embed::ElementModes::READ );
+            Reference< embed::XStorage > xOOo1ConfigStorage = getDocumentSubStorage( "Configurations", embed::ElementModes::READ );
             if ( xOOo1ConfigStorage.is() )
             {
                 Reference< XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
diff --git a/sfx2/source/doc/templatedlg.cxx b/sfx2/source/doc/templatedlg.cxx
index 5d29aab49869..0136c425f987 100644
--- a/sfx2/source/doc/templatedlg.cxx
+++ b/sfx2/source/doc/templatedlg.cxx
@@ -761,9 +761,7 @@ void SfxTemplateManagerDlg::SearchUpdate()
 
         for (TemplateItemProperties& rItem : aItems)
         {
-            OUString aFolderName;
-
-            aFolderName = mxLocalView->getRegionName(rItem.nRegionId);
+            OUString aFolderName = mxLocalView->getRegionName(rItem.nRegionId);
 
             mxSearchView->AppendItem(rItem.nId,mxLocalView->getRegionId(rItem.nRegionId),
                                      rItem.nDocId,
diff --git a/sfx2/source/sidebar/UnoDeck.cxx b/sfx2/source/sidebar/UnoDeck.cxx
index de5e0c82c372..9a77c064b3e3 100644
--- a/sfx2/source/sidebar/UnoDeck.cxx
+++ b/sfx2/source/sidebar/UnoDeck.cxx
@@ -248,9 +248,7 @@ sal_Int32 SfxUnoDeck::GetMinOrderIndex(ResourceManager::DeckContextDescriptorCon
 {
     SidebarController* pSidebarController = getSidebarController();
 
-    ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck;
-
-    iDeck = aDecks.begin();
+    ResourceManager::DeckContextDescriptorContainer::const_iterator iDeck = aDecks.begin();
     sal_Int32 minIndex = pSidebarController->GetResourceManager()->GetDeckDescriptor(iDeck->msId)->mnOrderIndex;
 
     for (auto const& deck : aDecks)
diff --git a/sfx2/source/styles/StyleManager.cxx b/sfx2/source/styles/StyleManager.cxx
index 6a78c09af54c..75ec9d9467a2 100644
--- a/sfx2/source/styles/StyleManager.cxx
+++ b/sfx2/source/styles/StyleManager.cxx
@@ -20,9 +20,8 @@ SfxStyleSheetBase* StyleManager::Search(const OUString& rStyleName, SfxStyleFami
         return nullptr;
 
     pPool->SetSearchMask(eFamily);
-    SfxStyleSheetBase* pStyle = nullptr;
-    pStyle = pPool->First();
 
+    SfxStyleSheetBase* pStyle = pPool->First();
     while (pStyle)
     {
         if (rStyleName == pStyle->GetName())
diff --git a/slideshow/source/engine/slideshowimpl.cxx b/slideshow/source/engine/slideshowimpl.cxx
index 3b1cccc8bd75..138491151b81 100644
--- a/slideshow/source/engine/slideshowimpl.cxx
+++ b/slideshow/source/engine/slideshowimpl.cxx
@@ -890,8 +890,7 @@ SlideSharedPtr SlideShowImpl::makeSlide(
         return SlideSharedPtr();
 
     //Retrieve polygons for the current slide
-    PolygonMap::iterator aIter;
-    aIter = findPolygons(xDrawPage);
+    PolygonMap::iterator aIter = findPolygons(xDrawPage);
 
     const SlideSharedPtr pSlide( createSlide(xDrawPage,
                                              xDrawPages,
diff --git a/slideshow/source/engine/smilfunctionparser.cxx b/slideshow/source/engine/smilfunctionparser.cxx
index ed397d0a7eca..678e3c5ed740 100644
--- a/slideshow/source/engine/smilfunctionparser.cxx
+++ b/slideshow/source/engine/smilfunctionparser.cxx
@@ -538,11 +538,9 @@ namespace slideshow
             StringIteratorT aStart( rAsciiSmilValue.getStr() );
             StringIteratorT aEnd( rAsciiSmilValue.getStr()+rAsciiSmilValue.getLength() );
 
-            ParserContextSharedPtr pContext;
-
             // static parser context, because the actual
             // Spirit parser is also a static object
-            pContext = getParserContext();
+            ParserContextSharedPtr pContext = getParserContext();
 
             pContext->maShapeBounds = rRelativeShapeBounds;
             pContext->mbParseAnimationFunction = false; // parse with '$' disabled
@@ -583,11 +581,9 @@ namespace slideshow
             StringIteratorT aStart( rAsciiSmilFunction.getStr() );
             StringIteratorT aEnd( rAsciiSmilFunction.getStr()+rAsciiSmilFunction.getLength() );
 
-            ParserContextSharedPtr pContext;
-
             // static parser context, because the actual
             // Spirit parser is also a static object
-            pContext = getParserContext();
+            ParserContextSharedPtr pContext = getParserContext();
 
             pContext->maShapeBounds = rRelativeShapeBounds;
             pContext->mbParseAnimationFunction = true; // parse with '$' enabled
diff --git a/solenv/bin/concat-deps.c b/solenv/bin/concat-deps.c
index 8f1ea492b9cd..8ed3ea074dab 100644
--- a/solenv/bin/concat-deps.c
+++ b/solenv/bin/concat-deps.c
@@ -583,9 +583,7 @@ static int hash_store(struct hash* hash, const char* key, int key_len)
 
 static int file_stat(const char* name, struct stat* buffer_stat, int* rc)
 {
-    int rc_local = 0;
-
-    rc_local = stat(name, buffer_stat);
+    int rc_local = stat(name, buffer_stat);
     if (rc_local  < 0)
     {
         *rc = errno;


More information about the Libreoffice-commits mailing list