coverity#704558 Unchecked dynamic cast

Change-Id: I45ce419c65e0fac28879747787ccf1ebc25e7698
This commit is contained in:
Norbert Thiebaud
2014-03-07 17:06:11 -06:00
parent 7b4d53699c
commit 5aed432830

View File

@@ -3172,6 +3172,9 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
pNewControl = pControl;
OUnoObject* pObj = dynamic_cast<OUnoObject*>(pControl);
assert(pObj);
if(pObj)
{
uno::Reference<beans::XPropertySet> xUnoProp(pObj->GetUnoControlModel(),uno::UNO_QUERY);
xShapeProp.set(pObj->getUnoShape(),uno::UNO_QUERY);
uno::Reference<beans::XPropertySetInfo> xShapeInfo = xShapeProp->getPropertySetInfo();
@@ -3220,6 +3223,7 @@ void OReportController::createControl(const Sequence< PropertyValue >& _aArgs,co
xShapeProp->setSize(awt::Size(aOlSize.Height,aOlSize.Width)); // switch height and width
}
}
}
const sal_Int32 nShapeWidth = aMap.getUnpackedValueOrDefault(PROPERTY_WIDTH,xShapeProp->getWidth());
if ( nShapeWidth != xShapeProp->getWidth() )