Kaydet (Commit) 7acbf173 authored tarafından Caolán McNamara's avatar Caolán McNamara

crashtesting: ooo72999-1.ods NaNs found in light direction

and NaN != NaN so busted logic propogates, drop invalid directions
on initial read

Change-Id: Ic76c714666df14d37a4c68f43b817327675bd0e0
üst 78407eea
......@@ -95,6 +95,8 @@ SvStream& SvxB3DVectorItem::Store(SvStream &rStream, sal_uInt16 /*nItemVersion*/
bool SvxB3DVectorItem::QueryValue( uno::Any& rVal, sal_uInt8 /*nMemberId*/ ) const
{
assert(!isnan(aVal.getX()) && !isnan(aVal.getY()) && !isnan(aVal.getZ()));
drawing::Direction3D aDirection;
// Werte eintragen
......@@ -117,6 +119,9 @@ bool SvxB3DVectorItem::PutValue( const uno::Any& rVal, sal_uInt8 /*nMemberId*/ )
aVal.setX(aDirection.DirectionX);
aVal.setY(aDirection.DirectionY);
aVal.setZ(aDirection.DirectionZ);
assert(!isnan(aVal.getX()) && !isnan(aVal.getY()) && !isnan(aVal.getZ()));
return true;
}
......
......@@ -64,7 +64,16 @@ SdXML3DLightContext::SdXML3DLightContext(
}
case XML_TOK_3DLIGHT_DIRECTION:
{
SvXMLUnitConverter::convertB3DVector(maDirection, sValue);
::basegfx::B3DVector aVal;
SvXMLUnitConverter::convertB3DVector(aVal, sValue);
if (!isnan(aVal.getX()) && !isnan(aVal.getY()) && !isnan(aVal.getZ()))
{
maDirection = aVal;
}
else
{
SAL_WARN("xmloff", "NaNs found in light direction: " << sValue);
}
break;
}
case XML_TOK_3DLIGHT_ENABLED:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment