[Libreoffice-commits] core.git: 4 commits - sc/source sot/source sw/source

Caolán McNamara caolanm at redhat.com
Fri Mar 28 08:36:17 PDT 2014


 sc/source/core/data/formulacell.cxx |    6 -
 sot/source/sdstor/storage.cxx       |    2 
 sw/source/core/access/accpara.cxx   |  156 +++++-------------------------------
 3 files changed, 28 insertions(+), 136 deletions(-)

New commits:
commit 0c8c30a95e740de1bcc9b76ff4f0149bbcc1fcaa
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 28 15:34:57 2014 +0000

    bRefSizeChanged is always false
    
    Change-Id: I2f27e55a11f972374e7ef0d007a69f3cfb92a7bb

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index b29808a..e7d566a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2703,7 +2703,6 @@ bool ScFormulaCell::UpdateReferenceOnShift(
 
     bool bValChanged = false;
     bool bRefModified = false;
-    bool bRefSizeChanged = false;
     bool bRecompile = bCompile;
 
     if (bHasRefs)
@@ -2741,7 +2740,7 @@ bool ScFormulaCell::UpdateReferenceOnShift(
         // Reference changed and new listening needed?
         // Except in Insert/Delete without specialties.
         bNewListening = (bRefModified || bRecompile
-                || (bValChanged && (bInDeleteUndo || bRefSizeChanged)) || bHasRelName);
+                || (bValChanged && bInDeleteUndo) || bHasRelName);
 
         if ( bNewListening )
             EndListeningTo(pDocument, pOldCode.get(), aOldPos);
commit 11676ac765e055d81dabe367fb502080496eb6cc
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 28 15:18:54 2014 +0000

    coverity#1078506 troubling Logically dead code
    
    Change-Id: I9687ab7340e9c9ab45ff4dd27eb53e671492e7b5

diff --git a/sc/source/core/data/formulacell.cxx b/sc/source/core/data/formulacell.cxx
index b4b3ddf..b29808a 100644
--- a/sc/source/core/data/formulacell.cxx
+++ b/sc/source/core/data/formulacell.cxx
@@ -2827,7 +2827,6 @@ bool ScFormulaCell::UpdateReferenceOnMove(
 
     bool bValChanged = false;
     bool bRefModified = false;
-    bool bRefSizeChanged = false;
 
     if (bHasRefs)
     {
@@ -2877,7 +2876,7 @@ bool ScFormulaCell::UpdateReferenceOnMove(
     bool bNeedDirty = false;
     // NeedDirty for changes except for Copy and Move/Insert without RelNames
     if ( bRefModified || bColRowNameCompile ||
-         (bValChanged && bHasRelName && (bHasRelName || bInDeleteUndo || bRefSizeChanged)) || bOnRefMove)
+         (bValChanged && bHasRelName ) || bOnRefMove)
         bNeedDirty = true;
 
     if (pUndoDoc && (bValChanged || bOnRefMove))
commit 47bf12afa00a528128ee702c30d9c41b57de02af
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 28 14:54:59 2014 +0000

    coverity#1078520 Logically dead code
    
    Change-Id: I91ff819bbbca9f74236bcec725b98f8065a84a50

diff --git a/sot/source/sdstor/storage.cxx b/sot/source/sdstor/storage.cxx
index 2f5c915..5f18003 100644
--- a/sot/source/sdstor/storage.cxx
+++ b/sot/source/sdstor/storage.cxx
@@ -387,7 +387,7 @@ void SotStorage::CreateStorage( bool bForceUCBStorage, StreamMode nMode, Storage
             }
             else
             {
-                m_pOwnStg = new Storage( m_aName, nMode, (nStorageMode & STORAGE_TRANSACTED) ? false : true );
+                m_pOwnStg = new Storage( m_aName, nMode, false );
                 SetError( ERRCODE_IO_NOTSUPPORTED );
             }
         }
commit d1d05703ac29cfa5afcff94ecb45181bc3651c68
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Fri Mar 28 14:40:48 2014 +0000

    coverity#1157772 Logically dead code
    
    Change-Id: I4eda11bdeda2e9f2e7d124d19ba051fafc846321

diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 1e6cdce..0040b7f 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -3182,28 +3182,16 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
 
     const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
     SwHyperlinkIter_Impl aHIter( pTxtFrm );
-    //SwAccessibleAutoRecognizerHelper_Impl aARHelper( pTxtFrm );
-    sal_Int32 nARCount = 0;
-    sal_Int32 nARIndex = 0;
     sal_Int32 nTIndex = -1;
     SwTOXSortTabBase* pTBase = GetTOXSortTabBase();
     SwTxtAttr* pHt = (SwTxtAttr*)(aHIter.next());
     while( (nLinkIndex < getHyperLinkCount()) && nTIndex < nLinkIndex)
     {
         sal_Int32 nHStt = -1;
-        sal_Int32 nAStt = -1;
         sal_Bool bH = sal_False;
-        sal_Bool bA = sal_False;
 
         if( pHt )
             nHStt = *pHt->GetStart();
-        if( nARIndex < nARCount )
-        {
-            /*
-            sal_Int32 nAEnd;
-            aARHelper.getPosition( nARIndex, nAStt, nAEnd );
-            */
-        }
         sal_Bool bTOC = sal_False;
         // Inside TOC & get the first link
         if( pTBase && nTIndex == -1 )
@@ -3211,26 +3199,11 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
             nTIndex++;
             bTOC = sal_True;
         }
-        else
+        else if( nHStt >= 0 )
         {
-            if( nHStt >=0 && nAStt >=0 )
-            {   // both hyperlink and smart tag available
-                nTIndex++;
-                if( nHStt <= nAStt )
-                    bH = sal_True;
-                else
-                    bA = sal_True;
-            }
-            else if( nHStt >= 0 )
-            {   // only hyperlink available
-                nTIndex++;
-                bH = sal_True;
-            }
-            else if( nAStt >= 0 )
-            {   // only smart tag available
-                nTIndex++;
-                bA = sal_True;
-            }
+              // only hyperlink available
+            nTIndex++;
+            bH = sal_True;
         }
 
         if( nTIndex == nLinkIndex )
@@ -3239,73 +3212,36 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
             {   // it's a hyperlink
                 if( pHt )
                 {
-//                    const SwField* pFFld = pHt->GetFld().GetFld();
+                    if( !pHyperTextData )
+                        pHyperTextData = new SwAccessibleHyperTextData;
+                    SwAccessibleHyperTextData::iterator aIter =
+                        pHyperTextData ->find( pHt );
+                    if( aIter != pHyperTextData->end() )
+                    {
+                        xRet = (*aIter).second;
+                    }
+                    if( !xRet.is() )
                     {
-                        if( !pHyperTextData )
-                            pHyperTextData = new SwAccessibleHyperTextData;
-                        SwAccessibleHyperTextData::iterator aIter =
-                            pHyperTextData ->find( pHt );
+                        {
+                            const sal_Int32 nTmpHStt= GetPortionData().GetAccessiblePosition(
+                                max( aHIter.startIdx(), *pHt->GetStart() ) );
+                            const sal_Int32 nTmpHEnd= GetPortionData().GetAccessiblePosition(
+                                min( aHIter.endIdx(), *pHt->GetAnyEnd() ) );
+                            xRet = new SwAccessibleHyperlink( aHIter.getCurrHintPos(),
+                                this, nTmpHStt, nTmpHEnd );
+                        }
                         if( aIter != pHyperTextData->end() )
                         {
-                            xRet = (*aIter).second;
+                            (*aIter).second = xRet;
                         }
-                        if( !xRet.is() )
+                        else
                         {
-                            {
-                                const sal_Int32 nTmpHStt= GetPortionData().GetAccessiblePosition(
-                                    max( aHIter.startIdx(), *pHt->GetStart() ) );
-                                const sal_Int32 nTmpHEnd= GetPortionData().GetAccessiblePosition(
-                                    min( aHIter.endIdx(), *pHt->GetAnyEnd() ) );
-                                xRet = new SwAccessibleHyperlink( aHIter.getCurrHintPos(),
-                                    this, nTmpHStt, nTmpHEnd );
-                            }
-                            if( aIter != pHyperTextData->end() )
-                            {
-                                (*aIter).second = xRet;
-                            }
-                            else
-                            {
-                                SwAccessibleHyperTextData::value_type aEntry( pHt, xRet );
-                                pHyperTextData->insert( aEntry );
-                            }
+                            SwAccessibleHyperTextData::value_type aEntry( pHt, xRet );
+                            pHyperTextData->insert( aEntry );
                         }
                     }
                 }
             }
-            else if( bTOC )
-            {
-                //xRet = new SwAccessibleTOCLink( this );
-            }
-            else if( bA )
-            {
-                /*
-                // it's a smart tag
-                if( !pAutoRecognizerData )
-                    pAutoRecognizerData = new SwAccessibleAutoRecognizerData;
-                SwAccessibleAutoRecognizerData::iterator aIter =
-                    pAutoRecognizerData ->find( nARIndex );
-                if( aIter != pAutoRecognizerData->end() )
-                {
-                    xRet = (*aIter).second;
-                }
-                if( !xRet.is() )
-                {
-                    sal_Int32 nAStt = 0;
-                    sal_Int32 nAEnd = 0;
-                    //aARHelper.getPosition( nARIndex, nAStt, nAEnd );
-                    xRet = new SwAccessibleAutoRecognizer( this, nAStt, nAEnd );
-                    if( aIter != pAutoRecognizerData->end() )
-                    {
-                        (*aIter).second = xRet;
-                    }
-                    else
-                    {
-                        SwAccessibleAutoRecognizerData::value_type aEntry( nARIndex, xRet );
-                        pAutoRecognizerData->insert( aEntry );
-                    }
-                }
-                */
-            }
             break;
         }
 
@@ -3313,54 +3249,12 @@ uno::Reference< XAccessibleHyperlink > SAL_CALL
         if( bH )
             // iterate next hyperlink
             pHt = (SwTxtAttr*)(aHIter.next());
-        else if( bA )
-            // iterate next smart tag
-            nARIndex++;
         else if(bTOC)
             continue;
         else
             // no candidate, exit
             break;
     }
-    /*
-    {
-        const SwTxtFrm *pTxtFrm = static_cast<const SwTxtFrm*>( GetFrm() );
-        SwHyperlinkIter_Impl aHIter( pTxtFrm );
-        while( nLinkIndex-- )
-            aHIter.next();
-
-        const SwTxtAttr *pHt = aHIter.next();
-        if( pHt )
-        {
-            if( !pHyperTextData )
-                pHyperTextData = new SwAccessibleHyperTextData;
-            SwAccessibleHyperTextData::iterator aIter =
-                pHyperTextData ->find( pHt );
-            if( aIter != pHyperTextData->end() )
-            {
-                xRet = (*aIter).second;
-            }
-            if( !xRet.is() )
-            {
-                const sal_Int32 nHStt= GetPortionData().GetAccessiblePosition(
-                                max( aHIter.startIdx(), *pHt->GetStart() ) );
-                const sal_Int32 nHEnd= GetPortionData().GetAccessiblePosition(
-                                min( aHIter.endIdx(), *pHt->GetAnyEnd() ) );
-                xRet = new SwAccessibleHyperlink( aHIter.getCurrHintPos(),
-                                                  this, nHStt, nHEnd );
-                if( aIter != pHyperTextData->end() )
-                {
-                    (*aIter).second = xRet;
-                }
-                else
-                {
-                    SwAccessibleHyperTextData::value_type aEntry( pHt, xRet );
-                    pHyperTextData->insert( aEntry );
-                }
-            }
-        }
-    }
-    */
     if( !xRet.is() )
         throw lang::IndexOutOfBoundsException();
 


More information about the Libreoffice-commits mailing list