From 97cb43c001ffa7811d05150b86902bff8323c2d7 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 13 Nov 2024 16:23:13 +0100 Subject: [PATCH] tdf#163486: PVS: variable is used after being declared MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Since commit d4087b13fa278bd63f229a290dd12bda6392e77c Author: RĂ¼diger Timm Date: Fri Apr 18 13:32:32 2008 +0000 INTEGRATION: CWS xmlfilter04 (1.2.12); FILE MERGED V614 The 'pMasterShape' smart pointer is utilized immediately after being declared or reset. It is suspicious that no value was assigned to it. Consider checking the second actual argument of the 'GraphicalObjectFrameContext' function. Change-Id: I3d4241e8c88ee80c95a93d0e08d5498d87e7853b Reviewed-on: https://gerrit.libreoffice.org/c/core/+/176551 Tested-by: Jenkins Reviewed-by: Xisco Fauli --- oox/source/shape/ShapeContextHandler.cxx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/oox/source/shape/ShapeContextHandler.cxx b/oox/source/shape/ShapeContextHandler.cxx index 7f8ec35c7350..e34f5be34700 100644 --- a/oox/source/shape/ShapeContextHandler.cxx +++ b/oox/source/shape/ShapeContextHandler.cxx @@ -167,19 +167,18 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element ) if (! mxGraphicShapeContext.is()) { auto pFragmentHandler = std::make_shared(*mxShapeFilterBase, msRelationFragmentPath); - ShapePtr pMasterShape; switch (Element & 0xffff) { case XML_graphic: mpShape = std::make_shared("com.sun.star.drawing.GraphicObjectShape" ); mxGraphicShapeContext.set - (new GraphicalObjectFrameContext(*pFragmentHandler, pMasterShape, mpShape, true)); + (new GraphicalObjectFrameContext(*pFragmentHandler, nullptr, mpShape, true)); break; case XML_pic: mpShape = std::make_shared("com.sun.star.drawing.GraphicObjectShape" ); mxGraphicShapeContext.set - (new GraphicShapeContext(*pFragmentHandler, pMasterShape, mpShape)); + (new GraphicShapeContext(*pFragmentHandler, nullptr, mpShape)); break; default: break;