summaryrefslogtreecommitdiff
path: root/lotuswordpro/source/filter/lwpcelllayout.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'lotuswordpro/source/filter/lwpcelllayout.cxx')
-rw-r--r--lotuswordpro/source/filter/lwpcelllayout.cxx37
1 files changed, 14 insertions, 23 deletions
diff --git a/lotuswordpro/source/filter/lwpcelllayout.cxx b/lotuswordpro/source/filter/lwpcelllayout.cxx
index 9c10b6d7c..434cd3208 100644
--- a/lotuswordpro/source/filter/lwpcelllayout.cxx
+++ b/lotuswordpro/source/filter/lwpcelllayout.cxx
@@ -91,7 +91,7 @@ LwpCellLayout::~LwpCellLayout()
*/
LwpTableLayout * LwpCellLayout::GetTableLayout()
{
- LwpRowLayout * pRow = static_cast<LwpRowLayout *>(GetParent()->obj());
+ LwpRowLayout * pRow = dynamic_cast<LwpRowLayout *>(GetParent()->obj());
if(!pRow)
{
return NULL;
@@ -265,14 +265,14 @@ void LwpCellLayout::ApplyBackColor(XFCellStyle *pCellStyle)
*/
void LwpCellLayout::ApplyFmtStyle(XFCellStyle *pCellStyle)
{
- LwpLayoutNumerics* pLayoutNumerics =(LwpLayoutNumerics*)cLayNumerics.obj();
+ LwpLayoutNumerics* pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(cLayNumerics.obj());
if (!pLayoutNumerics)
{
// if current layout doesn't have format, go to based on layout
- LwpCellLayout* pCellLayout = (LwpCellLayout*)m_BasedOnStyle.obj();
+ LwpCellLayout* pCellLayout = dynamic_cast<LwpCellLayout*>(m_BasedOnStyle.obj());
if (pCellLayout)
{
- pLayoutNumerics = (LwpLayoutNumerics*)pCellLayout->GetNumericsObject()->obj();
+ pLayoutNumerics = dynamic_cast<LwpLayoutNumerics*>(pCellLayout->GetNumericsObject()->obj());
}
}
@@ -314,7 +314,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI
{
// if cell layout is aTableID's default cell layout
// it can't have any content, bypass these code
- LwpTable * pTable = static_cast<LwpTable *>(aTableID.obj());
+ LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj());
if (!pTable)
{
assert(sal_False);
@@ -331,7 +331,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI
}
// content of cell
- LwpStory* pStory =(LwpStory*) m_Content.obj();
+ LwpStory* pStory = dynamic_cast<LwpStory*>(m_Content.obj());
if (pStory)
{
pStory->XFConvert(pXFCell);
@@ -347,8 +347,8 @@ LwpPara* LwpCellLayout::GetLastParaOfPreviousStory()
LwpObjectID* pPreStoryID = this->GetPreviousCellStory();
if (pPreStoryID && !(pPreStoryID->IsNull()))
{
- LwpStory* pPreStory = static_cast<LwpStory*>(pPreStoryID->obj(VO_STORY));
- return static_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA));
+ LwpStory* pPreStory = dynamic_cast<LwpStory*>(pPreStoryID->obj(VO_STORY));
+ return dynamic_cast<LwpPara*>(pPreStory->GetLastPara()->obj(VO_PARA));
}
else
{
@@ -571,7 +571,7 @@ void LwpCellLayout::RegisterDefaultCell()
*/
void LwpCellLayout::RegisterStyle()
{
- LwpVirtualLayout * pParent = static_cast<LwpVirtualLayout *>(GetParent()->obj());
+ LwpVirtualLayout * pParent = dynamic_cast<LwpVirtualLayout *>(GetParent()->obj());
if (!pParent || pParent->GetLayoutType() != LWP_ROW_LAYOUT)
{
// default cell layout, we must register 4 styles for it
@@ -604,15 +604,6 @@ void LwpCellLayout::RegisterStyle()
//register child layout style
RegisterChildStyle();
- /*
- LwpVirtualLayout* pLayout = static_cast<LwpVirtualLayout*>(GetChildHead()->obj());
- while(pLayout)
- {
- pLayout->SetFoundry(m_pFoundry);
- pLayout->RegisterStyle();
- pLayout = static_cast<LwpVirtualLayout*>(pLayout->GetNext()->obj());
- }
- */
}
/**
* @short Read cell layout
@@ -687,7 +678,7 @@ void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID)
else
{
// judge base on
- LwpCellLayout * pBase = static_cast<LwpCellLayout *>(m_BasedOnStyle.obj());
+ LwpCellLayout * pBase = dynamic_cast<LwpCellLayout *>(m_BasedOnStyle.obj());
if (pBase && pBase->IsProtected())
{
bProtected = sal_True;
@@ -695,7 +686,7 @@ void LwpCellLayout::ApplyProtect(XFCell * pCell, LwpObjectID aTableID)
else
{
// judge whole table
- LwpTable * pTable = static_cast<LwpTable *>(aTableID.obj());
+ LwpTable * pTable = dynamic_cast<LwpTable *>(aTableID.obj());
LwpTableLayout * pTableLayout = static_cast<LwpTableLayout *>(pTable->GetTableLayout());
LwpSuperTableLayout * pSuper = pTableLayout->GetSuperTableLayout();
if (pSuper && pSuper->IsProtected())
@@ -907,17 +898,17 @@ XFCell* LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow,
{
if (!cconnectedlayout.obj())
return NULL;
- LwpConnectedCellLayout* pConnCell = static_cast<LwpConnectedCellLayout* >(cconnectedlayout.obj());
+ LwpConnectedCellLayout* pConnCell = dynamic_cast<LwpConnectedCellLayout* >(cconnectedlayout.obj());
if (nRow < (pConnCell->GetNumrows()+pConnCell->GetRowID()))
return NULL;
// if the hidden cell should be displayed for limit of SODC
// use the default cell layout
XFCell* pXFCell = NULL;
- LwpTable *pTable = static_cast<LwpTable *>(aTableID.obj());
+ LwpTable *pTable = dynamic_cast<LwpTable *>(aTableID.obj());
if (pTable)
{
- LwpCellLayout *pDefault = static_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj());
+ LwpCellLayout *pDefault = dynamic_cast<LwpCellLayout *>(pTable->GetDefaultCellStyle()->obj());
if (pDefault)
{
pXFCell = pDefault->ConvertCell(aTableID, nRow, nCol);