summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-11-24 15:06:32 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-11-24 15:19:02 +0000
commit7acbf173fc9f624da144a242e33033de56550a2f (patch)
tree4c82cf2264fed679e18596181e814d998b8926cc
parent78407eea3ddb5717a501d9336e3b3cbef188d010 (diff)
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
-rw-r--r--svx/source/items/e3ditem.cxx5
-rw-r--r--xmloff/source/draw/ximp3dscene.cxx11
2 files changed, 15 insertions, 1 deletions
diff --git a/svx/source/items/e3ditem.cxx b/svx/source/items/e3ditem.cxx
index d41b77818a31..f853012e2516 100644
--- a/svx/source/items/e3ditem.cxx
+++ b/svx/source/items/e3ditem.cxx
@@ -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;
}
diff --git a/xmloff/source/draw/ximp3dscene.cxx b/xmloff/source/draw/ximp3dscene.cxx
index 5fc4b451b197..83c20330bfb1 100644
--- a/xmloff/source/draw/ximp3dscene.cxx
+++ b/xmloff/source/draw/ximp3dscene.cxx
@@ -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: