summaryrefslogtreecommitdiff
path: root/lotuswordpro/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-12-13 10:24:33 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-12-13 10:24:44 +0000
commit5d8449cd14aa3d08929bb25626ab54aa7515f47d (patch)
tree016c51cb08068c154581311d7f42cb010ec8d42a /lotuswordpro/source
parentd699266393d29227d249204faf5036fc0bd6d6ac (diff)
need more dynamic casts here
Change-Id: Idf84ababeeb109a411c03a18d3a9aa6e136c7ef4
Diffstat (limited to 'lotuswordpro/source')
-rw-r--r--lotuswordpro/source/filter/lwpcelllayout.cxx5
-rw-r--r--lotuswordpro/source/filter/lwpfootnote.cxx2
-rw-r--r--lotuswordpro/source/filter/lwptable.hxx2
-rw-r--r--lotuswordpro/source/filter/lwptablelayout.cxx1
4 files changed, 4 insertions, 6 deletions
diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx
index da49507105c8..76faa62786af 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -422,10 +422,7 @@ LwpObjectID * LwpCellLayout::GetPreviousCellStory()
LwpCellBorderType LwpCellLayout::GetCellBorderType(sal_uInt16 nRow, sal_uInt16 nCol, LwpTableLayout * pTableLayout)
{
if (!pTableLayout)
- {
- assert(false);
return enumWholeBorder;
- }
// get left cell and judge if neighbour border is different
XFBorders * pBorders = GetXFBorders();
@@ -664,7 +661,7 @@ void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID)
{
// judge whole table
LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj().get());
- LwpTableLayout * pTableLayout = pTable ? static_cast<LwpTableLayout *>(pTable->GetTableLayout()) : nullptr;
+ LwpTableLayout * pTableLayout = pTable ? dynamic_cast<LwpTableLayout *>(pTable->GetTableLayout()) : nullptr;
LwpSuperTableLayout * pSuper = pTableLayout ? pTableLayout->GetSuperTableLayout() : nullptr;
if (pSuper && pSuper->IsProtected())
{
diff --git a/lotuswordpro/source/filter/lwpfootnote.cxx b/lotuswordpro/source/filter/lwpfootnote.cxx
index 49b608347701..0da512ee7edb 100644
--- a/lotuswordpro/source/filter/lwpfootnote.cxx
+++ b/lotuswordpro/source/filter/lwpfootnote.cxx
@@ -199,7 +199,7 @@ LwpCellLayout* LwpFootnote::GetCellLayout()
LwpEnSuperTableLayout* pEnSuperLayout = FindFootnoteTableLayout();
if(pEnSuperLayout)
{
- LwpTableLayout* pTableLayout = static_cast<LwpTableLayout*>(pEnSuperLayout->GetMainTableLayout());
+ LwpTableLayout* pTableLayout = dynamic_cast<LwpTableLayout*>(pEnSuperLayout->GetMainTableLayout());
if(pTableLayout)
{
LwpRowLayout* pRowLayout = pTableLayout->GetRowLayout(m_nRow);
diff --git a/lotuswordpro/source/filter/lwptable.hxx b/lotuswordpro/source/filter/lwptable.hxx
index c9fa7dabfc50..f4fa01303629 100644
--- a/lotuswordpro/source/filter/lwptable.hxx
+++ b/lotuswordpro/source/filter/lwptable.hxx
@@ -119,7 +119,7 @@ public:
LwpObjectID& GetDefaultCellStyle() {return m_DefaultCellStyle;}
sal_uInt16 GetRow() {return m_nRow;}
sal_uInt16 GetColumn() {return m_nColumn;}
- LwpTableLayout * GetTableLayout(){return static_cast<LwpTableLayout *>(GetLayout(nullptr));}
+ LwpTableLayout * GetTableLayout(){return dynamic_cast<LwpTableLayout *>(GetLayout(nullptr));}
bool IsNumberDown();
virtual bool IsTable() override { return true;}
LwpSuperTableLayout* GetSuperTableLayout();
diff --git a/lotuswordpro/source/filter/lwptablelayout.cxx b/lotuswordpro/source/filter/lwptablelayout.cxx
index 735dd3edf247..e5b16c7c7c88 100644
--- a/lotuswordpro/source/filter/lwptablelayout.cxx
+++ b/lotuswordpro/source/filter/lwptablelayout.cxx
@@ -448,6 +448,7 @@ LwpCellLayout * LwpTableLayout::GetCellByRowCol(sal_uInt16 nRow, sal_uInt16 nCol
return m_WordProCellsMap[static_cast<size_t>(nRow)*m_nCols + nCol];
}
+
/**
* @short traverse all table cells
* @param