diff options
author | Noel Grandin <noel@peralex.com> | 2015-07-03 11:31:14 +0200 |
---|---|---|
committer | Noel Grandin <noelgrandin@gmail.com> | 2015-07-06 07:04:50 +0000 |
commit | e9c3583c2cc27fc88ee81047c236ec99dd51e8de (patch) | |
tree | b3e8394ca1ec402a31b227339366fc790124c1f8 /sw/source/uibase | |
parent | 89c77994d4638c86635c70535fab6508e2f3d900 (diff) |
improve the returnbyref loplugin
Change-Id: I1b510a6194282dfa4a9001d473127c5ebc8b44eb
Reviewed-on: https://gerrit.libreoffice.org/16731
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sw/source/uibase')
31 files changed, 109 insertions, 111 deletions
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 1820d88a46e0..f4fcb423ff86 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -186,7 +186,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) SfxItemSet aSet(GetPool(), FN_ENVELOP, FN_ENVELOP, 0); aSet.Put(aEnvCfg.GetItem()); - SfxPrinter* pTempPrinter = pSh->getIDocumentDeviceAccess()->getPrinter( true ); + SfxPrinter* pTempPrinter = pSh->getIDocumentDeviceAccess().getPrinter( true ); if(pOldSh ) { const SwPageDesc& rCurPageDesc = pOldSh->GetPageDesc(pOldSh->GetCurPageDesc()); @@ -194,13 +194,13 @@ void SwModule::InsertEnv( SfxRequest& rReq ) SwStyleNameMapper::FillUIName( RES_POOLPAGE_JAKET, sJacket ); bEnvChange = rCurPageDesc.GetName() == sJacket; - IDocumentDeviceAccess* pIDDA_old = pOldSh->getIDocumentDeviceAccess(); - if( pIDDA_old->getPrinter( false ) ) + IDocumentDeviceAccess& rIDDA_old = pOldSh->getIDocumentDeviceAccess(); + if( rIDDA_old.getPrinter( false ) ) { - IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess(); - pIDDA->setJobsetup( *pIDDA_old->getJobsetup() ); + IDocumentDeviceAccess& rIDDA = pSh->getIDocumentDeviceAccess(); + rIDDA.setJobsetup( *rIDDA_old.getJobsetup() ); //#69563# if it isn't the same printer then the pointer has been invalidated! - pTempPrinter = pIDDA->getPrinter( true ); + pTempPrinter = rIDDA.getPrinter( true ); } pTempPrinter->SetPaperBin(rCurPageDesc.GetMaster().GetPaperBin().GetValue()); @@ -244,7 +244,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) { OSL_ENSURE(pOldSh, "No document - wasn't 'Insert' disabled???"); SvxPaperBinItem aItem( RES_PAPER_BIN ); - aItem.SetValue((sal_uInt8)pSh->getIDocumentDeviceAccess()->getPrinter(true)->GetPaperBin()); + aItem.SetValue((sal_uInt8)pSh->getIDocumentDeviceAccess().getPrinter(true)->GetPaperBin()); pOldSh->GetPageDescFromPool(RES_POOLPAGE_JAKET)->GetMaster().SetFormatAttr(aItem); } @@ -338,7 +338,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) SwPageDesc* pDesc = pSh->GetPageDescFromPool(RES_POOLPAGE_JAKET); SwFrameFormat& rFormat = pDesc->GetMaster(); - Printer *pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( true ); + Printer *pPrt = pSh->getIDocumentDeviceAccess().getPrinter( true ); // Borders (are put together by Shift-Offset and alignment) Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(), diff --git a/sw/source/uibase/app/applab.cxx b/sw/source/uibase/app/applab.cxx index 4858f898f19b..f7778b3fb6f4 100644 --- a/sw/source/uibase/app/applab.cxx +++ b/sw/source/uibase/app/applab.cxx @@ -198,7 +198,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) if (pPrt) { SwDocShell *pDocSh = static_cast<SwDocShell*>(&*xDocSh); - pDocSh->getIDocumentDeviceAccess()->setJobsetup(pPrt->GetJobSetup()); + pDocSh->getIDocumentDeviceAccess().setJobsetup(pPrt->GetJobSetup()); } SfxViewFrame* pViewFrame = SfxViewFrame::DisplayNewDocument( *xDocSh, rReq ); @@ -272,7 +272,7 @@ void SwModule::InsertLab(SfxRequest& rReq, bool bLabel) const SwPageDesc &rFollow = pSh->GetPageDesc( pSh->GetCurPageDesc() ); aDesc.SetFollow( &rFollow ); - pPrt = pSh->getIDocumentDeviceAccess()->getPrinter( true ); + pPrt = pSh->getIDocumentDeviceAccess().getPrinter( true ); SvxPaperBinItem aItem( RES_PAPER_BIN ); aItem.SetValue((sal_Int8)pPrt->GetPaperBin()); rFormat.SetFormatAttr(aItem); diff --git a/sw/source/uibase/app/appopt.cxx b/sw/source/uibase/app/appopt.cxx index 00b93f30e036..d0453e4f80ee 100644 --- a/sw/source/uibase/app/appopt.cxx +++ b/sw/source/uibase/app/appopt.cxx @@ -131,7 +131,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) { SwWrtShell& rWrtShell = pAppView->GetWrtShell(); - SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess()->getPrinter( false ); + SfxPrinter* pPrt = rWrtShell.getIDocumentDeviceAccess().getPrinter( false ); if( pPrt ) pRet->Put(SwPtrItem(FN_PARAM_PRINTER, pPrt)); pRet->Put(SwPtrItem(FN_PARAM_WRTSHELL, &rWrtShell)); @@ -218,7 +218,7 @@ SfxItemSet* SwModule::CreateItemSet( sal_uInt16 nId ) // Options for PrintTabPage const SwPrintData* pOpt = pAppView ? - &pAppView->GetWrtShell().getIDocumentDeviceAccess()->getPrintData() : + &pAppView->GetWrtShell().getIDocumentDeviceAccess().getPrintData() : 0; if(!pOpt) @@ -383,7 +383,7 @@ void SwModule::ApplyItemSet( sal_uInt16 nId, const SfxItemSet& rSet ) *pOpt = *pAddPrinterAttr; if(pAppView) - pAppView->GetWrtShell().getIDocumentDeviceAccess()->setPrintData( *pOpt ); + pAppView->GetWrtShell().getIDocumentDeviceAccess().setPrintData( *pOpt ); } } diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx index 32cc3039accd..2530fa2608e6 100644 --- a/sw/source/uibase/app/docsh.cxx +++ b/sw/source/uibase/app/docsh.cxx @@ -1270,7 +1270,7 @@ bool SwDocShell::HasChangeRecordProtection() const { if (!m_pWrtShell) return false; - return m_pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength() > 0; + return m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().getLength() > 0; } void SwDocShell::SetChangeRecording( bool bActivate ) @@ -1286,8 +1286,8 @@ bool SwDocShell::SetProtectionPassword( const OUString &rNewPassword ) const SfxItemSet* pArgs = &aSet; const SfxPoolItem* pItem = NULL; - IDocumentRedlineAccess* pIDRA = m_pWrtShell->getIDocumentRedlineAccess(); - Sequence< sal_Int8 > aPasswd = pIDRA->GetRedlinePassword(); + IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess(); + Sequence< sal_Int8 > aPasswd = rIDRA.GetRedlinePassword(); if (pArgs && SfxItemState::SET == pArgs->GetItemState( FN_REDLINE_PROTECT, false, &pItem ) && static_cast<const SfxBoolItem*>(pItem)->GetValue() == (aPasswd.getLength() > 0)) return false; @@ -1301,12 +1301,12 @@ bool SwDocShell::SetProtectionPassword( const OUString &rNewPassword ) Sequence< sal_Int8 > aNewPasswd; SvPasswordHelper::GetHashPassword( aNewPasswd, rNewPassword ); - pIDRA->SetRedlinePassword( aNewPasswd ); + rIDRA.SetRedlinePassword( aNewPasswd ); bRes = true; } else { - pIDRA->SetRedlinePassword( Sequence< sal_Int8 >() ); + rIDRA.SetRedlinePassword( Sequence< sal_Int8 >() ); bRes = true; } @@ -1321,8 +1321,8 @@ bool SwDocShell::GetProtectionHash( /*out*/ ::com::sun::star::uno::Sequence< sal const SfxItemSet* pArgs = &aSet; const SfxPoolItem* pItem = NULL; - IDocumentRedlineAccess* pIDRA = m_pWrtShell->getIDocumentRedlineAccess(); - Sequence< sal_Int8 > aPasswdHash( pIDRA->GetRedlinePassword() ); + IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess(); + Sequence< sal_Int8 > aPasswdHash( rIDRA.GetRedlinePassword() ); if (pArgs && SfxItemState::SET == pArgs->GetItemState( FN_REDLINE_PROTECT, false, &pItem ) && static_cast<const SfxBoolItem*>(pItem)->GetValue() == (aPasswdHash.getLength() != 0)) return false; diff --git a/sw/source/uibase/app/docshini.cxx b/sw/source/uibase/app/docshini.cxx index a774e66b11e5..73ef5c352318 100644 --- a/sw/source/uibase/app/docshini.cxx +++ b/sw/source/uibase/app/docshini.cxx @@ -691,8 +691,8 @@ void SwDocShell::SubInitNew() /* * Document Interface Access */ -IDocumentDeviceAccess* SwDocShell::getIDocumentDeviceAccess() { return &m_pDoc->getIDocumentDeviceAccess(); } -const IDocumentSettingAccess* SwDocShell::getIDocumentSettingAccess() const { return &m_pDoc->getIDocumentSettingAccess(); } -IDocumentChartDataProviderAccess* SwDocShell::getIDocumentChartDataProviderAccess() { return &m_pDoc->getIDocumentChartDataProviderAccess(); } +IDocumentDeviceAccess& SwDocShell::getIDocumentDeviceAccess() { return m_pDoc->getIDocumentDeviceAccess(); } +const IDocumentSettingAccess& SwDocShell::getIDocumentSettingAccess() const { return m_pDoc->getIDocumentSettingAccess(); } +IDocumentChartDataProviderAccess& SwDocShell::getIDocumentChartDataProviderAccess() { return m_pDoc->getIDocumentChartDataProviderAccess(); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/uibase/app/docst.cxx b/sw/source/uibase/app/docst.cxx index 3c76f2564644..a81e1f5e006c 100644 --- a/sw/source/uibase/app/docst.cxx +++ b/sw/source/uibase/app/docst.cxx @@ -782,8 +782,8 @@ sal_uInt16 SwDocShell::Edit( // get one here. SwWrtShell* pCurrShell = (pActShell) ? pActShell : m_pWrtShell; if( ( HTMLMODE_ON & nHtmlMode ) && - !pCurrShell->getIDocumentDeviceAccess()->getPrinter( false ) ) - pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess()->getPrinter( true ) ); + !pCurrShell->getIDocumentDeviceAccess().getPrinter( false ) ) + pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess().getPrinter( true ) ); PutItem(SfxUInt16Item(SID_HTML_MODE, nHtmlMode)); FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode)); diff --git a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx index 84f6fddc86bb..e29cb22166c7 100644 --- a/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx +++ b/sw/source/uibase/dialog/SwSpellDialogChildWindow.cxx @@ -780,7 +780,7 @@ bool SwSpellDialogChildWindow::FindNextDrawTextError_Impl(SwWrtShell& rSh) aTmpOutliner.SetSpeller( xSpell ); OutlinerView* pOutlView = new OutlinerView( &aTmpOutliner, &(rView.GetEditWin()) ); - pOutlView->GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess()->getPrinter( false ) ); + pOutlView->GetOutliner()->SetRefDevice( rSh.getIDocumentDeviceAccess().getPrinter( false ) ); aTmpOutliner.InsertView( pOutlView ); Point aPt; Size aSize(1,1); diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx index 44185b4884fb..c6b6b817cd84 100644 --- a/sw/source/uibase/docvw/PostItMgr.cxx +++ b/sw/source/uibase/docvw/PostItMgr.cxx @@ -527,7 +527,7 @@ bool SwPostItMgr::CalcRects() mPages[aPageNum-1]->eSidebarPosition = pItem->maLayoutInfo.meSidebarPosition; } - if (!bChange && mpWrtShell->getIDocumentSettingAccess()->get(DocumentSettingId::BROWSE_MODE)) + if (!bChange && mpWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE)) { long nLayoutHeight = SwPostItHelper::getLayoutHeight( mpWrtShell->GetLayout() ); if( nLayoutHeight > mbLayoutHeight ) @@ -622,7 +622,7 @@ void SwPostItMgr::LayoutPostIts() mlPageBorder = mpEditWin->LogicToPixel( Point( mPages[n]->mPageRect.Left(), 0)).X() - GetSidebarWidth(true);// - GetSidebarBorderWidth(true); //bending point mlPageEnd = - mpWrtShell->getIDocumentSettingAccess()->get(DocumentSettingId::BROWSE_MODE) + mpWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE) ? pItem->maLayoutInfo.mPagePrtArea.Left() : mPages[n]->mPageRect.Left() + 350; } @@ -632,7 +632,7 @@ void SwPostItMgr::LayoutPostIts() mlPageBorder = mpEditWin->LogicToPixel( Point(mPages[n]->mPageRect.Right(), 0)).X() + GetSidebarBorderWidth(true); //bending point mlPageEnd = - mpWrtShell->getIDocumentSettingAccess()->get(DocumentSettingId::BROWSE_MODE) + mpWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE) ? pItem->maLayoutInfo.mPagePrtArea.Right() : mPages[n]->mPageRect.Right() - 350; } @@ -1631,7 +1631,7 @@ void SwPostItMgr::PrepareView(bool bIgnoreCount) SwRootFrm* pLayout = mpWrtShell->GetLayout(); if ( pLayout ) SwPostItHelper::setSidebarChanged( pLayout, - mpWrtShell->getIDocumentSettingAccess()->get( DocumentSettingId::BROWSE_MODE ) ); + mpWrtShell->getIDocumentSettingAccess().get( DocumentSettingId::BROWSE_MODE ) ); mpWrtShell->EndAllAction(); } } diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx index 8bf1c98a1dc7..e10179963aac 100644 --- a/sw/source/uibase/docvw/SidebarWin.cxx +++ b/sw/source/uibase/docvw/SidebarWin.cxx @@ -545,14 +545,14 @@ void SwSidebarWin::SetPosAndSize() { case sw::sidebarwindows::SidebarPosition::LEFT: { - aLineStart = EditWin()->PixelToLogic( Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) ); - aLineEnd = EditWin()->PixelToLogic( Point(GetPosPixel().X(),GetPosPixel().Y()-1) ); + aLineStart = EditWin().PixelToLogic( Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) ); + aLineEnd = EditWin().PixelToLogic( Point(GetPosPixel().X(),GetPosPixel().Y()-1) ); } break; case sw::sidebarwindows::SidebarPosition::RIGHT: { - aLineStart = EditWin()->PixelToLogic( Point(GetPosPixel().X(),GetPosPixel().Y()-1) ); - aLineEnd = EditWin()->PixelToLogic( Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) ); + aLineStart = EditWin().PixelToLogic( Point(GetPosPixel().X(),GetPosPixel().Y()-1) ); + aLineEnd = EditWin().PixelToLogic( Point(GetPosPixel().X()+GetSizePixel().Width(),GetPosPixel().Y()-1) ); } break; default: @@ -609,8 +609,8 @@ void SwSidebarWin::SetPosAndSize() if (bChange) { - Point aStart = EditWin()->PixelToLogic(GetPosPixel()+Point(0,GetSizePixel().Height())); - Point aEnd = EditWin()->PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height())); + Point aStart = EditWin().PixelToLogic(GetPosPixel()+Point(0,GetSizePixel().Height())); + Point aEnd = EditWin().PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height())); mpShadow->SetPosition(basegfx::B2DPoint(aStart.X(),aStart.Y()), basegfx::B2DPoint(aEnd.X(),aEnd.Y())); } @@ -818,8 +818,8 @@ void SwSidebarWin::SetSizePixel( const Size& rNewSize ) if (mpShadow) { - Point aStart = EditWin()->PixelToLogic(GetPosPixel()+Point(0,GetSizePixel().Height())); - Point aEnd = EditWin()->PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height())); + Point aStart = EditWin().PixelToLogic(GetPosPixel()+Point(0,GetSizePixel().Height())); + Point aEnd = EditWin().PixelToLogic(GetPosPixel()+Point(GetSizePixel().Width()-1,GetSizePixel().Height())); mpShadow->SetPosition(basegfx::B2DPoint(aStart.X(),aStart.Y()), basegfx::B2DPoint(aEnd.X(),aEnd.Y())); } } @@ -1096,9 +1096,9 @@ void SwSidebarWin::ExecuteCommand(sal_uInt16 nSlot) } } -SwEditWin* SwSidebarWin::EditWin() +SwEditWin& SwSidebarWin::EditWin() { - return &mrView.GetEditWin(); + return mrView.GetEditWin(); } long SwSidebarWin::GetPostItTextHeight() diff --git a/sw/source/uibase/docvw/edtwin2.cxx b/sw/source/uibase/docvw/edtwin2.cxx index 4f06e6fd2e10..c527e1244eea 100644 --- a/sw/source/uibase/docvw/edtwin2.cxx +++ b/sw/source/uibase/docvw/edtwin2.cxx @@ -188,8 +188,7 @@ void SwEditWin::RequestHelp(const HelpEvent &rEvt) // special handling if target is a cross-reference bookmark { OUString sTmpSearchStr = sText.copy( 1 ); - IDocumentMarkAccess* const pMarkAccess = - rSh.getIDocumentMarkAccess(); + IDocumentMarkAccess* pMarkAccess = rSh.getIDocumentMarkAccess(); IDocumentMarkAccess::const_iterator_t ppBkmk = pMarkAccess->findBookmark( sTmpSearchStr ); if ( ppBkmk != pMarkAccess->getBookmarksEnd() && diff --git a/sw/source/uibase/lingu/sdrhhcwrap.cxx b/sw/source/uibase/lingu/sdrhhcwrap.cxx index 5d8e364e5918..956e7a576180 100644 --- a/sw/source/uibase/lingu/sdrhhcwrap.cxx +++ b/sw/source/uibase/lingu/sdrhhcwrap.cxx @@ -74,7 +74,7 @@ SdrHHCWrapper::SdrHHCWrapper( SwView* pVw, SetPaperSize( aSize ); pOutlView = new OutlinerView( this, &(pView->GetEditWin()) ); - pOutlView->GetOutliner()->SetRefDevice(pView->GetWrtShell().getIDocumentDeviceAccess()->getPrinter( false )); + pOutlView->GetOutliner()->SetRefDevice(pView->GetWrtShell().getIDocumentDeviceAccess().getPrinter( false )); // Hack: all SdrTextObj attributes should be transferred to EditEngine pOutlView->SetBackgroundColor( Color( COL_WHITE ) ); diff --git a/sw/source/uibase/misc/redlndlg.cxx b/sw/source/uibase/misc/redlndlg.cxx index 39ac83783291..dd2f23f46ae3 100644 --- a/sw/source/uibase/misc/redlndlg.cxx +++ b/sw/source/uibase/misc/redlndlg.cxx @@ -295,7 +295,7 @@ void SwRedlineAcceptDlg::InitAuthors() if (pFilterPage->SelectAuthor(sOldAuthor) == LISTBOX_ENTRY_NOTFOUND && !aStrings.empty()) pFilterPage->SelectAuthor(aStrings[0]); - bool bEnable = pTable->GetEntryCount() != 0 && !pSh->getIDocumentRedlineAccess()->GetRedlinePassword().getLength(); + bool bEnable = pTable->GetEntryCount() != 0 && !pSh->getIDocumentRedlineAccess().GetRedlinePassword().getLength(); bool bSel = pTable->FirstSelected() != 0; SvTreeListEntry* pSelEntry = pTable->FirstSelected(); @@ -1014,7 +1014,7 @@ IMPL_LINK_NOARG_TYPED(SwRedlineAcceptDlg, GotoHdl, Timer *, void) pSh->EndAction(); SwViewShell::SetCareWin(NULL); } - bool bEnable = !pSh->getIDocumentRedlineAccess()->GetRedlinePassword().getLength(); + bool bEnable = !pSh->getIDocumentRedlineAccess().GetRedlinePassword().getLength(); pTPView->EnableAccept( bEnable && bSel /*&& !bReadonlySel*/ ); pTPView->EnableReject( bEnable && bSel && bIsNotFormated /*&& !bReadonlySel*/ ); pTPView->EnableRejectAll( bEnable && !bOnlyFormatedRedlines && !bHasReadonlySel ); diff --git a/sw/source/uibase/ribbar/inputwin.cxx b/sw/source/uibase/ribbar/inputwin.cxx index 2eed3b425667..7415b8b17aa2 100644 --- a/sw/source/uibase/ribbar/inputwin.cxx +++ b/sw/source/uibase/ribbar/inputwin.cxx @@ -448,9 +448,9 @@ IMPL_LINK( SwInputWindow, SelTableCellsNotify, SwWrtShell *, pCaller ) aPam.SetMark(); aPam.Move( fnMoveForward, fnGoSection ); - IDocumentContentOperations* pIDCO = pWrtShell->getIDocumentContentOperations(); - pIDCO->DeleteRange( aPam ); - pIDCO->InsertString( aPam, sNew ); + IDocumentContentOperations& rIDCO = pWrtShell->getIDocumentContentOperations(); + rIDCO.DeleteRange( aPam ); + rIDCO.InsertString( aPam, sNew ); pWrtShell->EndAllAction(); sOldFormula = sNew; } diff --git a/sw/source/uibase/shells/drwbassh.cxx b/sw/source/uibase/shells/drwbassh.cxx index 4e8637e7b889..ce7a272302c7 100644 --- a/sw/source/uibase/shells/drwbassh.cxx +++ b/sw/source/uibase/shells/drwbassh.cxx @@ -606,7 +606,7 @@ IMPL_LINK( SwDrawBaseShell, CheckGroupShapeNameHdl, AbstractSvxNameDialog*, pNam else { nRet = 1; - SwDrawModel* pModel = rSh.getIDocumentDrawModelAccess()->GetDrawModel(); + SwDrawModel* pModel = rSh.getIDocumentDrawModelAccess().GetDrawModel(); SdrObjListIter aIter( *(pModel->GetPage(0)), IM_DEEPWITHGROUPS ); while( aIter.IsMore() ) { diff --git a/sw/source/uibase/shells/textsh.cxx b/sw/source/uibase/shells/textsh.cxx index 9bab3ad99e38..cde79a064a83 100644 --- a/sw/source/uibase/shells/textsh.cxx +++ b/sw/source/uibase/shells/textsh.cxx @@ -439,7 +439,7 @@ void SwTextShell::ExecInsert(SfxRequest &rReq) + GetShell().GetBoxNms(); // get table data provider - xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider() ); + xDataProvider.set( GetView().GetDocShell()->getIDocumentChartDataProviderAccess().GetChartDataProvider() ); } else bFillWithData = false; // will create chart with only it's default image diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx index a210d2613909..8dcff4199011 100644 --- a/sw/source/uibase/shells/textsh1.cxx +++ b/sw/source/uibase/shells/textsh1.cxx @@ -938,7 +938,7 @@ void SwTextShell::Execute(SfxRequest &rReq) // Left border as offset //#i24363# tab stops relative to indent - const long nOff = rWrtSh.getIDocumentSettingAccess()->get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ? + const long nOff = rWrtSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT) ? static_cast<const SvxLRSpaceItem&>(aCoreSet.Get( RES_LR_SPACE )).GetTextLeft() : 0; SfxInt32Item aOff( SID_ATTR_TABSTOP_OFFSET, nOff ); aCoreSet.Put( aOff ); diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx index 6da2f8455932..1515a85c53ab 100644 --- a/sw/source/uibase/table/chartins.cxx +++ b/sw/source/uibase/table/chartins.cxx @@ -158,7 +158,7 @@ void SwInsertChart(vcl::Window* pParent, SfxBindings* pBindings ) aRangeString = pTableFormat->GetName() + "." + rWrtShell.GetBoxNms(); // get table data provider - xDataProvider.set( pView->GetDocShell()->getIDocumentChartDataProviderAccess()->GetChartDataProvider( true ) ); + xDataProvider.set( pView->GetDocShell()->getIDocumentChartDataProviderAccess().GetChartDataProvider( true ) ); } } diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index 5d1ad3befe8d..1b8993604bfc 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1647,25 +1647,25 @@ void SwPagePreview::ScrollDocSzChg() // All about printing SfxPrinter* SwPagePreview::GetPrinter( bool bCreate ) { - return pViewWin->GetViewShell()->getIDocumentDeviceAccess()->getPrinter( bCreate ); + return pViewWin->GetViewShell()->getIDocumentDeviceAccess().getPrinter( bCreate ); } sal_uInt16 SwPagePreview::SetPrinter( SfxPrinter *pNew, SfxPrinterChangeFlags nDiffFlags, bool ) { SwViewShell &rSh = *GetViewShell(); - SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false ); + SfxPrinter* pOld = rSh.getIDocumentDeviceAccess().getPrinter( false ); if ( pOld && pOld->IsPrinting() ) return SFX_PRINTERROR_BUSY; SwEditShell &rESh = static_cast<SwEditShell&>(rSh); //Buh... if( ( SfxPrinterChangeFlags::PRINTER | SfxPrinterChangeFlags::JOBSETUP ) & nDiffFlags ) { - rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true ); + rSh.getIDocumentDeviceAccess().setPrinter( pNew, true, true ); if( nDiffFlags & SfxPrinterChangeFlags::PRINTER ) rESh.SetModified(); } if ( ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS ) == SfxPrinterChangeFlags::OPTIONS ) - ::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, false ); + ::SetPrinter( &rSh.getIDocumentDeviceAccess(), pNew, false ); const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION); const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE); diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index db8aeba32fd3..69df7cbb1934 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -672,7 +672,7 @@ sal_uInt16 SwSrcView::SetPrinter(SfxPrinter* pNew, SfxPrinterChangeFlags nDiffFl pDocSh->SetModified(); } if ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS ) - ::SetPrinter( pDocSh->getIDocumentDeviceAccess(), pNew, true ); + ::SetPrinter( &pDocSh->getIDocumentDeviceAccess(), pNew, true ); const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION); const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE); diff --git a/sw/source/uibase/uiview/view0.cxx b/sw/source/uibase/uiview/view0.cxx index bd38b880477c..edd0b4211c93 100644 --- a/sw/source/uibase/uiview/view0.cxx +++ b/sw/source/uibase/uiview/view0.cxx @@ -243,7 +243,6 @@ void SwView::StateViewOptions(SfxItemSet &rSet) sal_uInt16 nWhich = aIter.FirstWhich(); SfxBoolItem aBool; const SwViewOption* pOpt = GetWrtShell().GetViewOptions(); - const IDocumentSettingAccess* pIDSA = GetDocShell()->getIDocumentSettingAccess(); while(nWhich) { @@ -327,7 +326,7 @@ void SwView::StateViewOptions(SfxItemSet &rSet) aBool.SetValue( pOpt->IsOnlineSpell() ); break; case FN_SHADOWCURSOR: - if (pIDSA == 0 || pOpt->getBrowseMode() ) + if ( pOpt->getBrowseMode() ) { rSet.DisableItem( nWhich ); nWhich = 0; diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 498a2627b1e4..a65b79af64ff 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -532,7 +532,7 @@ void SwView::Execute(SfxRequest &rReq) switch( nSlot ) { case SID_CREATE_SW_DRAWVIEW: - m_pWrtShell->getIDocumentDrawModelAccess()->GetOrCreateDrawModel(); + m_pWrtShell->getIDocumentDrawModelAccess().GetOrCreateDrawModel(); break; case FN_LINE_NUMBERING_DLG: @@ -573,8 +573,8 @@ void SwView::Execute(SfxRequest &rReq) if( pArgs && SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem )) { - IDocumentRedlineAccess* pIDRA = m_pWrtShell->getIDocumentRedlineAccess(); - Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword(); + IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess(); + Sequence <sal_Int8> aPasswd = rIDRA.GetRedlinePassword(); if( aPasswd.getLength() ) { OSL_ENSURE( !static_cast<const SfxBoolItem*>(pItem)->GetValue(), "SwView::Execute(): password set an redlining off doesn't match!" ); @@ -590,10 +590,10 @@ void SwView::Execute(SfxRequest &rReq) //#i69751# the result of Execute() can be ignored (void)aPasswdDlg->Execute(); OUString sNewPasswd( aPasswdDlg->GetPassword() ); - Sequence <sal_Int8> aNewPasswd = pIDRA->GetRedlinePassword(); + Sequence <sal_Int8> aNewPasswd = rIDRA.GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd)) - pIDRA->SetRedlinePassword(Sequence <sal_Int8> ()); + rIDRA.SetRedlinePassword(Sequence <sal_Int8> ()); else { // xmlsec05: message box for wrong password break; @@ -609,8 +609,8 @@ void SwView::Execute(SfxRequest &rReq) break; case FN_REDLINE_PROTECT : { - IDocumentRedlineAccess* pIDRA = m_pWrtShell->getIDocumentRedlineAccess(); - Sequence <sal_Int8> aPasswd = pIDRA->GetRedlinePassword(); + IDocumentRedlineAccess& rIDRA = m_pWrtShell->getIDocumentRedlineAccess(); + Sequence <sal_Int8> aPasswd = rIDRA.GetRedlinePassword(); if( pArgs && SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem ) && static_cast<const SfxBoolItem*>(pItem)->GetValue() == ( aPasswd.getLength() != 0 ) ) break; @@ -632,18 +632,18 @@ void SwView::Execute(SfxRequest &rReq) sal_uInt16 nOn = nsRedlineMode_t::REDLINE_ON; OUString sNewPasswd( aPasswdDlg->GetPassword() ); Sequence <sal_Int8> aNewPasswd = - pIDRA->GetRedlinePassword(); + rIDRA.GetRedlinePassword(); SvPasswordHelper::GetHashPassword( aNewPasswd, sNewPasswd ); if(!aPasswd.getLength()) { - pIDRA->SetRedlinePassword(aNewPasswd); + rIDRA.SetRedlinePassword(aNewPasswd); } else if(SvPasswordHelper::CompareHashPassword(aPasswd, sNewPasswd)) { - pIDRA->SetRedlinePassword(Sequence <sal_Int8> ()); + rIDRA.SetRedlinePassword(Sequence <sal_Int8> ()); nOn = 0; } - const sal_uInt16 nMode = pIDRA->GetRedlineMode(); + const sal_uInt16 nMode = rIDRA.GetRedlineMode(); m_pWrtShell->SetRedlineModeAndCheckInsMode( (nMode & ~nsRedlineMode_t::REDLINE_ON) | nOn); rReq.AppendItem( SfxBoolItem( FN_REDLINE_PROTECT, ((nMode&nsRedlineMode_t::REDLINE_ON)==0) ) ); } @@ -1438,7 +1438,7 @@ void SwView::StateStatusLine(SfxItemSet &rSet) SvxZoomSliderItem aZoomSliderItem( nCurrentZoom, MINZOOM, MAXZOOM ); aZoomSliderItem.AddSnappingPoint( 100 ); - if ( !m_pWrtShell->getIDocumentSettingAccess()->get(DocumentSettingId::BROWSE_MODE) ) + if ( !m_pWrtShell->getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE) ) { const sal_uInt16 nColumns = pVOpt->GetViewLayoutColumns(); const bool bAutomaticViewLayout = 0 == nColumns; @@ -1761,7 +1761,7 @@ void SwView::ExecuteStatusLine(SfxRequest &rReq) case SID_ATTR_VIEWLAYOUT: { - if ( pArgs && !rSh.getIDocumentSettingAccess()->get(DocumentSettingId::BROWSE_MODE) && + if ( pArgs && !rSh.getIDocumentSettingAccess().get(DocumentSettingId::BROWSE_MODE) && ( ( GetDocShell()->GetCreateMode() != SfxObjectCreateMode::EMBEDDED ) || !GetDocShell()->IsInPlaceActive() ) ) { if ( SfxItemState::SET == pArgs->GetItemState(SID_ATTR_VIEWLAYOUT, true, &pItem )) diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index 7540776fb21c..b81cf88835d9 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -522,7 +522,7 @@ bool SwView::BeginTextEdit(SdrObject* pObj, SdrPageView* pPV, vcl::Window* pWin, uno::Reference< linguistic2::XSpellChecker1 > xSpell( ::GetSpellChecker() ); if (pOutliner) { - pOutliner->SetRefDevice(pSh->getIDocumentDeviceAccess()->getReferenceDevice(false)); + pOutliner->SetRefDevice(pSh->getIDocumentDeviceAccess().getReferenceDevice(false)); pOutliner->SetSpeller(xSpell); uno::Reference<linguistic2::XHyphenator> xHyphenator( ::GetHyphenator() ); pOutliner->SetHyphenator( xHyphenator ); diff --git a/sw/source/uibase/uiview/viewprt.cxx b/sw/source/uibase/uiview/viewprt.cxx index 281567a2fa5d..64c371ec705b 100644 --- a/sw/source/uibase/uiview/viewprt.cxx +++ b/sw/source/uibase/uiview/viewprt.cxx @@ -71,9 +71,9 @@ using namespace ::com::sun::star; SfxPrinter* SwView::GetPrinter( bool bCreate ) { - const IDocumentDeviceAccess* pIDDA = GetWrtShell().getIDocumentDeviceAccess(); - SfxPrinter *pOld = pIDDA->getPrinter( false ); - SfxPrinter *pPrt = pIDDA->getPrinter( bCreate ); + const IDocumentDeviceAccess& rIDDA = GetWrtShell().getIDocumentDeviceAccess(); + SfxPrinter *pOld = rIDDA.getPrinter( false ); + SfxPrinter *pPrt = rIDDA.getPrinter( bCreate ); if ( pOld != pPrt ) { bool bWeb = 0 != dynamic_cast<SwWebView*>(this); @@ -107,19 +107,19 @@ void SetPrinter( IDocumentDeviceAccess* pIDDA, SfxPrinter* pNew, bool bWeb ) sal_uInt16 SwView::SetPrinter(SfxPrinter* pNew, SfxPrinterChangeFlags nDiffFlags, bool ) { SwWrtShell &rSh = GetWrtShell(); - SfxPrinter* pOld = rSh.getIDocumentDeviceAccess()->getPrinter( false ); + SfxPrinter* pOld = rSh.getIDocumentDeviceAccess().getPrinter( false ); if ( pOld && pOld->IsPrinting() ) return SFX_PRINTERROR_BUSY; if ( (SfxPrinterChangeFlags::JOBSETUP | SfxPrinterChangeFlags::PRINTER) & nDiffFlags ) { - rSh.getIDocumentDeviceAccess()->setPrinter( pNew, true, true ); + rSh.getIDocumentDeviceAccess().setPrinter( pNew, true, true ); if ( nDiffFlags & SfxPrinterChangeFlags::PRINTER ) rSh.SetModified(); } bool bWeb = this->ISA(SwWebView); if ( nDiffFlags & SfxPrinterChangeFlags::OPTIONS ) - ::SetPrinter( rSh.getIDocumentDeviceAccess(), pNew, bWeb ); + ::SetPrinter( &rSh.getIDocumentDeviceAccess(), pNew, bWeb ); const bool bChgOri = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_ORIENTATION); const bool bChgSize = bool(nDiffFlags & SfxPrinterChangeFlags::CHG_SIZE); @@ -273,10 +273,10 @@ VclPtr<SfxTabPage> CreatePrintOptionsPage( vcl::Window *pParent, void SetAppPrintOptions( SwViewShell* pSh, bool bWeb ) { - const IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess(); - SwPrintData aPrtData = pIDDA->getPrintData(); + const IDocumentDeviceAccess& rIDDA = pSh->getIDocumentDeviceAccess(); + SwPrintData aPrtData = rIDDA.getPrintData(); - if( pIDDA->getPrinter( false ) ) + if( rIDDA.getPrinter( false ) ) { // Close application own printing options in SfxPrinter. SwAddPrinterItem aAddPrinterItem (FN_PARAM_ADDPRINTER, aPrtData); @@ -299,7 +299,7 @@ void SetAppPrintOptions( SwViewShell* pSh, bool bWeb ) static_cast<int>(aMisc.IsPaperSizeWarning() ? SfxPrinterChangeFlags::CHG_SIZE : SfxPrinterChangeFlags::NONE) | static_cast<int>(aMisc.IsPaperOrientationWarning() ? SfxPrinterChangeFlags::CHG_ORIENTATION : SfxPrinterChangeFlags::NONE ))); - pIDDA->getPrinter( true )->SetOptions( aSet ); + rIDDA.getPrinter( true )->SetOptions( aSet ); } } diff --git a/sw/source/uibase/uiview/viewstat.cxx b/sw/source/uibase/uiview/viewstat.cxx index 1315f6867c94..cfc2f0210a40 100644 --- a/sw/source/uibase/uiview/viewstat.cxx +++ b/sw/source/uibase/uiview/viewstat.cxx @@ -391,7 +391,7 @@ void SwView::GetState(SfxItemSet &rSet) case SID_DOCUMENT_COMPARE: case SID_DOCUMENT_MERGE: if( GetDocShell()->IsA( SwGlobalDocShell::StaticType() ) || - (SID_DOCUMENT_MERGE == nWhich && m_pWrtShell->getIDocumentRedlineAccess()->GetRedlinePassword().getLength())) + (SID_DOCUMENT_MERGE == nWhich && m_pWrtShell->getIDocumentRedlineAccess().GetRedlinePassword().getLength())) rSet.DisableItem(nWhich); break; case SID_VIEW_DATA_SOURCE_BROWSER: diff --git a/sw/source/uibase/uiview/viewtab.cxx b/sw/source/uibase/uiview/viewtab.cxx index 5245344ddb3f..23c9b59ab92b 100644 --- a/sw/source/uibase/uiview/viewtab.cxx +++ b/sw/source/uibase/uiview/viewtab.cxx @@ -1022,7 +1022,7 @@ void SwView::StateTabWin(SfxItemSet& rSet) m_pVRuler->SetStyle(bVerticalWriting ? nRulerStyle|WB_EXTRAFIELD : nRulerStyle); //#i24363# tab stops relative to indent - bool bRelative = rSh.getIDocumentSettingAccess()->get(DocumentSettingId::TABS_RELATIVE_TO_INDENT); + bool bRelative = rSh.getIDocumentSettingAccess().get(DocumentSettingId::TABS_RELATIVE_TO_INDENT); m_pHRuler->SetTabsRelativeToIndent( bRelative ); m_pVRuler->SetTabsRelativeToIndent( bRelative ); diff --git a/sw/source/uibase/uno/unoatxt.cxx b/sw/source/uibase/uno/unoatxt.cxx index 26e29830af18..15d6f2619509 100644 --- a/sw/source/uibase/uno/unoatxt.cxx +++ b/sw/source/uibase/uno/unoatxt.cxx @@ -312,7 +312,7 @@ static bool lcl_CopySelToDoc( SwDoc* pInsDoc, OTextCursorHelper* pxCursor, SwXTe bool bRet = false; pInsDoc->getIDocumentFieldsAccess().LockExpFields(); { - SwDoc *const pDoc((pxCursor) ? pxCursor->GetDoc() : pxRange->GetDoc()); + SwDoc *const pDoc((pxCursor) ? pxCursor->GetDoc() : &pxRange->GetDoc()); SwPaM aPam(pDoc->GetNodes()); SwPaM * pPam(0); if(pxCursor) @@ -923,7 +923,7 @@ void SwXAutoTextEntry::applyTo(const uno::Reference< text::XTextRange > & xTextR SwDoc* pDoc = 0; if (pRange) - pDoc = pRange->GetDoc(); + pDoc = &pRange->GetDoc(); else if ( pCursor ) pDoc = pCursor->GetDoc(); else if ( pText && pText->GetDoc() ) diff --git a/sw/source/uibase/uno/unomailmerge.cxx b/sw/source/uibase/uno/unomailmerge.cxx index b2a954f82488..f5cc22988cf9 100644 --- a/sw/source/uibase/uno/unomailmerge.cxx +++ b/sw/source/uibase/uno/unomailmerge.cxx @@ -684,10 +684,10 @@ uno::Any SAL_CALL SwXMailMerge::execute( { case MailMergeType::PRINTER: { - IDocumentDeviceAccess* pIDDA = rSh.getIDocumentDeviceAccess(); - SwPrintData aPrtData( pIDDA->getPrintData() ); + IDocumentDeviceAccess& rIDDA = rSh.getIDocumentDeviceAccess(); + SwPrintData aPrtData( rIDDA.getPrintData() ); aPrtData.SetPrintSingleJobs( bCurSinglePrintJobs ); - pIDDA->setPrintData( aPrtData ); + rIDDA.setPrintData( aPrtData ); // #i25686# printing should not be done asynchronously to prevent dangling offices // when mail merge is called as command line macro aMergeDesc.bPrintAsync = false; diff --git a/sw/source/uibase/uno/unotxdoc.cxx b/sw/source/uibase/uno/unotxdoc.cxx index fa53d49e8622..9a31a3b017da 100644 --- a/sw/source/uibase/uno/unotxdoc.cxx +++ b/sw/source/uibase/uno/unotxdoc.cxx @@ -721,9 +721,9 @@ SwUnoCrsr* SwXTextDocument::CreateCursorForSearch(Reference< XTextCursor > & xCr SwXTextCursor *const pXTextCursor = pBText->CreateTextCursor(true); xCrsr.set( static_cast<text::XWordCursor*>(pXTextCursor) ); - auto pUnoCrsr(pXTextCursor->GetCursor()); - pUnoCrsr->SetRemainInSection(false); - return pUnoCrsr; + auto& rUnoCrsr(pXTextCursor->GetCursor()); + rUnoCrsr.SetRemainInSection(false); + return &rUnoCrsr; } sal_Int32 SwXTextDocument::replaceAll(const Reference< util::XSearchDescriptor > & xDesc) @@ -1688,7 +1688,7 @@ css::uno::Reference<css::uno::XInterface> SwXTextDocument::create( { return Reference<XInterface>( dynamic_cast<chart2::data::XDataProvider *>( - pDocShell->getIDocumentChartDataProviderAccess()-> + pDocShell->getIDocumentChartDataProviderAccess(). GetChartDataProvider())); } if (!rServiceName.startsWith("com.sun.star.") diff --git a/sw/source/uibase/uno/unotxvw.cxx b/sw/source/uibase/uno/unotxvw.cxx index 631e6efe23a0..684c95ea9b90 100644 --- a/sw/source/uibase/uno/unotxvw.cxx +++ b/sw/source/uibase/uno/unotxvw.cxx @@ -642,7 +642,7 @@ void SAL_CALL SwXTextView::setRubyList( SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc() { SwWrtShell& rOldSh = m_pView->GetWrtShell(); - SfxPrinter *pPrt = rOldSh.getIDocumentDeviceAccess()->getPrinter( false ); + SfxPrinter *pPrt = rOldSh.getIDocumentDeviceAccess().getPrinter( false ); SwDocShell* pDocSh; SfxObjectShellLock xDocSh( pDocSh = new SwDocShell( /*pPrtDoc, */SfxObjectCreateMode::STANDARD ) ); xDocSh->DoInitNew( 0 ); @@ -655,18 +655,18 @@ SfxObjectShellLock SwXTextView::BuildTmpSelectionDoc() pDocView->AttrChangedNotify( &pDocView->GetWrtShell() );//So that SelectShell is called. SwWrtShell* pSh = pDocView->GetWrtShellPtr(); - IDocumentDeviceAccess* pIDDA = pSh->getIDocumentDeviceAccess(); - SfxPrinter* pTempPrinter = pIDDA->getPrinter( true ); + IDocumentDeviceAccess& rIDDA = pSh->getIDocumentDeviceAccess(); + SfxPrinter* pTempPrinter = rIDDA.getPrinter( true ); const SwPageDesc& rCurPageDesc = rOldSh.GetPageDesc(rOldSh.GetCurPageDesc()); - IDocumentDeviceAccess* pIDDA_old = rOldSh.getIDocumentDeviceAccess(); + IDocumentDeviceAccess& rIDDA_old = rOldSh.getIDocumentDeviceAccess(); - if( pIDDA_old->getPrinter( false ) ) + if( rIDDA_old.getPrinter( false ) ) { - pIDDA->setJobsetup( *pIDDA_old->getJobsetup() ); + rIDDA.setJobsetup( *rIDDA_old.getJobsetup() ); //#69563# if it isn't the same printer then the pointer has been invalidated! - pTempPrinter = pIDDA->getPrinter( true ); + pTempPrinter = rIDDA.getPrinter( true ); } pTempPrinter->SetPaperBin(rCurPageDesc.GetMaster().GetPaperBin().GetValue()); @@ -1107,7 +1107,7 @@ void SwXTextViewCursor::gotoRange( } else if (pRange) { - SwPaM aPam(pRange->GetDoc()->GetNodes()); + SwPaM aPam(pRange->GetDoc().GetNodes()); if (pRange->GetPositions(aPam)) { pSrcNode = &aPam.GetNode(); diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index b81bc63c777f..388b8101bd35 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -427,7 +427,7 @@ void SwContentType::Init(bool* pbInvalidateWindow) { sTypeToken.clear(); nMemberCount = 0; - SwDrawModel* pModel = pWrtShell->getIDocumentDrawModelAccess()->GetDrawModel(); + SwDrawModel* pModel = pWrtShell->getIDocumentDrawModelAccess().GetDrawModel(); if(pModel) { SdrPage* pPage = pModel->GetPage(0); @@ -736,8 +736,8 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) else if(!pMember->empty()) pMember->DeleteAndDestroyAll(); - IDocumentDrawModelAccess* pIDDMA = pWrtShell->getIDocumentDrawModelAccess(); - SwDrawModel* pModel = pIDDMA->GetDrawModel(); + IDocumentDrawModelAccess& rIDDMA = pWrtShell->getIDocumentDrawModelAccess(); + SwDrawModel* pModel = rIDDMA.GetDrawModel(); if(pModel) { SdrPage* pPage = pModel->GetPage(0); @@ -757,7 +757,7 @@ void SwContentType::FillMemberList(bool* pbLevelOrVisibilityChanged) this, pTemp->GetName(), nYPos); - if(!pIDDMA->IsVisibleLayerId(pTemp->GetLayer())) + if(!rIDDMA.IsVisibleLayerId(pTemp->GetLayer())) pCnt->SetInvisible(); pMember->insert(pCnt); nMemberCount++; @@ -3367,7 +3367,7 @@ void SwContentTree::GotoContent(SwContent* pCnt) { pDrawView->SdrEndTextEdit(); pDrawView->UnmarkAll(); - SwDrawModel* _pModel = pActiveShell->getIDocumentDrawModelAccess()->GetDrawModel(); + SwDrawModel* _pModel = pActiveShell->getIDocumentDrawModelAccess().GetDrawModel(); SdrPage* pPage = _pModel->GetPage(0); const size_t nCount = pPage->GetObjCount(); for( size_t i=0; i<nCount; ++i ) @@ -3460,8 +3460,8 @@ void SwContentTree::InitEntry(SvTreeListEntry* pEntry, { const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); - SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite )); - SwContentLBoxString* pStr = new SwContentLBoxString( pEntry, 0, pCol->GetText() ); + SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite )); + SwContentLBoxString* pStr = new SwContentLBoxString( pEntry, 0, rCol.GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 42131fa4279d..8b2c4d39ec99 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -1232,8 +1232,8 @@ void SwGlobalTree::InitEntry(SvTreeListEntry* pEntry, { const size_t nColToHilite = 1; //0==Bitmap;1=="Column1";2=="Column2" SvTreeListBox::InitEntry( pEntry, rStr, rImg1, rImg2, eButtonKind ); - SvLBoxString* pCol = static_cast<SvLBoxString*>(pEntry->GetItem( nColToHilite )); - SwLBoxString* pStr = new SwLBoxString( pEntry, 0, pCol->GetText() ); + SvLBoxString& rCol = static_cast<SvLBoxString&>(pEntry->GetItem( nColToHilite )); + SwLBoxString* pStr = new SwLBoxString( pEntry, 0, rCol.GetText() ); pEntry->ReplaceItem( pStr, nColToHilite ); } |