diff options
author | Caolán McNamara <caolanm@redhat.com> | 2012-08-09 09:59:38 +0100 |
---|---|---|
committer | Petr Mladek <pmladek@suse.cz> | 2012-08-15 17:20:53 +0200 |
commit | 8b13020205c2739e7bfcff9c2324184d26d78f91 (patch) | |
tree | 7cec09d06ba5df309686a79e0413d33879181e0d | |
parent | b1420b1c50af6b75dd0b2da18ce77af6b180496d (diff) |
ensure placeholder substitution on XclImpDrawObjBase::ReadObj8 failure
Change-Id: I7a72153d971aaccea937955acc77cdba128985d7
Signed-off-by: Michael Stahl <mstahl@redhat.com>
-rw-r--r-- | sc/source/filter/excel/xiescher.cxx | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/sc/source/filter/excel/xiescher.cxx b/sc/source/filter/excel/xiescher.cxx index 74ed03b8d6e9..900d2e6f86d2 100644 --- a/sc/source/filter/excel/xiescher.cxx +++ b/sc/source/filter/excel/xiescher.cxx @@ -336,7 +336,7 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr if( rStrm.GetRecLeft() >= 10 ) { - sal_uInt16 nSubRecId, nSubRecSize, nObjType; + sal_uInt16 nSubRecId(0), nSubRecSize(0), nObjType(0); rStrm >> nSubRecId >> nSubRecSize >> nObjType; OSL_ENSURE( nSubRecId == EXC_ID_OBJCMO, "XclImpDrawObjBase::ReadObj8 - OBJCMO subrecord expected" ); if( (nSubRecId == EXC_ID_OBJCMO) && (nSubRecSize >= 6) ) @@ -379,11 +379,16 @@ XclImpDrawObjRef XclImpDrawObjBase::ReadObj8( const XclImpRoot& rRoot, XclImpStr default: OSL_TRACE( "XclImpDrawObjBase::ReadObj8 - unknown object type 0x%04hX", nObjType ); rRoot.GetTracer().TraceUnsupportedObjects(); - xDrawObj.reset( new XclImpPhObj( rRoot ) ); } } } + if (!xDrawObj) //ensure placeholder for unknown or broken records + { + SAL_WARN( "sc", "XclImpDrawObjBase::ReadObj8 import failed, substituting placeholder"); + xDrawObj.reset( new XclImpPhObj( rRoot ) ); + } + xDrawObj->mnTab = rRoot.GetCurrScTab(); xDrawObj->ImplReadObj8( rStrm ); return xDrawObj; |