[Libreoffice-commits] core.git: svl/source

Stephan Bergmann sbergman at redhat.com
Tue Mar 29 07:22:30 UTC 2016


 svl/source/items/poolio.cxx |   37 +++++++++++++++----------------------
 1 file changed, 15 insertions(+), 22 deletions(-)

New commits:
commit ed7ad21acf35ffdad8656b25e664131bcf38b331
Author: Stephan Bergmann <sbergman at redhat.com>
Date:   Tue Mar 29 09:21:15 2016 +0200

    cid#1357162: Logically dead code
    
    ...after 07da25064f75cdf7163669f9bf860a9ee2f8b33c "loplugin:constantparam in
    svl"
    
    Change-Id: I6f7cc3ca0822de079c0855ee46f66368bd78e0b7

diff --git a/svl/source/items/poolio.cxx b/svl/source/items/poolio.cxx
index bad0a85..4cd3fab 100644
--- a/svl/source/items/poolio.cxx
+++ b/svl/source/items/poolio.cxx
@@ -1245,29 +1245,22 @@ const SfxPoolItem* SfxItemPool::LoadItem( SvStream &rStream,
         rStream.ReadUInt16( nVersion ).ReadUInt32( nLen );
         sal_uLong nIStart = rStream.Tell();
 
-        // WhichId known in this version?
-        if ( nWhich )
-        {
-            // Load Item directly
-            SfxPoolItem *pNewItem =
-                    pRefPool->GetDefaultItem(nWhich).Create(rStream, nVersion);
-            if ( bDontPut )
-                pItem = pNewItem;
-            else
-                if ( pNewItem )
-                {
-                    pItem = &Put(*pNewItem);
-                    delete pNewItem;
-                }
-                else
-                    pItem = nullptr;
-            sal_uLong nIEnd = rStream.Tell();
-            DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" );
-            if ( (nIStart+nLen) != nIEnd )
-                rStream.Seek( nIStart+nLen );
-        }
+        // Load Item directly
+        SfxPoolItem *pNewItem =
+                pRefPool->GetDefaultItem(nWhich).Create(rStream, nVersion);
+        if ( bDontPut )
+            pItem = pNewItem;
         else
-            // SKip Item
+            if ( pNewItem )
+            {
+                pItem = &Put(*pNewItem);
+                delete pNewItem;
+            }
+            else
+                pItem = nullptr;
+        sal_uLong nIEnd = rStream.Tell();
+        DBG_ASSERT( nIEnd <= (nIStart+nLen), "read past end of item" );
+        if ( (nIStart+nLen) != nIEnd )
             rStream.Seek( nIStart+nLen );
     }
 


More information about the Libreoffice-commits mailing list