diff options
-rw-r--r-- | cui/source/dialogs/cuigaldlg.cxx | 10 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 17 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/ConnectionHelper.cxx | 6 | ||||
-rw-r--r-- | dbaccess/source/ui/misc/WNameMatch.cxx | 3 | ||||
-rw-r--r-- | sc/source/core/opencl/formulagroupcl.cxx | 3 | ||||
-rw-r--r-- | sc/source/ui/namedlg/namedefdlg.cxx | 19 | ||||
-rw-r--r-- | sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx | 17 | ||||
-rw-r--r-- | sd/source/ui/app/sdmod1.cxx | 89 | ||||
-rw-r--r-- | sd/source/ui/dlg/TemplateScanner.cxx | 9 | ||||
-rw-r--r-- | sd/source/ui/docshell/docshel4.cxx | 38 | ||||
-rw-r--r-- | sd/source/ui/view/sdview3.cxx | 2 | ||||
-rw-r--r-- | sw/source/core/attr/swatrset.cxx | 21 | ||||
-rw-r--r-- | sw/source/core/draw/dcontact.cxx | 7 | ||||
-rw-r--r-- | sw/source/core/text/txtfld.cxx | 32 | ||||
-rw-r--r-- | sw/source/core/undo/untbl.cxx | 10 | ||||
-rw-r--r-- | sw/source/core/unocore/unoportenum.cxx | 6 | ||||
-rw-r--r-- | sw/source/filter/ww8/docxexportfilter.cxx | 9 | ||||
-rw-r--r-- | sw/source/filter/ww8/rtfexportfilter.cxx | 9 |
18 files changed, 114 insertions, 193 deletions
diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index f8c6c50c3aee..b1b045158301 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -448,13 +448,9 @@ short ActualizeProgress::Execute() short nRet; pIdle = new Idle; - - if ( pIdle ) - { - pIdle->SetIdleHdl( LINK( this, ActualizeProgress, TimeoutHdl ) ); - pIdle->SetPriority( SchedulerPriority::LOWEST ); - pIdle->Start(); - } + pIdle->SetIdleHdl( LINK( this, ActualizeProgress, TimeoutHdl ) ); + pIdle->SetPriority( SchedulerPriority::LOWEST ); + pIdle->Start(); nRet = ModalDialog::Execute(); diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index 1421e83a7295..062d67e9c2bf 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1216,13 +1216,8 @@ void AbstractScriptSelectorDialog_Impl::SetRunLabel() VclAbstractDialog * AbstractDialogFactory_Impl::CreateSvxScriptOrgDialog( vcl::Window* pParent, const OUString& rLanguage) { - Dialog* pDlg=NULL; - - pDlg = new SvxScriptOrgDialog( pParent, rLanguage); - - if ( pDlg ) - return new CuiVclAbstractDialog_Impl( pDlg ); - return 0; + Dialog* pDlg = new SvxScriptOrgDialog( pParent, rLanguage); + return new CuiVclAbstractDialog_Impl( pDlg ); } AbstractTitleDialog * AbstractDialogFactory_Impl::CreateTitleDialog( vcl::Window* pParent, @@ -1295,9 +1290,7 @@ AbstractSvxSearchSimilarityDialog * AbstractDialogFactory_Impl::CreateSvxSearchS sal_uInt16 nLonger) { SvxSearchSimilarityDialog* pDlg = new SvxSearchSimilarityDialog( pParent, bRelax, nOther, nShorter, nLonger ); - if ( pDlg ) - return new AbstractSvxSearchSimilarityDialog_Impl( pDlg ); - return NULL; + return new AbstractSvxSearchSimilarityDialog_Impl( pDlg ); } //UUUU @@ -1460,9 +1453,7 @@ AbstractFmSearchDialog* AbstractDialogFactory_Impl::CreateFmSearchDialog(vcl::W const Link& lnkContextSupplier) { FmSearchDialog* pDlg = new FmSearchDialog( pParent, strInitialText, _rContexts, nInitialContext, lnkContextSupplier ); - if ( pDlg ) - return new AbstractFmSearchDialog_Impl( pDlg ); - return 0; + return new AbstractFmSearchDialog_Impl( pDlg ); } AbstractGraphicFilterDialog * AbstractDialogFactory_Impl::CreateGraphicFilterEmboss (vcl::Window* pParent, diff --git a/dbaccess/source/ui/dlg/ConnectionHelper.cxx b/dbaccess/source/ui/dlg/ConnectionHelper.cxx index eeb3bd442440..ec19a524f369 100644 --- a/dbaccess/source/ui/dlg/ConnectionHelper.cxx +++ b/dbaccess/source/ui/dlg/ConnectionHelper.cxx @@ -548,10 +548,10 @@ namespace dbaui const bool bExists = bIsFile? aCheckExistence.isDocument(): aCheckExistence.isFolder(); eExists = bExists? PATH_EXIST: PATH_NOT_EXIST; } - catch(const Exception&) + catch (const Exception&) { - eExists = ( pHandler && pHandler->isDoesNotExist() ) ? PATH_NOT_EXIST: (bIsFile ? PATH_NOT_EXIST : PATH_NOT_KNOWN); - } + eExists = pHandler->isDoesNotExist() ? PATH_NOT_EXIST : (bIsFile ? PATH_NOT_EXIST : PATH_NOT_KNOWN); + } return eExists; } bool OConnectionHelper::PreNotify( NotifyEvent& _rNEvt ) diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx index 8126f1cf804a..6ff753110814 100644 --- a/dbaccess/source/ui/misc/WNameMatch.cxx +++ b/dbaccess/source/ui/misc/WNameMatch.cxx @@ -363,8 +363,7 @@ void OColumnTreeBox::InitEntry(SvTreeListEntry* pEntry, const OUString& rStr, co { DBTreeListBox::InitEntry(pEntry, rStr, rImg1, rImg2, eButtonKind); SvLBoxString* pString = new OColumnString(pEntry, 0, rStr,false); - if (pString) - pEntry->ReplaceItem( pString, pEntry->ItemCount() - 1 ); + pEntry->ReplaceItem( pString, pEntry->ItemCount() - 1 ); } bool OColumnTreeBox::Select( SvTreeListEntry* pEntry, bool bSelect ) diff --git a/sc/source/core/opencl/formulagroupcl.cxx b/sc/source/core/opencl/formulagroupcl.cxx index e83069d32347..c4a2c3f5bd1f 100644 --- a/sc/source/core/opencl/formulagroupcl.cxx +++ b/sc/source/core/opencl/formulagroupcl.cxx @@ -4029,9 +4029,6 @@ DynamicKernel* DynamicKernel::create( const ScCalcConfig& rConfig, ScTokenArray& DynamicKernel* pDynamicKernel = new DynamicKernel(rConfig, Root, nResultSize); - if (!pDynamicKernel) - return NULL; - // OpenCL source code generation and kernel compilation try { diff --git a/sc/source/ui/namedlg/namedefdlg.cxx b/sc/source/ui/namedlg/namedefdlg.cxx index 43b4ecc6182c..b784e93ddddb 100644 --- a/sc/source/ui/namedlg/namedefdlg.cxx +++ b/sc/source/ui/namedlg/namedefdlg.cxx @@ -204,23 +204,20 @@ void ScNameDefDlg::AddPushed() { if ( mpDoc ) { - ScRangeData* pNewEntry = NULL; RangeType nType = RT_NAME; - pNewEntry = new ScRangeData( mpDoc, + ScRangeData* pNewEntry = new ScRangeData( mpDoc, aName, aExpression, maCursorPos, nType ); - if (pNewEntry) - { - nType = nType - | (m_pBtnRowHeader->IsChecked() ? RT_ROWHEADER : RangeType(0)) - | (m_pBtnColHeader->IsChecked() ? RT_COLHEADER : RangeType(0)) - | (m_pBtnPrintArea->IsChecked() ? RT_PRINTAREA : RangeType(0)) - | (m_pBtnCriteria->IsChecked() ? RT_CRITERIA : RangeType(0)); - pNewEntry->AddType(nType); - } + + nType = nType + | (m_pBtnRowHeader->IsChecked() ? RT_ROWHEADER : RangeType(0)) + | (m_pBtnColHeader->IsChecked() ? RT_COLHEADER : RangeType(0)) + | (m_pBtnPrintArea->IsChecked() ? RT_PRINTAREA : RangeType(0)) + | (m_pBtnCriteria->IsChecked() ? RT_CRITERIA : RangeType(0)); + pNewEntry->AddType(nType); // aExpression valid? if ( 0 == pNewEntry->GetErrCode() ) diff --git a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx index fffc50cec5fe..16208b1eb870 100644 --- a/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx +++ b/sd/source/ui/accessibility/AccessibleDrawDocumentView.cxx @@ -112,17 +112,16 @@ void AccessibleDrawDocumentView::Init (void) // Create the children manager. mpChildrenManager = new ChildrenManager(this, xShapeList, maShapeTreeInfo, *this); - if (mpChildrenManager != NULL) + + rtl::Reference<AccessiblePageShape> xPage(CreateDrawPageShape()); + if (xPage.is()) { - rtl::Reference<AccessiblePageShape> xPage(CreateDrawPageShape()); - if (xPage.is()) - { - xPage->Init(); - mpChildrenManager->AddAccessibleShape (xPage.get()); - mpChildrenManager->Update (); - } - mpChildrenManager->UpdateSelection (); + xPage->Init(); + mpChildrenManager->AddAccessibleShape (xPage.get()); + mpChildrenManager->Update (); } + + mpChildrenManager->UpdateSelection (); } void AccessibleDrawDocumentView::ViewForwarderChanged (ChangeType aChangeType, diff --git a/sd/source/ui/app/sdmod1.cxx b/sd/source/ui/app/sdmod1.cxx index dad7b14889c4..8df6940b7d76 100644 --- a/sd/source/ui/app/sdmod1.cxx +++ b/sd/source/ui/app/sdmod1.cxx @@ -266,47 +266,45 @@ bool SdModule::OutlineToImpress(SfxRequest& rRequest) ::sd::DrawDocShell* pDocSh; xDocShell = pDocSh = new ::sd::DrawDocShell( SFX_CREATE_MODE_STANDARD, false); - if(pDocSh) + + pDocSh->DoInitNew(NULL); + SdDrawDocument* pDoc = pDocSh->GetDoc(); + if(pDoc) { - pDocSh->DoInitNew(NULL); - SdDrawDocument* pDoc = pDocSh->GetDoc(); - if(pDoc) - { - pDoc->CreateFirstPages(); - pDoc->StopWorkStartupDelay(); - } + pDoc->CreateFirstPages(); + pDoc->StopWorkStartupDelay(); + } - SFX_REQUEST_ARG( rRequest, pFrmItem, SfxFrameItem, SID_DOCFRAME, false); - SfxViewFrame::LoadDocumentIntoFrame( *pDocSh, pFrmItem, ::sd::OUTLINE_FACTORY_ID ); + SFX_REQUEST_ARG( rRequest, pFrmItem, SfxFrameItem, SID_DOCFRAME, false); + SfxViewFrame::LoadDocumentIntoFrame( *pDocSh, pFrmItem, ::sd::OUTLINE_FACTORY_ID ); - ::sd::ViewShell* pViewSh = pDocSh->GetViewShell(); + ::sd::ViewShell* pViewSh = pDocSh->GetViewShell(); - if (pViewSh && pDoc) - { - // AutoLayouts have to be finished - pDoc->StopWorkStartupDelay(); + if (pViewSh && pDoc) + { + // AutoLayouts have to be finished + pDoc->StopWorkStartupDelay(); - SfxViewFrame* pViewFrame = pViewSh->GetViewFrame(); + SfxViewFrame* pViewFrame = pViewSh->GetViewFrame(); - // When the view frame has not been just created we have - // to switch synchronously to the outline view. - // (Otherwise the request will be ignored anyway.) - ::sd::ViewShellBase* pBase - = dynamic_cast< ::sd::ViewShellBase*>(pViewFrame->GetViewShell()); - if (pBase != NULL) - { - ::boost::shared_ptr<FrameworkHelper> pHelper ( - FrameworkHelper::Instance(*pBase)); - pHelper->RequestView( - FrameworkHelper::msOutlineViewURL, - FrameworkHelper::msCenterPaneURL); - - pHelper->RunOnResourceActivation( - FrameworkHelper::CreateResourceId( - FrameworkHelper::msOutlineViewURL, - FrameworkHelper::msCenterPaneURL), - OutlineToImpressFinalizer(*pBase, *pDoc, *pBytes)); - } + // When the view frame has not been just created we have + // to switch synchronously to the outline view. + // (Otherwise the request will be ignored anyway.) + ::sd::ViewShellBase* pBase + = dynamic_cast< ::sd::ViewShellBase*>(pViewFrame->GetViewShell()); + if (pBase != NULL) + { + ::boost::shared_ptr<FrameworkHelper> pHelper ( + FrameworkHelper::Instance(*pBase)); + pHelper->RequestView( + FrameworkHelper::msOutlineViewURL, + FrameworkHelper::msCenterPaneURL); + + pHelper->RunOnResourceActivation( + FrameworkHelper::CreateResourceId( + FrameworkHelper::msOutlineViewURL, + FrameworkHelper::msCenterPaneURL), + OutlineToImpressFinalizer(*pBase, *pDoc, *pBytes)); } } } @@ -724,21 +722,18 @@ SfxFrame* SdModule::CreateEmptyDocument( DocumentType eDocType, const Reference< SfxObjectShellLock xDocShell; ::sd::DrawDocShell* pNewDocSh; xDocShell = pNewDocSh = new ::sd::DrawDocShell(SFX_CREATE_MODE_STANDARD,false,eDocType); - if(pNewDocSh) + pNewDocSh->DoInitNew(NULL); + SdDrawDocument* pDoc = pNewDocSh->GetDoc(); + if (pDoc) { - pNewDocSh->DoInitNew(NULL); - SdDrawDocument* pDoc = pNewDocSh->GetDoc(); - if(pDoc) - { - pDoc->CreateFirstPages(); - pDoc->StopWorkStartupDelay(); - } - - SfxViewFrame* pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pNewDocSh, i_rFrame ); - OSL_ENSURE( pViewFrame, "SdModule::CreateEmptyDocument: no view frame - was the document really loaded?" ); - pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL; + pDoc->CreateFirstPages(); + pDoc->StopWorkStartupDelay(); } + SfxViewFrame* pViewFrame = SfxViewFrame::LoadDocumentIntoFrame( *pNewDocSh, i_rFrame ); + OSL_ENSURE( pViewFrame, "SdModule::CreateEmptyDocument: no view frame - was the document really loaded?" ); + pFrame = pViewFrame ? &pViewFrame->GetFrame() : NULL; + return pFrame; } diff --git a/sd/source/ui/dlg/TemplateScanner.cxx b/sd/source/ui/dlg/TemplateScanner.cxx index 617f6401c813..3e43b1923ccd 100644 --- a/sd/source/ui/dlg/TemplateScanner.cxx +++ b/sd/source/ui/dlg/TemplateScanner.cxx @@ -373,12 +373,9 @@ TemplateScanner::State TemplateScanner::ScanFolder (void) // Scan the folder and insert it into the list of template // folders. mpTemplateDirectory = new TemplateDir (sTitle, sTargetDir); - if (mpTemplateDirectory != NULL) - { - mpTemplateDirectory->EnableSorting(mbEntrySortingEnabled); - // Continue with scanning all entries in the folder. - eNextState = INITIALIZE_ENTRY_SCAN; - } + mpTemplateDirectory->EnableSorting(mbEntrySortingEnabled); + // Continue with scanning all entries in the folder. + eNextState = INITIALIZE_ENTRY_SCAN; } } else diff --git a/sd/source/ui/docshell/docshel4.cxx b/sd/source/ui/docshell/docshel4.cxx index cd9043858ba5..af598c28204d 100644 --- a/sd/source/ui/docshell/docshel4.cxx +++ b/sd/source/ui/docshell/docshel4.cxx @@ -909,24 +909,13 @@ bool DrawDocShell::GetObjectIsmarked(const OUString& rBookmark) // Jump to the page. This is done by using the API because this // takes care of all the little things to be done. Especially // writing the view data to the frame view (see bug #107803#). - sal_uInt16 nSdPgNum = (nPgNum - 1) / 2; SdUnoDrawView* pUnoDrawView = new SdUnoDrawView ( *pDrViewSh, *pDrViewSh->GetView()); - if (pUnoDrawView != NULL) - { - ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XDrawPage> xDrawPage ( - pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY); - pUnoDrawView->setCurrentPage (xDrawPage); - } - else - { - // As a fall back switch to the page via the core. - DBG_ASSERT (pUnoDrawView!=NULL, - "SdDrawDocShell::GotoBookmark: can't switch page via API"); - pDrViewSh->SwitchPage(nSdPgNum); - } + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage> xDrawPage ( + pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY); + pUnoDrawView->setCurrentPage (xDrawPage); delete pUnoDrawView; if (pObj) @@ -1002,24 +991,13 @@ bool DrawDocShell::GotoTreeBookmark(const OUString& rBookmark) // Jump to the page. This is done by using the API because this // takes care of all the little things to be done. Especially // writing the view data to the frame view (see bug #107803#). - sal_uInt16 nSdPgNum = (nPgNum - 1) / 2; SdUnoDrawView* pUnoDrawView = new SdUnoDrawView ( *pDrViewSh, *pDrViewSh->GetView()); - if (pUnoDrawView != NULL) - { - ::com::sun::star::uno::Reference< - ::com::sun::star::drawing::XDrawPage> xDrawPage ( - pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY); - pUnoDrawView->setCurrentPage (xDrawPage); - } - else - { - // As a fall back switch to the page via the core. - DBG_ASSERT (pUnoDrawView!=NULL, - "SdDrawDocShell::GotoBookmark: can't switch page via API"); - pDrViewSh->SwitchPage(nSdPgNum); - } + ::com::sun::star::uno::Reference< + ::com::sun::star::drawing::XDrawPage> xDrawPage ( + pPage->getUnoPage(), ::com::sun::star::uno::UNO_QUERY); + pUnoDrawView->setCurrentPage (xDrawPage); delete pUnoDrawView; if (pObj) diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index 5ad3d45d80f3..77ae2631a11d 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -993,7 +993,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( pImageMap ) pObj->AppendUserData( new SdIMapInfo( *pImageMap ) ); - if ( pObj && pObj->IsChart() ) + if (pObj->IsChart()) { bool bDisableDataTableDialog = false; svt::EmbeddedObjectRef::TryRunningState( xObj ); 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; |