summaryrefslogtreecommitdiff
path: root/lotuswordpro
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-18 11:48:02 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-18 11:48:38 +0000
commit742bcd2b2d23ae05bfcf356db69f79f33d20f53f (patch)
treede9e61e6e7deecda645144ed7c5c6fc102ef875b /lotuswordpro
parent8217ddbfc863dd9b313d6b5eaecb1877e42b2d02 (diff)
crashtesting: these can happen with broken documents
Change-Id: I35f77345804b3ebfda9d427de79968b193d1419a
Diffstat (limited to 'lotuswordpro')
-rw-r--r--lotuswordpro/source/filter/lwpdivinfo.cxx8
-rw-r--r--lotuswordpro/source/filter/lwpfont.cxx2
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx4
-rw-r--r--lotuswordpro/source/filter/lwptblformula.cxx2
4 files changed, 6 insertions, 10 deletions
diff --git a/lotuswordpro/source/filter/lwpdivinfo.cxx b/lotuswordpro/source/filter/lwpdivinfo.cxx
index 2f9a6cf60e41..efa32f69561a 100644
--- a/lotuswordpro/source/filter/lwpdivinfo.cxx
+++ b/lotuswordpro/source/filter/lwpdivinfo.cxx
@@ -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()
diff --git a/lotuswordpro/source/filter/lwpfont.cxx b/lotuswordpro/source/filter/lwpfont.cxx
index 5e0d2749dc3b..8805533ba181 100644
--- a/lotuswordpro/source/filter/lwpfont.cxx
+++ b/lotuswordpro/source/filter/lwpfont.cxx
@@ -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();
}
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 385baa632c4f..0faf772d1054 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -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();
diff --git a/lotuswordpro/source/filter/lwptblformula.cxx b/lotuswordpro/source/filter/lwptblformula.cxx
index 6f699c53fa92..7a28a6ed53c7 100644
--- a/lotuswordpro/source/filter/lwptblformula.cxx
+++ b/lotuswordpro/source/filter/lwptblformula.cxx
@@ -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