summaryrefslogtreecommitdiff
path: root/sw/source/ui/uno/unotxvw.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/ui/uno/unotxvw.cxx')
-rw-r--r--sw/source/ui/uno/unotxvw.cxx27
1 files changed, 12 insertions, 15 deletions
diff --git a/sw/source/ui/uno/unotxvw.cxx b/sw/source/ui/uno/unotxvw.cxx
index 24049e571f60..0504fb1107ad 100644
--- a/sw/source/ui/uno/unotxvw.cxx
+++ b/sw/source/ui/uno/unotxvw.cxx
@@ -905,12 +905,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::LoadHiddenDocument( *xDocSh, 0 );
SwView* pDocView = (SwView*) pDocFrame->GetViewShell();
pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//Damit SelectShell gerufen wird.
@@ -919,22 +919,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;
}