diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 16:10:06 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2018-10-28 15:05:32 +0100 |
commit | 3040d328c944d91b0cd612d86d358823b5c5b883 (patch) | |
tree | 689dd912ebff40137de98a7cf61b4042b9ec2cf2 /xmloff/source/draw/shapeexport.cxx | |
parent | d86778573a1ef207748cf8a6ca67eaef5cf04b02 (diff) |
tdf#120703 PVS: V547 Expression is always true/false
Change-Id: Iaa1a1811b638aadfe6b06b3465a182cb675031b5
Reviewed-on: https://gerrit.libreoffice.org/62476
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'xmloff/source/draw/shapeexport.cxx')
-rw-r--r-- | xmloff/source/draw/shapeexport.cxx | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/xmloff/source/draw/shapeexport.cxx b/xmloff/source/draw/shapeexport.cxx index da1e94b26d49..3dbb2b5beca6 100644 --- a/xmloff/source/draw/shapeexport.cxx +++ b/xmloff/source/draw/shapeexport.cxx @@ -2055,30 +2055,18 @@ void XMLShapeExport::ImpExportLineShape( if (auto pSourcePolyPolygon = o3tl::tryAccess<drawing::PointSequenceSequence>(aAny)) { - drawing::PointSequence* pOuterSequence = const_cast<css::drawing::PointSequenceSequence *>(pSourcePolyPolygon)->getArray(); - if(pOuterSequence) + if (pSourcePolyPolygon->getLength() > 1) { - drawing::PointSequence* pInnerSequence = pOuterSequence++; - if(pInnerSequence) + const drawing::PointSequence& rInnerSequence = (*pSourcePolyPolygon)[1]; + if (rInnerSequence.getLength() > 0) { - awt::Point* pArray = pInnerSequence->getArray(); - if(pArray) - { - if(pInnerSequence->getLength() > 0) - { - aStart = awt::Point( - pArray->X + aBasePosition.X, - pArray->Y + aBasePosition.Y); - pArray++; - } - - if(pInnerSequence->getLength() > 1) - { - aEnd = awt::Point( - pArray->X + aBasePosition.X, - pArray->Y + aBasePosition.Y); - } - } + const awt::Point& rPoint = rInnerSequence[0]; + aStart = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y); + } + if (rInnerSequence.getLength() > 1) + { + const awt::Point& rPoint = rInnerSequence[1]; + aEnd = awt::Point(rPoint.X + aBasePosition.X, rPoint.Y + aBasePosition.Y); } } } |