summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-15 20:47:29 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-15 20:47:38 +0000
commit95f7a01621dd5cd62190c334fcdf02e3941fdcab (patch)
tree8aa4ad485e4b3dc0633598593b1479fc1b2021cf /sw/source
parentaab24d24d1dde90314bc961e11681f55bcf1f5be (diff)
Revert "coverity#1264391 help coverity out wrt Logically dead code"
This reverts commit 7de5ffbf3de77070a2f71fa3cd0846fc2bef8052. Change-Id: I3cf20882dc706700688cbbaea4f45bbe64d7aeca
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/doc/docdesc.cxx35
1 files changed, 12 insertions, 23 deletions
diff --git a/sw/source/core/doc/docdesc.cxx b/sw/source/core/doc/docdesc.cxx
index 501d849857c0..4f3801d3ad7e 100644
--- a/sw/source/core/doc/docdesc.cxx
+++ b/sw/source/core/doc/docdesc.cxx
@@ -212,29 +212,12 @@ static void lcl_DescSetAttr( const SwFrmFmt &rSource, SwFrmFmt &rDest,
rDest.SetPoolHlpFileId( rSource.GetPoolHlpFileId() );
}
-namespace
-{
- SwFrmFmt& getFrmFmt(SwPageDesc &rDesc, bool bLeft, bool bFirst)
- {
- if (bFirst)
- {
- if (bLeft)
- return rDesc.GetFirstLeft();
- rDesc.GetFirstMaster();
- }
- return rDesc.GetLeft();
- }
-
- const SwFrmFmt& getConstFrmFmt(const SwPageDesc &rDesc, bool bLeft, bool bFirst)
- {
- return getFrmFmt(const_cast<SwPageDesc&>(rDesc), bLeft, bFirst);
- }
-}
-
void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead, SwPageDesc &rDesc, bool bLeft, bool bFirst)
{
assert(bLeft || bFirst);
- SwFrmFmt& rDescFrmFmt = getFrmFmt(rDesc, bLeft, bFirst);
+ SwFrmFmt& rDescFrmFmt = (bFirst)
+ ? (bLeft) ? rDesc.GetFirstLeft() : rDesc.GetFirstMaster()
+ : rDesc.GetLeft();
if (bFirst && bLeft)
{
// special case: always shared with something
@@ -269,7 +252,9 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead,
if (!aCnt.GetCntntIdx())
{
- const SwFrmFmt& rChgedFrmFmt = getConstFrmFmt(rChged, bLeft, bFirst);
+ const SwFrmFmt& rChgedFrmFmt = (bFirst)
+ ? (bLeft) ? rChged.GetFirstLeft() : rChged.GetFirstMaster()
+ : rChged.GetLeft();
rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetHeader() );
}
else if ((*aRCnt.GetCntntIdx() == *aCnt.GetCntntIdx()) ||
@@ -307,7 +292,9 @@ void SwDoc::CopyMasterHeader(const SwPageDesc &rChged, const SwFmtHeader &rHead,
void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot, SwPageDesc &rDesc, bool bLeft, bool bFirst)
{
assert(bLeft || bFirst);
- SwFrmFmt& rDescFrmFmt = getFrmFmt(rDesc, bLeft, bFirst);
+ SwFrmFmt& rDescFrmFmt = (bFirst)
+ ? (bLeft) ? rDesc.GetFirstLeft() : rDesc.GetFirstMaster()
+ : rDesc.GetLeft();
if (bFirst && bLeft)
{
// special case: always shared with something
@@ -341,7 +328,9 @@ void SwDoc::CopyMasterFooter(const SwPageDesc &rChged, const SwFmtFooter &rFoot,
const SwFmtCntnt &aLCnt = rFmtFoot.GetFooterFmt()->GetCntnt();
if( !aLCnt.GetCntntIdx() )
{
- const SwFrmFmt& rChgedFrmFmt = getConstFrmFmt(rChged, bLeft, bFirst);
+ const SwFrmFmt& rChgedFrmFmt = (bFirst)
+ ? (bLeft) ? rChged.GetFirstLeft() : rChged.GetFirstMaster()
+ : rChged.GetLeft();
rDescFrmFmt.SetFmtAttr( rChgedFrmFmt.GetFooter() );
}
else if ((*aRCnt.GetCntntIdx() == *aLCnt.GetCntntIdx()) ||