summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Stahl <mst@openoffice.org>2010-03-17 13:44:55 +0100
committerMichael Stahl <mst@openoffice.org>2010-03-17 13:44:55 +0100
commit3421215984f3c0a5fcbadc070524f93dc6b89923 (patch)
tree3defefc3d07a60288714e5ff5a3d2a8acd14c717 /sw/source
parentb9ba6b35bf4a2a3ef5f85e4cca6ac6e8818161f1 (diff)
sw33bf03: #i109921#: sw: unnecessary null checks: apply patch by cmc
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/frmedt/feshview.cxx5
-rw-r--r--sw/source/ui/uno/unotxvw.cxx27
2 files changed, 13 insertions, 19 deletions
diff --git a/sw/source/core/frmedt/feshview.cxx b/sw/source/core/frmedt/feshview.cxx
index af2e8d1c7677..d435bfb194d9 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 73c89873819b..556f6bd26997 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;
}