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

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Sat Oct 20 18:28:40 UTC 2018


 winaccessibility/source/service/AccObject.cxx |   92 ++++++++++++--------------
 1 file changed, 43 insertions(+), 49 deletions(-)

New commits:
commit 974f3183221130bfdf93eb8821539a5554909e5c
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Fri Oct 19 17:26:48 2018 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Sat Oct 20 20:28:20 2018 +0200

    pvs-studio: pointer was utilized before it was verified against nullptr
    
    Change-Id: Ib677c60019f7ce7d26809e50489f04a457b4c224
    Reviewed-on: https://gerrit.libreoffice.org/62066
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/winaccessibility/source/service/AccObject.cxx b/winaccessibility/source/service/AccObject.cxx
index abcaaf7c2a67..608a1978409c 100644
--- a/winaccessibility/source/service/AccObject.cxx
+++ b/winaccessibility/source/service/AccObject.cxx
@@ -872,43 +872,40 @@ void AccObject::UpdateState()
 
     short Role = m_accRole;
 
-    if( m_pIMAcc )
+    switch(m_accRole)
     {
-        switch(m_accRole)
+    case LABEL:
+    case STATIC:
+        m_pIMAcc->IncreaseState( STATE_SYSTEM_READONLY );
+        break;
+    case TEXT:
+        // 2. editable combobox -> readonly ------ bridge
+    case EMBEDDED_OBJECT:
+    case END_NOTE:
+    case FOOTER:
+    case FOOTNOTE:
+    case GRAPHIC:
+    case HEADER:
+    case HEADING:
+
+        //Image Map
+    case PARAGRAPH:
+    case PASSWORD_TEXT:
+    case SHAPE:
+    case SPIN_BOX:
+    case TABLE:
+    case TABLE_CELL:
+    case TEXT_FRAME:
+    case DATE_EDITOR:
+    case DOCUMENT:
+    case COLUMN_HEADER:
         {
-        case LABEL:
-        case STATIC:
-            m_pIMAcc->IncreaseState( STATE_SYSTEM_READONLY );
-            break;
-        case TEXT:
-            // 2. editable combobox -> readonly ------ bridge
-        case EMBEDDED_OBJECT:
-        case END_NOTE:
-        case FOOTER:
-        case FOOTNOTE:
-        case GRAPHIC:
-        case HEADER:
-        case HEADING:
-
-            //Image Map
-        case PARAGRAPH:
-        case PASSWORD_TEXT:
-        case SHAPE:
-        case SPIN_BOX:
-        case TABLE:
-        case TABLE_CELL:
-        case TEXT_FRAME:
-        case DATE_EDITOR:
-        case DOCUMENT:
-        case COLUMN_HEADER:
-            {
-                if(!isEditable)
-                    m_pIMAcc->IncreaseState( STATE_SYSTEM_READONLY );
-            }
-            break;
-        default:
-            break;
+            if(!isEditable)
+                m_pIMAcc->IncreaseState( STATE_SYSTEM_READONLY );
         }
+        break;
+    default:
+        break;
     }
 
     if( isEnable )
@@ -970,24 +967,21 @@ void AccObject::UpdateState()
         }
     }
 
-    if( m_pIMAcc )
+    switch(m_accRole)
     {
-        switch(m_accRole)
-        {
-        case POPUP_MENU:
-        case MENU:
-            if( pContext->getAccessibleChildCount() > 0 )
-                m_pIMAcc->IncreaseState( STATE_SYSTEM_HASPOPUP );
-            break;
-        case PASSWORD_TEXT:
-            m_pIMAcc->IncreaseState( STATE_SYSTEM_PROTECTED );
-            break;
-        default:
-            break;
-        }
+    case POPUP_MENU:
+    case MENU:
+        if( pContext->getAccessibleChildCount() > 0 )
+            m_pIMAcc->IncreaseState( STATE_SYSTEM_HASPOPUP );
+        break;
+    case PASSWORD_TEXT:
+        m_pIMAcc->IncreaseState( STATE_SYSTEM_PROTECTED );
+        break;
+    default:
+        break;
     }
-
 }
+
 /**
    * update location information from uno to com
    * @param


More information about the Libreoffice-commits mailing list