summaryrefslogtreecommitdiff
path: root/xmloff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2018-10-28 16:10:06 +0300
committerMike Kaganski <mike.kaganski@collabora.com>2018-10-28 15:05:32 +0100
commit3040d328c944d91b0cd612d86d358823b5c5b883 (patch)
tree689dd912ebff40137de98a7cf61b4042b9ec2cf2 /xmloff
parentd86778573a1ef207748cf8a6ca67eaef5cf04b02 (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')
-rw-r--r--xmloff/source/draw/sdxmlexp.cxx25
-rw-r--r--xmloff/source/draw/shapeexport.cxx32
2 files changed, 21 insertions, 36 deletions
diff --git a/xmloff/source/draw/sdxmlexp.cxx b/xmloff/source/draw/sdxmlexp.cxx
index 23f35442eae5..3f09010adfd0 100644
--- a/xmloff/source/draw/sdxmlexp.cxx
+++ b/xmloff/source/draw/sdxmlexp.cxx
@@ -2426,11 +2426,6 @@ void SdXMLExport::exportFormsElement( const Reference< XDrawPage >& xDrawPage )
void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
{
- rProps.realloc(4);
- beans::PropertyValue* pProps = rProps.getArray();
- if(!pProps)
- return;
-
Reference< beans::XPropertySet > xPropSet( GetModel(), UNO_QUERY );
if( !xPropSet.is() )
return;
@@ -2438,15 +2433,17 @@ void SdXMLExport::GetViewSettings(uno::Sequence<beans::PropertyValue>& rProps)
awt::Rectangle aVisArea;
xPropSet->getPropertyValue("VisibleArea") >>= aVisArea;
- sal_uInt16 i = 0;
- pProps[i].Name = "VisibleAreaTop";
- pProps[i++].Value <<= aVisArea.Y;
- pProps[i].Name = "VisibleAreaLeft";
- pProps[i++].Value <<= aVisArea.X;
- pProps[i].Name = "VisibleAreaWidth";
- pProps[i++].Value <<= aVisArea.Width;
- pProps[i].Name = "VisibleAreaHeight";
- pProps[i++].Value <<= aVisArea.Height;
+ rProps.realloc(4);
+ beans::PropertyValue* pProps = rProps.getArray();
+
+ pProps[0].Name = "VisibleAreaTop";
+ pProps[0].Value <<= aVisArea.Y;
+ pProps[1].Name = "VisibleAreaLeft";
+ pProps[1].Value <<= aVisArea.X;
+ pProps[2].Name = "VisibleAreaWidth";
+ pProps[2].Value <<= aVisArea.Width;
+ pProps[3].Name = "VisibleAreaHeight";
+ pProps[3].Value <<= aVisArea.Height;
}
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);
}
}
}