summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/attr/swatrset.cxx21
-rw-r--r--sw/source/core/draw/dcontact.cxx7
-rw-r--r--sw/source/core/text/txtfld.cxx32
-rw-r--r--sw/source/core/undo/untbl.cxx10
-rw-r--r--sw/source/core/unocore/unoportenum.cxx6
-rw-r--r--sw/source/filter/ww8/docxexportfilter.cxx9
-rw-r--r--sw/source/filter/ww8/rtfexportfilter.cxx9
7 files changed, 33 insertions, 61 deletions
diff --git a/sw/source/core/attr/swatrset.cxx b/sw/source/core/attr/swatrset.cxx
index e746c209b9fd..8631b06e784c 100644
--- a/sw/source/core/attr/swatrset.cxx
+++ b/sw/source/core/attr/swatrset.cxx
@@ -86,20 +86,17 @@ void SwAttrPool::createAndAddSecondaryPools()
// #75371# change DefaultItems for the SdrEdgeObj distance items
// to TWIPS.
- if(pSdrPool)
- {
- // 1/100th mm in twips
- const long nDefEdgeDist = ((500 * 72) / 127);
+ // 1/100th mm in twips
+ const long nDefEdgeDist = ((500 * 72) / 127);
- pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
- pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
- pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
- pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));
+ pSdrPool->SetPoolDefaultItem(SdrEdgeNode1HorzDistItem(nDefEdgeDist));
+ pSdrPool->SetPoolDefaultItem(SdrEdgeNode1VertDistItem(nDefEdgeDist));
+ pSdrPool->SetPoolDefaultItem(SdrEdgeNode2HorzDistItem(nDefEdgeDist));
+ pSdrPool->SetPoolDefaultItem(SdrEdgeNode2VertDistItem(nDefEdgeDist));
- // #i33700# // Set shadow distance defaults as PoolDefaultItems
- pSdrPool->SetPoolDefaultItem(makeSdrShadowXDistItem((300 * 72) / 127));
- pSdrPool->SetPoolDefaultItem(makeSdrShadowYDistItem((300 * 72) / 127));
- }
+ // #i33700# // Set shadow distance defaults as PoolDefaultItems
+ pSdrPool->SetPoolDefaultItem(makeSdrShadowXDistItem((300 * 72) / 127));
+ pSdrPool->SetPoolDefaultItem(makeSdrShadowYDistItem((300 * 72) / 127));
SfxItemPool *pEEgPool = EditEngine::CreatePool(false);
diff --git a/sw/source/core/draw/dcontact.cxx b/sw/source/core/draw/dcontact.cxx
index 09e104d60696..4490134f1930 100644
--- a/sw/source/core/draw/dcontact.cxx
+++ b/sw/source/core/draw/dcontact.cxx
@@ -2189,11 +2189,8 @@ SwDrawVirtObj* SwDrawVirtObj::Clone() const
{
SwDrawVirtObj* pObj = new SwDrawVirtObj( rRefObj, mrDrawContact );
- if ( pObj )
- {
- pObj->operator=( *this );
- // Note: Member <maAnchoredDrawObj> hasn't to be considered.
- }
+ pObj->operator=( *this );
+ // Note: Member <maAnchoredDrawObj> hasn't to be considered.
return pObj;
}
diff --git a/sw/source/core/text/txtfld.cxx b/sw/source/core/text/txtfld.cxx
index e98104e1fbe0..3a86463beef4 100644
--- a/sw/source/core/text/txtfld.cxx
+++ b/sw/source/core/text/txtfld.cxx
@@ -145,8 +145,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
: pFld->ExpandField(bInClipboard) );
pRet = new SwFldPortion( aStr );
}
- if(pRet)
- static_cast<SwFldPortion*>(pRet)->m_nAttrFldType= ATTR_PAGECOOUNTFLD;
+ static_cast<SwFldPortion*>(pRet)->m_nAttrFldType= ATTR_PAGECOOUNTFLD;
break;
case RES_PAGENUMBERFLD:
@@ -174,8 +173,7 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
: pFld->ExpandField(bInClipboard) );
pRet = new SwFldPortion( aStr );
}
- if(pRet)
- static_cast<SwFldPortion*>(pRet)->m_nAttrFldType= ATTR_PAGENUMBERFLD;
+ static_cast<SwFldPortion*>(pRet)->m_nAttrFldType= ATTR_PAGENUMBERFLD;
break;
}
case RES_GETEXPFLD:
@@ -248,14 +246,11 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
: pFld->ExpandField(bInClipboard) );
pRet = new SwFldPortion(str);
}
- if(pRet)
- {
- if( subType == REF_BOOKMARK )
- static_cast<SwFldPortion*>(pRet)->m_nAttrFldType = ATTR_BOOKMARKFLD;
- else if( subType == REF_SETREFATTR )
- static_cast<SwFldPortion*>(pRet)->m_nAttrFldType = ATTR_SETREFATTRFLD;
- break;
- }
+ if( subType == REF_BOOKMARK )
+ static_cast<SwFldPortion*>(pRet)->m_nAttrFldType = ATTR_BOOKMARKFLD;
+ else if( subType == REF_SETREFATTR )
+ static_cast<SwFldPortion*>(pRet)->m_nAttrFldType = ATTR_SETREFATTRFLD;
+ break;
case RES_DATETIMEFLD:
subType = static_cast<SwDateTimeField*>(pFld)->GetSubType();
{
@@ -264,14 +259,11 @@ SwExpandPortion *SwTxtFormatter::NewFldPortion( SwTxtFormatInfo &rInf,
: pFld->ExpandField(bInClipboard) );
pRet = new SwFldPortion(str);
}
- if(pRet)
- {
- if( subType & DATEFLD )
- static_cast<SwFldPortion*>(pRet)->m_nAttrFldType= ATTR_DATEFLD;
- else if( subType & TIMEFLD )
- static_cast<SwFldPortion*>(pRet)->m_nAttrFldType = ATTR_TIMEFLD;
- break;
- }
+ if( subType & DATEFLD )
+ static_cast<SwFldPortion*>(pRet)->m_nAttrFldType= ATTR_DATEFLD;
+ else if( subType & TIMEFLD )
+ static_cast<SwFldPortion*>(pRet)->m_nAttrFldType = ATTR_TIMEFLD;
+ break;
default:
{
OUString const aStr( (bName)
diff --git a/sw/source/core/undo/untbl.cxx b/sw/source/core/undo/untbl.cxx
index aab5ca98ff96..ea7466319a2d 100644
--- a/sw/source/core/undo/untbl.cxx
+++ b/sw/source/core/undo/untbl.cxx
@@ -1187,15 +1187,7 @@ void _SaveLine::CreateNew( SwTable& rTbl, SwTableBox& rParent, _SaveTable& rSTbl
rParent.GetTabLines().push_back( pNew );
- // HB, #127868# robustness: in some cases - which I
- // cannot reproduce nor see from the code - pNew seems
- // to be set to NULL in C40_INSERT.
- OSL_ENSURE(pNew, "Table line just created set to NULL in C40_INSERT");
-
- if (pNew)
- {
- pBox->CreateNew( rTbl, *pNew, rSTbl );
- }
+ pBox->CreateNew( rTbl, *pNew, rSTbl );
if( pNext )
pNext->CreateNew( rTbl, rParent, rSTbl );
diff --git a/sw/source/core/unocore/unoportenum.cxx b/sw/source/core/unocore/unoportenum.cxx
index 422bce910256..61a64dffe811 100644
--- a/sw/source/core/unocore/unoportenum.cxx
+++ b/sw/source/core/unocore/unoportenum.cxx
@@ -469,7 +469,7 @@ lcl_ExportFieldMark(
SwXTextPortion* pPortion = new SwXTextPortion(
pUnoCrsr, i_xParentText, PORTION_FIELD_START);
xRef = pPortion;
- if (pPortion && pFieldmark && pDoc)
+ if (pFieldmark && pDoc)
{
pPortion->SetBookmark(
SwXFieldmark::CreateXFieldmark(*pDoc, pFieldmark));
@@ -486,7 +486,7 @@ lcl_ExportFieldMark(
SwXTextPortion* pPortion = new SwXTextPortion(
pUnoCrsr, i_xParentText, PORTION_FIELD_END);
xRef = pPortion;
- if (pPortion && pFieldmark && pDoc)
+ if (pFieldmark && pDoc)
{
pPortion->SetBookmark(
SwXFieldmark::CreateXFieldmark(*pDoc, pFieldmark));
@@ -502,7 +502,7 @@ lcl_ExportFieldMark(
SwXTextPortion* pPortion = new SwXTextPortion(
pUnoCrsr, i_xParentText, PORTION_FIELD_START_END);
xRef = pPortion;
- if (pPortion && pFieldmark && pDoc)
+ if (pFieldmark && pDoc)
{
pPortion->SetBookmark(
SwXFieldmark::CreateXFieldmark(*pDoc, pFieldmark));
diff --git a/sw/source/filter/ww8/docxexportfilter.cxx b/sw/source/filter/ww8/docxexportfilter.cxx
index 9e3524e85b66..aaa857e70716 100644
--- a/sw/source/filter/ww8/docxexportfilter.cxx
+++ b/sw/source/filter/ww8/docxexportfilter.cxx
@@ -76,12 +76,9 @@ bool DocxExportFilter::exportDocument()
commitStorage();
// delete the pCurPam
- if ( pCurPam )
- {
- while ( pCurPam->GetNext() != pCurPam )
- delete pCurPam->GetNext();
- delete pCurPam;
- }
+ while ( pCurPam->GetNext() != pCurPam )
+ delete pCurPam->GetNext();
+ delete pCurPam;
return true;
}
diff --git a/sw/source/filter/ww8/rtfexportfilter.cxx b/sw/source/filter/ww8/rtfexportfilter.cxx
index 7774a2267e85..91923e3a3202 100644
--- a/sw/source/filter/ww8/rtfexportfilter.cxx
+++ b/sw/source/filter/ww8/rtfexportfilter.cxx
@@ -81,12 +81,9 @@ sal_Bool RtfExportFilter::filter(const uno::Sequence< beans::PropertyValue >& aD
}
// delete the pCurPam
- if (pCurPam)
- {
- while (pCurPam->GetNext() != pCurPam)
- delete pCurPam->GetNext();
- delete pCurPam;
- }
+ while (pCurPam->GetNext() != pCurPam)
+ delete pCurPam->GetNext();
+ delete pCurPam;
delete pStream;
return sal_True;