tdf#163486: PVS: variable is used after being declared

Since
commit d4087b13fa
Author: Rüdiger Timm <rt@openoffice.org>
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 <xiscofauli@libreoffice.org>
This commit is contained in:
Xisco Fauli 2024-11-13 16:23:13 +01:00
parent 6923fa7a92
commit 97cb43c001

View file

@ -167,19 +167,18 @@ ShapeContextHandler::getGraphicShapeContext(::sal_Int32 Element )
if (! mxGraphicShapeContext.is())
{
auto pFragmentHandler = std::make_shared<ShapeFragmentHandler>(*mxShapeFilterBase, msRelationFragmentPath);
ShapePtr pMasterShape;
switch (Element & 0xffff)
{
case XML_graphic:
mpShape = std::make_shared<Shape>("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<Shape>("com.sun.star.drawing.GraphicObjectShape" );
mxGraphicShapeContext.set
(new GraphicShapeContext(*pFragmentHandler, pMasterShape, mpShape));
(new GraphicShapeContext(*pFragmentHandler, nullptr, mpShape));
break;
default:
break;