summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2014-08-07 11:06:41 +0200
committerStephan Bergmann <sbergman@redhat.com>2014-08-07 11:06:41 +0200
commit58f837d2267e002a6a323b6b37c9e62eb6ca711b (patch)
tree2e5852d3bac2b6c983c9950aaf2895967718a4f2 /sw
parentca16ec4346cec871163c0b9ff361c7ad8bc74c16 (diff)
Avoid unnecessary illegal downcasts from SwFrmFmt to SwSectionFmt
Change-Id: I2ca8d57a09b6f8c6d760b5fb6a3d2f94ad22ada3
Diffstat (limited to 'sw')
-rw-r--r--sw/inc/section.hxx2
-rw-r--r--sw/source/core/docnode/ndsect.cxx5
-rw-r--r--sw/source/core/docnode/section.cxx2
3 files changed, 4 insertions, 5 deletions
diff --git a/sw/inc/section.hxx b/sw/inc/section.hxx
index ba343599dd99..833c681149a5 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 067c7f5b4971..e622c4066b8c 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 6ee567a791ce..ca563ac53ca4 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();