[Libreoffice-commits] core.git: Branch 'libreoffice-4-2' - extensions/source

Caolán McNamara caolanm at redhat.com
Wed Mar 5 03:04:12 PST 2014


 extensions/source/propctrlr/browserlistbox.cxx |    9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

New commits:
commit 47bf525643fb0b609b248387b7192ce8b285f881
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Feb 27 09:55:18 2014 +0000

    coverity#704633 Dereference after null check
    
    (cherry picked from commit ccf0f7ef03bf98831a3e21b4b1327673a590b918)
    
    Change-Id: I4985249110da93ba67881dcd1c8cd1dc66ae08e2
    Reviewed-on: https://gerrit.libreoffice.org/8379
    Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
    Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>

diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index fa6bfcc..9a8cf37 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -1196,11 +1196,12 @@ namespace pcr
                 // So, we manually switch this to read-only.
                 if ( xControl.is() && ( xControl->getControlType() == PropertyControlType::Unknown ) )
                 {
-                    Edit* pControlWindowAsEdit = dynamic_cast< Edit* >( rLine.pLine->getControlWindow() );
-                    if ( pControlWindowAsEdit )
-                        pControlWindowAsEdit->SetReadOnly( sal_True );
+                    Window *pWindow = rLine.pLine->getControlWindow();
+                    Edit* pControlWindowAsEdit = dynamic_cast<Edit*>(pWindow);
+                    if (pControlWindowAsEdit)
+                        pControlWindowAsEdit->SetReadOnly(sal_True);
                     else
-                        pControlWindowAsEdit->Enable( sal_False );
+                        pWindow->Enable(sal_False);
                 }
             }
         }


More information about the Libreoffice-commits mailing list