Kaydet (Commit) 742bcd2b authored tarafından Caolán McNamara's avatar Caolán McNamara

crashtesting: these can happen with broken documents

Change-Id: I35f77345804b3ebfda9d427de79968b193d1419a
üst 8217ddbf
......@@ -108,15 +108,11 @@ void LwpDivInfo::Read()
m_FillerPageTextID.ReadIndexed(m_pObjStrm);
// read external file object stuff
#if !defined(NDEBUG)
sal_uInt16 type =
#endif
m_pObjStrm->QuickReaduInt16();
sal_uInt16 type = m_pObjStrm->QuickReaduInt16();
//cpExternalFile = LNULL;
assert(type==0);
SAL_WARN_IF(type != 0, "lwp", "should be 0");
m_pObjStrm->SkipExtra();
}
void LwpDivInfo::SkipFront()
......
......@@ -262,7 +262,7 @@ void LwpFontTable::Read(LwpObjectStream *pStrm)
OUString LwpFontTable::GetFaceName(sal_uInt16 index) //index: start from 1
{
assert(index <= m_nCount && index > 0);
SAL_WARN_IF(index > m_nCount || index <= 0, "lwp", "bad font index");
return (index <= m_nCount && index > 0) ? m_pFontEntries[index-1].GetFaceName() : OUString();
}
......
......@@ -215,13 +215,13 @@ double LwpSuperTableLayout::GetTableWidth()
LwpTableLayout* pTableLayout = GetTableLayout();
if(!pTableLayout)
{
assert(false);
SAL_WARN("lwp", "missing table layout, early return");
return 0;
}
LwpTable *pTable = pTableLayout->GetTable();
if(!pTable)
{
assert(false);
SAL_WARN("lwp", "missing table, early return");
return 0;
}
double dDefaultWidth = pTable->GetWidth();
......
......@@ -342,7 +342,7 @@ void LwpFormulaInfo::Read()
}
else
{
assert(false);
SAL_WARN("lwp", "missing row list");
}
}
m_pObjStrm->SeekRel(2);//flags, size in file: sal_uInt16
......
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