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

Julien Nabet serval2412 at yahoo.fr
Sun Jan 26 04:39:03 PST 2014


 sw/source/core/access/accpara.cxx |   17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

New commits:
commit 3f42c99fedb4502386a65a106c1552859d951c0e
Author: Julien Nabet <serval2412 at yahoo.fr>
Date:   Sun Jan 26 13:38:27 2014 +0100

    coverity#1157752 : Copy-paste error
    
    Change-Id: Ic1f6983ebaf0f14542a8f8ebc071382018aa3686

diff --git a/sw/source/core/access/accpara.cxx b/sw/source/core/access/accpara.cxx
index 2f795c64..3911782 100644
--- a/sw/source/core/access/accpara.cxx
+++ b/sw/source/core/access/accpara.cxx
@@ -1562,22 +1562,21 @@ OUString SwAccessibleParagraph::GetFieldTypeNameAtIndex(sal_Int32 nIndex)
         const SwpHints* pSwpHints = GetTxtNode()->GetpSwpHints();
         if (pSwpHints)
         {
-            const sal_uInt16  nSize = pSwpHints->Count();
+            const sal_uInt16  nSize = pSwpHints ? pSwpHints->Count() : 0;
             for( sal_uInt16 i = 0; i < nSize; ++i )
             {
                 const SwTxtAttr* pHt = (*pSwpHints)[i];
-                if ( ( pHt->Which() == RES_TXTATR_FIELD ||
-                       pHt->Which() == RES_TXTATR_ANNOTATION ||
-                       pHt->Which() == RES_TXTATR_INPUTFIELD ) &&
-                     ( nFldIndex-- == 0))
+                if ( ( pHt->Which() == RES_TXTATR_FIELD
+                       || pHt->Which() == RES_TXTATR_ANNOTATION
+                       || pHt->Which() == RES_TXTATR_INPUTFIELD )
+                     && (nFldIndex-- == 0))
                 {
                     pTxtFld = (SwTxtFld *)pHt;
                     break;
                 }
-                else if (pHt->Which() == RES_TXTATR_REFMARK && (nFldIndex-- == 0))
-                {
+                else if (pHt->Which() == RES_TXTATR_REFMARK
+                         && (nFldIndex-- == 0))
                     strTypeName = "set reference";
-                }
             }
         }
     }
@@ -2364,7 +2363,7 @@ void SwAccessibleParagraph::_correctValues( const sal_Int32 nIndex,
 
         if (rValue.Name.compareTo( ChangeAttrColor.Name )==0)
         {
-            rValue.Value = ChangeAttr.Value;
+            rValue.Value = ChangeAttrColor.Value;
             continue;
         }
 


More information about the Libreoffice-commits mailing list