Kaydet (Commit) 5d8449cd authored tarafından Caolán McNamara's avatar Caolán McNamara

need more dynamic casts here

Change-Id: Idf84ababeeb109a411c03a18d3a9aa6e136c7ef4
üst d6992663
......@@ -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())
{
......
......@@ -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);
......
......@@ -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();
......
......@@ -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
......
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