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

Caolán McNamara caolanm at redhat.com
Mon Mar 19 17:38:45 UTC 2018


 sw/source/core/unocore/unosett.cxx |   18 ++++++------------
 1 file changed, 6 insertions(+), 12 deletions(-)

New commits:
commit 410cc7057ae0eb61034f93fb28d7add5ec76d6e5
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Mon Mar 19 14:04:00 2018 +0000

    coverity#1430056 Dereference null return value
    
    Change-Id: Ib3b0ca660c1d44794179abf71a81e1bda5124064
    Reviewed-on: https://gerrit.libreoffice.org/51557
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/sw/source/core/unocore/unosett.cxx b/sw/source/core/unocore/unosett.cxx
index 4f5aa306b32f..65dae55f8812 100644
--- a/sw/source/core/unocore/unosett.cxx
+++ b/sw/source/core/unocore/unosett.cxx
@@ -1414,24 +1414,18 @@ uno::Sequence<beans::PropertyValue> SwXNumberingRules::GetPropertiesForNumFormat
         }
         if (SVX_NUM_BITMAP == rFormat.GetNumberingType())
         {
-            //GraphicURL
             const SvxBrushItem* pBrush = rFormat.GetBrush();
-            uno::Reference<graphic::XGraphic> xGraphic;
-            if (pBrush)
-            {
-                xGraphic = pBrush->GetGraphic()->GetXGraphic();
-                aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC, xGraphic));
-            }
-
-            //GraphicBitmap
-            const Graphic* pGraphic = nullptr;
-            if (pBrush)
-                pGraphic = pBrush->GetGraphic();
+            const Graphic* pGraphic = pBrush ? pBrush->GetGraphic() : nullptr;
             if (pGraphic)
             {
+                uno::Reference<graphic::XGraphic> xGraphic(pGraphic->GetXGraphic());
+                //GraphicURL
+                aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC, xGraphic));
+                //GraphicBitmap
                 uno::Reference<awt::XBitmap> xBitmap(pGraphic->GetXGraphic(), uno::UNO_QUERY);
                 aPropertyValues.push_back(comphelper::makePropertyValue(UNO_NAME_GRAPHIC_BITMAP, xBitmap));
             }
+
             Size aSize = rFormat.GetGraphicSize();
             // #i101131#
             // adjust conversion due to type mismatch between <Size> and <awt::Size>


More information about the Libreoffice-commits mailing list