diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-13 21:27:47 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2019-04-14 08:29:08 +0200 |
commit | 8f59317223e0b8e1e5e6e4145b6ee457fe9e15f3 (patch) | |
tree | 4ed567d87c66931572848ceeae1004a6f237bc3e | |
parent | 2e3b0c5d42d60d46cd9f8b8eda9424b095c63418 (diff) |
loplugin:sequentialassign in starmath..svl
Change-Id: I95d7b67cd8b6b68c087ff96fdb6bb283ab8b49ec
Reviewed-on: https://gerrit.libreoffice.org/70718
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r-- | starmath/source/dialog.cxx | 3 | ||||
-rw-r--r-- | stoc/source/implementationregistration/implreg.cxx | 4 | ||||
-rw-r--r-- | store/source/storbase.hxx | 6 | ||||
-rw-r--r-- | store/source/storbios.cxx | 6 | ||||
-rw-r--r-- | store/source/stordata.hxx | 18 | ||||
-rw-r--r-- | store/source/stortree.hxx | 6 | ||||
-rw-r--r-- | svgio/source/svgreader/svgsvgnode.cxx | 3 | ||||
-rw-r--r-- | svl/source/fsstor/fsfactory.cxx | 4 | ||||
-rw-r--r-- | svl/source/fsstor/fsstorage.cxx | 3 | ||||
-rw-r--r-- | svl/source/fsstor/ostreamcontainer.cxx | 4 | ||||
-rw-r--r-- | svl/source/items/itempool.cxx | 3 | ||||
-rw-r--r-- | svl/source/misc/documentlockfile.cxx | 4 |
12 files changed, 20 insertions, 44 deletions
diff --git a/starmath/source/dialog.cxx b/starmath/source/dialog.cxx index 5fdaeda48636..fd7d7f4061cb 100644 --- a/starmath/source/dialog.cxx +++ b/starmath/source/dialog.cxx @@ -1808,8 +1808,7 @@ bool SmSymDefineDialog::SelectSymbolSet(weld::ComboBox& rComboBox, assert((&rComboBox == m_xOldSymbolSets.get() || &rComboBox == m_xSymbolSets.get()) && "Sm : wrong ComboBox"); // trim SymbolName (no leading and trailing blanks) - OUString aNormName (rSymbolSetName); - aNormName = comphelper::string::stripStart(aNormName, ' '); + OUString aNormName = comphelper::string::stripStart(rSymbolSetName, ' '); aNormName = comphelper::string::stripEnd(aNormName, ' '); // and remove possible deviations within the input rComboBox.set_entry_text(aNormName); diff --git a/stoc/source/implementationregistration/implreg.cxx b/stoc/source/implementationregistration/implreg.cxx index e463097bb5e6..0fb17520df9f 100644 --- a/stoc/source/implementationregistration/implreg.cxx +++ b/stoc/source/implementationregistration/implreg.cxx @@ -396,9 +396,7 @@ void prepareUserLink(const Reference < XSimpleRegistry >& xDest, const OUString& linkTarget, const OUString& implName) { - Reference < XRegistryKey > xRootKey; - - xRootKey = xDest->getRootKey(); + Reference < XRegistryKey > xRootKey = xDest->getRootKey(); if (xRootKey->getKeyType(linkName) == RegistryKeyType_LINK) { diff --git a/store/source/storbase.hxx b/store/source/storbase.hxx index 5ced6d255c4e..0c21acbb3ad3 100644 --- a/store/source/storbase.hxx +++ b/store/source/storbase.hxx @@ -366,8 +366,7 @@ struct PageData */ void guard (sal_uInt32 nAddr) { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); m_aDescr.m_nAddr = store::htonl(nAddr); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); @@ -377,8 +376,7 @@ struct PageData */ storeError verify (sal_uInt32 nAddr) const { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; diff --git a/store/source/storbios.cxx b/store/source/storbios.cxx index b1bac9852938..93e47d700841 100644 --- a/store/source/storbios.cxx +++ b/store/source/storbios.cxx @@ -117,8 +117,7 @@ struct OStoreSuperBlock */ void guard() { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -131,8 +130,7 @@ struct OStoreSuperBlock if (nMagic != STORE_MAGIC_SUPERBLOCK) return store_E_WrongFormat; - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aDescr, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; diff --git a/store/source/stordata.hxx b/store/source/stordata.hxx index 35fe20c0729a..4e4741d509d7 100644 --- a/store/source/stordata.hxx +++ b/store/source/stordata.hxx @@ -172,8 +172,7 @@ struct OStoreIndirectionPageData : public store::PageData */ void guard() { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, m_pData, capacity()); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -182,8 +181,7 @@ struct OStoreIndirectionPageData : public store::PageData */ storeError verify() const { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, m_pData, capacity()); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; @@ -299,8 +297,7 @@ struct OStorePageNameBlock */ void guard() { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -309,8 +306,7 @@ struct OStorePageNameBlock */ storeError verify() const { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aKey, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; @@ -398,8 +394,7 @@ struct OStoreDirectoryDataBlock */ void guard() { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G))); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -408,8 +403,7 @@ struct OStoreDirectoryDataBlock */ storeError verify() const { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, &m_aTable, static_cast<sal_uInt32>(theSize - sizeof(G))); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; diff --git a/store/source/stortree.hxx b/store/source/stortree.hxx index 547f548c3a95..9eb02b1329f1 100644 --- a/store/source/stortree.hxx +++ b/store/source/stortree.hxx @@ -142,8 +142,7 @@ struct OStoreBTreeNodeData : public store::PageData */ void guard() { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, m_pData, capacity()); m_aGuard.m_nCRC32 = store::htonl(nCRC32); } @@ -152,8 +151,7 @@ struct OStoreBTreeNodeData : public store::PageData */ storeError verify() const { - sal_uInt32 nCRC32 = 0; - nCRC32 = rtl_crc32 (nCRC32, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); + sal_uInt32 nCRC32 = rtl_crc32 (0, &m_aGuard.m_nMagic, sizeof(sal_uInt32)); nCRC32 = rtl_crc32 (nCRC32, m_pData, capacity()); if (m_aGuard.m_nCRC32 != store::htonl(nCRC32)) return store_E_InvalidChecksum; diff --git a/svgio/source/svgreader/svgsvgnode.cxx b/svgio/source/svgreader/svgsvgnode.cxx index 72775f16b9a4..f438da41ef0e 100644 --- a/svgio/source/svgreader/svgsvgnode.cxx +++ b/svgio/source/svgreader/svgsvgnode.cxx @@ -567,8 +567,7 @@ namespace svgio SvgAspectRatio aRatioDefault(Align_xMidYMid,true); const SvgAspectRatio& rRatio = getSvgAspectRatio().isSet()? getSvgAspectRatio() : aRatioDefault; - basegfx::B2DHomMatrix aViewBoxMapping; - aViewBoxMapping = rRatio.createMapping(aSvgCanvasRange, *pBox); + basegfx::B2DHomMatrix aViewBoxMapping = rRatio.createMapping(aSvgCanvasRange, *pBox); // no need to check ratio here for slice, the outermost Svg will // be clipped anyways (see below) diff --git a/svl/source/fsstor/fsfactory.cxx b/svl/source/fsstor/fsfactory.cxx index 816de07b201c..31fd68bd54a6 100644 --- a/svl/source/fsstor/fsfactory.cxx +++ b/svl/source/fsstor/fsfactory.cxx @@ -58,9 +58,7 @@ uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::impl_staticCreateSe uno::Reference< uno::XInterface > SAL_CALL FSStorageFactory::createInstance() { - OUString aTempURL; - - aTempURL = ::utl::TempFile( nullptr, true ).GetURL(); + OUString aTempURL = ::utl::TempFile( nullptr, true ).GetURL(); if ( aTempURL.isEmpty() ) throw uno::RuntimeException(); // TODO: can not create tempfile diff --git a/svl/source/fsstor/fsstorage.cxx b/svl/source/fsstor/fsstorage.cxx index 54b09af60142..199c438c7ae9 100644 --- a/svl/source/fsstor/fsstorage.cxx +++ b/svl/source/fsstor/fsstorage.cxx @@ -223,8 +223,7 @@ void FSStorage::CopyContentToStorage_Impl(ucbhelper::Content& rContent, uno::Any SAL_CALL FSStorage::queryInterface( const uno::Type& rType ) { - uno::Any aReturn; - aReturn = ::cppu::queryInterface + uno::Any aReturn = ::cppu::queryInterface ( rType , static_cast<lang::XTypeProvider*> ( this ) , static_cast<embed::XStorage*> ( this ) diff --git a/svl/source/fsstor/ostreamcontainer.cxx b/svl/source/fsstor/ostreamcontainer.cxx index 85a919df2b7c..d13beb4509d7 100644 --- a/svl/source/fsstor/ostreamcontainer.cxx +++ b/svl/source/fsstor/ostreamcontainer.cxx @@ -60,9 +60,7 @@ OFSStreamContainer::~OFSStreamContainer() // XInterface uno::Any SAL_CALL OFSStreamContainer::queryInterface( const uno::Type& rType ) { - uno::Any aReturn; - - aReturn = ::cppu::queryInterface + uno::Any aReturn = ::cppu::queryInterface ( rType , static_cast<lang::XTypeProvider*> ( this ) , static_cast<io::XStream*> ( this ) diff --git a/svl/source/items/itempool.cxx b/svl/source/items/itempool.cxx index 4ac7eb7cd60d..00bc517e0c85 100644 --- a/svl/source/items/itempool.cxx +++ b/svl/source/items/itempool.cxx @@ -637,8 +637,7 @@ const SfxPoolItem& SfxItemPool::Put( const SfxPoolItem& rItem, sal_uInt16 nWhich // if is already in a pool, then it is worth checking if it is in this one. if ( IsPooledItem(&rItem) ) { - SfxPoolItemArray_Impl::PoolItemPtrToIndexMap::const_iterator it; - it = pItemArr->maPtrToIndex.find(const_cast<SfxPoolItem *>(&rItem)); + auto it = pItemArr->maPtrToIndex.find(const_cast<SfxPoolItem *>(&rItem)); // 1. search for an identical pointer in the pool if (it != pItemArr->maPtrToIndex.cend()) diff --git a/svl/source/misc/documentlockfile.cxx b/svl/source/misc/documentlockfile.cxx index 3233852e6355..fe567d295f3f 100644 --- a/svl/source/misc/documentlockfile.cxx +++ b/svl/source/misc/documentlockfile.cxx @@ -214,9 +214,7 @@ LockFileEntry DocumentLockFile::GetLockData() const sal_Int32 nBufLen = 32000; uno::Sequence< sal_Int8 > aBuffer( nBufLen ); - sal_Int32 nRead = 0; - - nRead = xInput->readBytes( aBuffer, nBufLen ); + sal_Int32 nRead = xInput->readBytes( aBuffer, nBufLen ); xInput->closeInput(); if ( nRead == nBufLen ) |