sw/inc/section.hxx | 2 +- sw/source/core/docnode/ndsect.cxx | 5 ++--- sw/source/core/docnode/section.cxx | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-)
New commits: commit 58f837d2267e002a6a323b6b37c9e62eb6ca711b Author: Stephan Bergmann <sberg...@redhat.com> Date: Thu Aug 7 11:06:41 2014 +0200 Avoid unnecessary illegal downcasts from SwFrmFmt to SwSectionFmt Change-Id: I2ca8d57a09b6f8c6d760b5fb6a3d2f94ad22ada3 diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx index ba34359..833c681 100644 --- a/sw/inc/section.hxx +++ b/sw/inc/section.hxx @@ -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: diff --git a/sw/source/core/docnode/ndsect.cxx b/sw/source/core/docnode/ndsect.cxx index 067c7f5..e622c40 100644 --- a/sw/source/core/docnode/ndsect.cxx +++ b/sw/source/core/docnode/ndsect.cxx @@ -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; } diff --git a/sw/source/core/docnode/section.cxx b/sw/source/core/docnode/section.cxx index 6ee567a..ca563ac 100644 --- a/sw/source/core/docnode/section.cxx +++ b/sw/source/core/docnode/section.cxx @@ -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(); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits