Kaydet (Commit) 58f837d2 authored tarafından Stephan Bergmann's avatar Stephan Bergmann

Avoid unnecessary illegal downcasts from SwFrmFmt to SwSectionFmt

Change-Id: I2ca8d57a09b6f8c6d760b5fb6a3d2f94ad22ada3
üst ca16ec43
......@@ -291,7 +291,7 @@ class SW_DLLPUBLIC SwSectionFmt
SAL_DLLPRIVATE void UpdateParent(); // Parent has been changed.
protected:
SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc );
SwSectionFmt( SwFrmFmt* pDrvdFrm, SwDoc *pDoc );
virtual void Modify( const SfxPoolItem* pOld, const SfxPoolItem* pNew ) SAL_OVERRIDE;
public:
......
......@@ -504,9 +504,8 @@ SwSection* SwDoc::GetCurrSection( const SwPosition& rPos ) const
SwSectionFmt* SwDoc::MakeSectionFmt( SwSectionFmt *pDerivedFrom )
{
if( !pDerivedFrom )
pDerivedFrom = (SwSectionFmt*)mpDfltFrmFmt;
SwSectionFmt* pNew = new SwSectionFmt( pDerivedFrom, this );
SwSectionFmt* pNew = new SwSectionFmt(
pDerivedFrom == 0 ? mpDfltFrmFmt : pDerivedFrom, this );
mpSectionFmtTbl->push_back( pNew );
return pNew;
}
......
......@@ -625,7 +625,7 @@ const SwTOXBase* SwSection::GetTOXBase() const
return pRet;
}
SwSectionFmt::SwSectionFmt( SwSectionFmt* pDrvdFrm, SwDoc *pDoc )
SwSectionFmt::SwSectionFmt( SwFrmFmt* pDrvdFrm, SwDoc *pDoc )
: SwFrmFmt( pDoc->GetAttrPool(), OUString(), pDrvdFrm )
{
LockModify();
......
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