diff options
author | Michael Stahl <mst@openoffice.org> | 2010-03-17 13:44:55 +0100 |
---|---|---|
committer | Michael Stahl <mst@openoffice.org> | 2010-03-17 13:44:55 +0100 |
commit | e1395fc0cf7b6b768aa37c0f5625ae4f115991b2 (patch) | |
tree | f93ef30fc0a43ab4b6afb5909d457ebcf6600dd8 | |
parent | 8468b556d18f1b3f30a81024a40c5e8fe7d87d2e (diff) |
sw33bf03: #i109921#: sw: unnecessary null checks: apply patch by cmc
-rw-r--r-- | sw/source/core/frmedt/feshview.cxx | 5 | ||||
-rw-r--r-- | sw/source/ui/uno/unotxvw.cxx | 27 |
2 files changed, 13 insertions, 19 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx index d7e0e4e02e..65f4f7b1b0 100644 --- a/sw/source/core/frmedt/feshview.cxx +++ b/sw/source/core/frmedt/feshview.cxx @@ -238,10 +238,7 @@ BOOL SwFEShell::SelectObj( const Point& rPt, BYTE nFlag, SdrObject *pObj ) if( bForget ) { pDView->UnmarkAll(); - if ( pTmpObj ) - pDView->MarkObj( pTmpObj, Imp()->GetPageView(), bAddSelect, bEnterGroup ); - else - pDView->MarkObj( rPt, MINMOVE ); + pDView->MarkObj( pTmpObj, Imp()->GetPageView(), bAddSelect, bEnterGroup ); break; } } diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx index e2b40a8a9e..4ab5f3a2b7 100644 --- a/sw/source/ui/uno/unotxvw.cxx +++ b/sw/source/ui/uno/unotxvw.cxx @@ -908,12 +908,12 @@ void SAL_CALL SwXTextView::setRubyList( -----------------------------------------------------------------------*/ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ ) { - SwWrtShell* pOldSh = &m_pView->GetWrtShell(); - SfxPrinter *pPrt = pOldSh->getIDocumentDeviceAccess()->getPrinter( false ); + SwWrtShell& rOldSh = m_pView->GetWrtShell(); + SfxPrinter *pPrt = rOldSh.getIDocumentDeviceAccess()->getPrinter( false ); SwDocShell* pDocSh; SfxObjectShellRef xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SFX_CREATE_MODE_STANDARD ) ); xDocSh->DoInitNew( 0 ); - pOldSh->FillPrtDoc(pDocSh->GetDoc(), pPrt); + rOldSh.FillPrtDoc(pDocSh->GetDoc(), pPrt); SfxViewFrame* pDocFrame = SfxViewFrame::CreateViewFrame( *xDocSh, 0, TRUE ); SwView* pDocView = (SwView*) pDocFrame->GetViewShell(); pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//Damit SelectShell gerufen wird. @@ -922,22 +922,19 @@ SfxObjectShellRef SwXTextView::BuildTmpSelectionDoc( SfxObjectShellRef& /*rRef*/ IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess(); SfxPrinter* pTempPrinter = pIDDA->getPrinter( true ); - if( pOldSh ) - { - const SwPageDesc& rCurPageDesc = pOldSh->GetPageDesc(pOldSh->GetCurPageDesc()); - - IDocumentDeviceAccess* pIDDA_old = pOldSh->getIDocumentDeviceAccess(); + const SwPageDesc& rCurPageDesc = rOldSh.GetPageDesc(rOldSh.GetCurPageDesc()); - if( pIDDA_old->getPrinter( false ) ) - { - pIDDA->setJobsetup( *pIDDA_old->getJobsetup() ); - //#69563# if it isn't the same printer then the pointer has been invalidated! - pTempPrinter = pIDDA->getPrinter( true ); - } + IDocumentDeviceAccess* pIDDA_old = rOldSh.getIDocumentDeviceAccess(); - pTempPrinter->SetPaperBin(rCurPageDesc.GetMaster().GetPaperBin().GetValue()); + if( pIDDA_old->getPrinter( false ) ) + { + pIDDA->setJobsetup( *pIDDA_old->getJobsetup() ); + //#69563# if it isn't the same printer then the pointer has been invalidated! + pTempPrinter = pIDDA->getPrinter( true ); } + pTempPrinter->SetPaperBin(rCurPageDesc.GetMaster().GetPaperBin().GetValue()); + return xDocSh; } |