diff options
author | Caolán McNamara <caolanm@redhat.com> | 2023-02-16 10:42:06 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2023-02-16 15:13:21 +0000 |
commit | 0908c7c1184ab7acb7b6f6740a82c2f12c296fae (patch) | |
tree | 7bfe09dce871f6f2bc59a81b689d7ab5a3a6f3ea /sc/source/ui | |
parent | e71080e19365aa074c56d1136dad2b09783949a2 (diff) |
SfxViewShell::GetViewFrame never returns null, change to a reference
various null checks can be seen to be redundant and removed
Change-Id: Icf49c1de4b0302795d2769a370af3abceaad0221
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147147
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sc/source/ui')
55 files changed, 406 insertions, 438 deletions
diff --git a/sc/source/ui/Accessibility/AccessibleDocument.cxx b/sc/source/ui/Accessibility/AccessibleDocument.cxx index 475dd9597673..304c8932b1b7 100644 --- a/sc/source/ui/Accessibility/AccessibleDocument.cxx +++ b/sc/source/ui/Accessibility/AccessibleDocument.cxx @@ -288,17 +288,14 @@ ScChildrenShapes::ScChildrenShapes(ScAccessibleDocument* pAccessibleDocument, Sc { if (mpViewShell) { - SfxViewFrame* pViewFrame = mpViewShell->GetViewFrame(); - if (pViewFrame) + SfxViewFrame& rViewFrame = mpViewShell->GetViewFrame(); + xSelectionSupplier = uno::Reference<view::XSelectionSupplier>(rViewFrame.GetFrame().GetController(), uno::UNO_QUERY); + if (xSelectionSupplier.is()) { - xSelectionSupplier = uno::Reference<view::XSelectionSupplier>(pViewFrame->GetFrame().GetController(), uno::UNO_QUERY); - if (xSelectionSupplier.is()) - { - xSelectionSupplier->addSelectionChangeListener(mpAccessibleDocument); - uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes()); - if (xShapes.is()) - mnShapesSelected = xShapes->getCount(); - } + xSelectionSupplier->addSelectionChangeListener(mpAccessibleDocument); + uno::Reference<drawing::XShapes> xShapes(mpViewShell->getSelectedXShapes()); + if (xShapes.is()) + mnShapesSelected = xShapes->getCount(); } } diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx index f80b6c1b49a8..8d310e1c94d5 100644 --- a/sc/source/ui/app/inputhdl.cxx +++ b/sc/source/ui/app/inputhdl.cxx @@ -878,7 +878,7 @@ void ScInputHandler::UpdateRefDevice() return; bool bTextWysiwyg = SC_MOD()->GetInputOptions().GetTextWysiwyg(); - bool bInPlace = pActiveViewSh && pActiveViewSh->GetViewFrame()->GetFrame().IsInPlace(); + bool bInPlace = pActiveViewSh && pActiveViewSh->GetViewFrame().GetFrame().IsInPlace(); EEControlBits nCtrl = mpEditEngine->GetControlWord(); if ( bTextWysiwyg || bInPlace ) nCtrl |= EEControlBits::FORMAT100; // EditEngine default: always format for 100% @@ -2860,11 +2860,11 @@ void ScInputHandler::ShowRefFrame() return; bool bFound = false; - SfxViewFrame* pRefFrame = pRefViewSh->GetViewFrame(); + SfxViewFrame& rRefFrame = pRefViewSh->GetViewFrame(); SfxViewFrame* pOneFrame = SfxViewFrame::GetFirst(); while ( pOneFrame && !bFound ) { - if ( pOneFrame == pRefFrame ) + if ( pOneFrame == &rRefFrame ) bFound = true; pOneFrame = SfxViewFrame::GetNext( *pOneFrame ); } @@ -3371,7 +3371,7 @@ void ScInputHandler::EnterHandler( ScEnterMode nBlockMode, bool bBeforeSavingInL if ( pExecuteSh ) { - SfxBindings& rBindings = pExecuteSh->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pExecuteSh->GetViewFrame().GetBindings(); sal_uInt16 nId = FID_INPUTLINE_ENTER; if ( nBlockMode == ScEnterMode::BLOCK ) diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index ed82c9d7a0a3..f833e743b991 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -2607,8 +2607,8 @@ void ScPosWnd::DoEnter() else if (eType == SC_MANAGE_NAMES) { sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pViewSh->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pViewSh->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); } diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index d194fdc1070e..9f88e92ceb45 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -841,8 +841,8 @@ bool ScValidationDlg::EnterRefStatus() if( !pTabViewShell ) return false; sal_uInt16 nId = SLOTID; - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); if (pWnd && pWnd->GetController().get() != this) pWnd = nullptr; @@ -858,8 +858,8 @@ bool ScValidationDlg::LeaveRefStatus() if( !pTabViewShell ) return false; sal_uInt16 nId = SLOTID; - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - if ( pViewFrm->GetChildWindow( nId ) ) + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + if (rViewFrm.GetChildWindow(nId)) { DoClose( nId ); } @@ -888,7 +888,7 @@ bool ScValidationDlg::RemoveRefDlg( bool bRestoreModal /* = true */ ) if( !pTabVwSh ) return false; - if ( SfxChildWindow* pWnd = pTabVwSh->GetViewFrame()->GetChildWindow( SID_VALIDITY_REFERENCE ) ) + if ( SfxChildWindow* pWnd = pTabVwSh->GetViewFrame().GetChildWindow( SID_VALIDITY_REFERENCE ) ) { bVisLock = static_cast<ScValidityRefChildWin*>(pWnd)->LockVisible( true ); bFreeWindowLock = static_cast<ScValidityRefChildWin*>(pWnd)->LockFreeWindow( true ); @@ -905,7 +905,7 @@ bool ScValidationDlg::RemoveRefDlg( bool bRestoreModal /* = true */ ) } } - if ( SfxChildWindow* pWnd = pTabVwSh->GetViewFrame()->GetChildWindow( SID_VALIDITY_REFERENCE ) ) + if ( SfxChildWindow* pWnd = pTabVwSh->GetViewFrame().GetChildWindow( SID_VALIDITY_REFERENCE ) ) { static_cast<ScValidityRefChildWin*>(pWnd)->LockVisible( bVisLock ); static_cast<ScValidityRefChildWin*>(pWnd)->LockFreeWindow( bFreeWindowLock ); diff --git a/sc/source/ui/docshell/datastream.cxx b/sc/source/ui/docshell/datastream.cxx index 2124753bf529..55b2f93381f5 100644 --- a/sc/source/ui/docshell/datastream.cxx +++ b/sc/source/ui/docshell/datastream.cxx @@ -240,7 +240,7 @@ void DataStream::MakeToolbarVisible() return; css::uno::Reference< css::frame::XFrame > xFrame = - pViewData->GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); + pViewData->GetViewShell()->GetViewFrame().GetFrame().GetFrameInterface(); if (!xFrame.is()) return; diff --git a/sc/source/ui/docshell/docsh.cxx b/sc/source/ui/docshell/docsh.cxx index 9d7b77b888e5..f37b969bd344 100644 --- a/sc/source/ui/docshell/docsh.cxx +++ b/sc/source/ui/docshell/docsh.cxx @@ -767,7 +767,7 @@ void ScDocShell::Notify( SfxBroadcaster&, const SfxHint& rHint ) uno::Reference< task::XJob > xJob( xFactory->createInstanceWithContext( xContext ), uno::UNO_QUERY_THROW ); ScViewData* pViewData = GetViewData(); SfxViewShell* pViewShell = ( pViewData ? pViewData->GetViewShell() : nullptr ); - SfxViewFrame* pViewFrame = ( pViewShell ? pViewShell->GetViewFrame() : nullptr ); + SfxViewFrame* pViewFrame = ( pViewShell ? &pViewShell->GetViewFrame() : nullptr ); SfxFrame* pFrame = ( pViewFrame ? &pViewFrame->GetFrame() : nullptr ); uno::Reference< frame::XController > xController = ( pFrame ? pFrame->GetController() : nullptr ); uno::Reference< sheet::XSpreadsheetView > xSpreadsheetView( xController, uno::UNO_QUERY_THROW ); diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx index 5903d575590e..72ca520453b8 100644 --- a/sc/source/ui/docshell/docsh4.cxx +++ b/sc/source/ui/docshell/docsh4.cxx @@ -1863,7 +1863,7 @@ void ScDocShell::ExecutePageStyle( const SfxViewShell& rCaller, // memorizing for GetState(): GetPageOnFromPageStyleSet( &rStyleSet, nCurTab, m_bHeaderOn, m_bFooterOn ); - rCaller.GetViewFrame()->GetBindings().Invalidate( SID_HFEDIT ); + rCaller.GetViewFrame().GetBindings().Invalidate( SID_HFEDIT ); ScStyleSaveData aNewData; aNewData.InitFromStyle( pStyleSheet ); @@ -2631,7 +2631,7 @@ SfxBindings* ScDocShell::GetViewBindings() SfxViewShell* pViewSh = GetBestViewShell(); if (pViewSh) - return &pViewSh->GetViewFrame()->GetBindings(); + return &pViewSh->GetViewFrame().GetBindings(); else return nullptr; } diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx index 568218da662b..d5f50377a8a8 100644 --- a/sc/source/ui/drawfunc/drawsh.cxx +++ b/sc/source/ui/drawfunc/drawsh.cxx @@ -127,7 +127,7 @@ void ScDrawShell::setModified() static void lcl_invalidateTransformAttr(const ScTabViewShell* pViewShell) { - SfxBindings& rBindings=pViewShell->GetViewFrame()->GetBindings(); + SfxBindings& rBindings=pViewShell->GetViewFrame().GetBindings(); rBindings.Invalidate(SID_ATTR_TRANSFORM_WIDTH); rBindings.Invalidate(SID_ATTR_TRANSFORM_HEIGHT); rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_X); @@ -432,7 +432,7 @@ void ScDrawShell::ExecuteMacroAssign(SdrObject* pObj, weld::Window* pWin) css::uno::Reference < css::frame::XFrame > xFrame; if (GetViewShell()) - xFrame = GetViewShell()->GetViewFrame()->GetFrame().GetFrameInterface(); + xFrame = GetViewShell()->GetViewFrame().GetFrame().GetFrameInterface(); SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractDialog> pMacroDlg(pFact->CreateEventConfigDialog( pWin, aItemSet, xFrame )); diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx index db3fd0541b83..1b83e930c8c1 100644 --- a/sc/source/ui/drawfunc/drawsh2.cxx +++ b/sc/source/ui/drawfunc/drawsh2.cxx @@ -94,8 +94,8 @@ void ScDrawShell::GetState( SfxItemSet& rSet ) // Conditions / Toggles rSet.Put( SfxBoolItem( SID_BEZIER_EDIT, !pView->IsFrameDragSingles() ) ); sal_uInt16 nFWId = ScGetFontWorkId(); - SfxViewFrame* pViewFrm = rViewData.GetViewShell()->GetViewFrame(); - rSet.Put(SfxBoolItem(SID_FONTWORK, pViewFrm->HasChildWindow(nFWId))); + SfxViewFrame& rViewFrm = rViewData.GetViewShell()->GetViewFrame(); + rSet.Put(SfxBoolItem(SID_FONTWORK, rViewFrm.HasChildWindow(nFWId))); // Notes always default to Page anchor. bool bDisableAnchor = false; diff --git a/sc/source/ui/drawfunc/drawsh5.cxx b/sc/source/ui/drawfunc/drawsh5.cxx index b95f77f9339c..4e95a7d65b07 100644 --- a/sc/source/ui/drawfunc/drawsh5.cxx +++ b/sc/source/ui/drawfunc/drawsh5.cxx @@ -462,15 +462,15 @@ void ScDrawShell::ExecDrawFunc( SfxRequest& rReq ) case SID_FONTWORK: { sal_uInt16 nId = ScGetFontWorkId(); - SfxViewFrame* pViewFrm = rViewData.GetViewShell()->GetViewFrame(); + SfxViewFrame& rViewFrm = rViewData.GetViewShell()->GetViewFrame(); if ( rReq.GetArgs() ) - pViewFrm->SetChildWindow( nId, + rViewFrm.SetChildWindow( nId, static_cast<const SfxBoolItem&>( (rReq.GetArgs()->Get(SID_FONTWORK))). GetValue() ); else - pViewFrm->ToggleChildWindow( nId ); + rViewFrm.ToggleChildWindow( nId ); rBindings.Invalidate( SID_FONTWORK ); rReq.Done(); diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx index f6e8982bd74d..f428465936b3 100644 --- a/sc/source/ui/drawfunc/drtxtob.cxx +++ b/sc/source/ui/drawfunc/drtxtob.cxx @@ -304,7 +304,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) { // Ensure the field is selected first pOutView->SelectFieldAtCursor(); - mrViewData.GetViewShell()->GetViewFrame()->GetDispatcher()->Execute(SID_HYPERLINK_DIALOG); + mrViewData.GetViewShell()->GetViewFrame().GetDispatcher()->Execute(SID_HYPERLINK_DIALOG); } break; @@ -357,8 +357,8 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq ) void ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) { - SfxViewFrame* pViewFrm = mrViewData.GetViewShell()->GetViewFrame(); - bool bHasFontWork = pViewFrm->HasChildWindow(SID_FONTWORK); + SfxViewFrame& rViewFrm = mrViewData.GetViewShell()->GetViewFrame(); + bool bHasFontWork = rViewFrm.HasChildWindow(SID_FONTWORK); bool bDisableFontWork = false; if (IsNoteEdit()) @@ -417,13 +417,13 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet ) } if( rSet.GetItemState( SID_TRANSLITERATE_HALFWIDTH ) != SfxItemState::UNKNOWN ) - ScViewUtil::HideDisabledSlot( rSet, pViewFrm->GetBindings(), SID_TRANSLITERATE_HALFWIDTH ); + ScViewUtil::HideDisabledSlot( rSet, rViewFrm.GetBindings(), SID_TRANSLITERATE_HALFWIDTH ); if( rSet.GetItemState( SID_TRANSLITERATE_FULLWIDTH ) != SfxItemState::UNKNOWN ) - ScViewUtil::HideDisabledSlot( rSet, pViewFrm->GetBindings(), SID_TRANSLITERATE_FULLWIDTH ); + ScViewUtil::HideDisabledSlot( rSet, rViewFrm.GetBindings(), SID_TRANSLITERATE_FULLWIDTH ); if( rSet.GetItemState( SID_TRANSLITERATE_HIRAGANA ) != SfxItemState::UNKNOWN ) - ScViewUtil::HideDisabledSlot( rSet, pViewFrm->GetBindings(), SID_TRANSLITERATE_HIRAGANA ); + ScViewUtil::HideDisabledSlot( rSet, rViewFrm.GetBindings(), SID_TRANSLITERATE_HIRAGANA ); if( rSet.GetItemState( SID_TRANSLITERATE_KATAKANA ) != SfxItemState::UNKNOWN ) - ScViewUtil::HideDisabledSlot( rSet, pViewFrm->GetBindings(), SID_TRANSLITERATE_KATAKANA ); + ScViewUtil::HideDisabledSlot( rSet, rViewFrm.GetBindings(), SID_TRANSLITERATE_KATAKANA ); if ( rSet.GetItemState( SID_ENABLE_HYPHENATION ) != SfxItemState::UNKNOWN ) { diff --git a/sc/source/ui/drawfunc/drtxtob2.cxx b/sc/source/ui/drawfunc/drtxtob2.cxx index 2f615104b62c..37629721cff4 100644 --- a/sc/source/ui/drawfunc/drtxtob2.cxx +++ b/sc/source/ui/drawfunc/drtxtob2.cxx @@ -135,17 +135,17 @@ void ScDrawTextObjectBar::ExecuteExtra( SfxRequest &rReq ) case SID_FONTWORK: { sal_uInt16 nId = SvxFontWorkChildWindow::GetChildWindowId(); - SfxViewFrame* pViewFrm = mrViewData.GetViewShell()->GetViewFrame(); + SfxViewFrame& rViewFrm = mrViewData.GetViewShell()->GetViewFrame(); if ( rReq.GetArgs() ) - pViewFrm->SetChildWindow( nId, + rViewFrm.SetChildWindow( nId, static_cast<const SfxBoolItem&>( (rReq.GetArgs()->Get(SID_FONTWORK))). GetValue() ); else - pViewFrm->ToggleChildWindow( nId ); + rViewFrm.ToggleChildWindow( nId ); - pViewFrm->GetBindings().Invalidate( SID_FONTWORK ); + rViewFrm.GetBindings().Invalidate( SID_FONTWORK ); rReq.Done(); } break; diff --git a/sc/source/ui/drawfunc/fudraw.cxx b/sc/source/ui/drawfunc/fudraw.cxx index ea5f14a820d4..9076a75ada00 100644 --- a/sc/source/ui/drawfunc/fudraw.cxx +++ b/sc/source/ui/drawfunc/fudraw.cxx @@ -239,7 +239,7 @@ bool FuDraw::KeyInput(const KeyEvent& rKEvt) const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); if( !pView->IsTextEdit() && 1 == rMarkList.GetMarkCount() ) { - bool bOle = rViewShell.GetViewFrame()->GetFrame().IsInPlace(); + bool bOle = rViewShell.GetViewFrame().GetFrame().IsInPlace(); SdrObject* pObj = rMarkList.GetMark( 0 )->GetMarkedSdrObj(); auto pOleObj = dynamic_cast<SdrOle2Obj*>(pObj); if( pOleObj && !bOle ) diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index cf7bd58375fc..72886789b448 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -413,7 +413,7 @@ FuInsertMedia::FuInsertMedia( ScTabViewShell& rViewSh, if( pWin ) pWin->EnterWait(); - css::uno::Reference<css::frame::XDispatchProvider> xDispatchProvider(rViewShell.GetViewFrame()->GetFrame().GetFrameInterface(), css::uno::UNO_QUERY); + css::uno::Reference<css::frame::XDispatchProvider> xDispatchProvider(rViewShell.GetViewFrame().GetFrame().GetFrameInterface(), css::uno::UNO_QUERY); rtl::Reference<avmedia::PlayerListener> xPlayerListener(new avmedia::PlayerListener( [xDispatchProvider, aURL, bLink](const css::uno::Reference<css::media::XPlayer>& rPlayer){ diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index e753e63214a6..f0d60b45ca19 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -235,13 +235,13 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell& rViewSh, vcl::Window* pWin, ScDrawView* if ( nSlot == SID_INSERT_OBJECT && pNameItem ) { const SvGlobalName& aClassName = pNameItem->GetValue(); - xObj = rViewShell.GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aName ); + xObj = rViewShell.GetViewFrame().GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( aClassName.GetByteSequence(), aName ); } else if ( nSlot == SID_INSERT_SMATH ) { if ( SvtModuleOptions().IsMath() ) { - xObj = rViewShell.GetViewFrame()->GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SM_CLASSID_60 ).GetByteSequence(), aName ); + xObj = rViewShell.GetViewFrame().GetObjectShell()->GetEmbeddedObjectContainer().CreateEmbeddedObject( SvGlobalName( SO3_SM_CLASSID_60 ).GetByteSequence(), aName ); rReq.AppendItem( SfxGlobalNameItem( SID_INSERT_OBJECT, SvGlobalName( SO3_SM_CLASSID_60 ) ) ); } } diff --git a/sc/source/ui/drawfunc/fusel.cxx b/sc/source/ui/drawfunc/fusel.cxx index 9695702c55e3..03fb8c4c86f5 100644 --- a/sc/source/ui/drawfunc/fusel.cxx +++ b/sc/source/ui/drawfunc/fusel.cxx @@ -340,7 +340,7 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt) SetMouseButtonCode(rMEvt.GetButtons()); bool bReturn = FuDraw::MouseButtonUp(rMEvt); - bool bOle = rViewShell.GetViewFrame()->GetFrame().IsInPlace(); + bool bOle = rViewShell.GetViewFrame().GetFrame().IsInPlace(); SdrObject* pObj = nullptr; if (aDragTimer.IsActive() ) diff --git a/sc/source/ui/drawfunc/futext.cxx b/sc/source/ui/drawfunc/futext.cxx index 9bd670d3fa9d..7f3089fc076d 100644 --- a/sc/source/ui/drawfunc/futext.cxx +++ b/sc/source/ui/drawfunc/futext.cxx @@ -250,7 +250,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) } pView->SetDragMode(SdrDragMode::Move); - SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings(); + SfxBindings& rBindings = rViewShell.GetViewFrame().GetBindings(); rBindings.Invalidate( SID_OBJECT_ROTATE ); rBindings.Invalidate( SID_OBJECT_MIRROR ); } @@ -314,7 +314,7 @@ bool FuText::MouseButtonDown(const MouseEvent& rMEvt) { pWindow->CaptureMouse(); // ForcePointer(&rMEvt); - lcl_InvalidateAttribs( rViewShell.GetViewFrame()->GetBindings() ); + lcl_InvalidateAttribs( rViewShell.GetViewFrame().GetBindings() ); } rViewShell.SetActivePointer(pView->GetPreferredPointer( @@ -368,7 +368,7 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt) aDragTimer.Stop(); } - lcl_InvalidateAttribs( rViewShell.GetViewFrame()->GetBindings() ); + lcl_InvalidateAttribs( rViewShell.GetViewFrame().GetBindings() ); Point aPnt( pWindow->PixelToLogic( rMEvt.GetPosPixel() ) ); @@ -485,7 +485,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt) if ( pView->KeyInput(rKEvt, pWindow) ) { bReturn = true; - lcl_InvalidateAttribs( rViewShell.GetViewFrame()->GetBindings() ); + lcl_InvalidateAttribs( rViewShell.GetViewFrame().GetBindings() ); } else { @@ -498,7 +498,7 @@ bool FuText::KeyInput(const KeyEvent& rKEvt) void FuText::Activate() { pView->SetDragMode(SdrDragMode::Move); - SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings(); + SfxBindings& rBindings = rViewShell.GetViewFrame().GetBindings(); rBindings.Invalidate( SID_OBJECT_ROTATE ); rBindings.Invalidate( SID_OBJECT_MIRROR ); diff --git a/sc/source/ui/inc/ChildWindowWrapper.hxx b/sc/source/ui/inc/ChildWindowWrapper.hxx index afc4a2df54c7..5fb038df27dd 100644 --- a/sc/source/ui/inc/ChildWindowWrapper.hxx +++ b/sc/source/ui/inc/ChildWindowWrapper.hxx @@ -34,7 +34,7 @@ public: SetController(pViewShell->CreateRefDialogController(pBindings, this, pInfo, pParentP->GetFrameWeld(), WindowID)); if (pViewShell && !GetController()) - pViewShell->GetViewFrame()->SetChildWindow( nId, false ); + pViewShell->GetViewFrame().SetChildWindow( nId, false ); } static std::unique_ptr<SfxChildWindow> CreateImpl( diff --git a/sc/source/ui/miscdlgs/acredlin.cxx b/sc/source/ui/miscdlgs/acredlin.cxx index 87292fe06c1e..3ff295276ab3 100644 --- a/sc/source/ui/miscdlgs/acredlin.cxx +++ b/sc/source/ui/miscdlgs/acredlin.cxx @@ -807,13 +807,13 @@ IMPL_LINK_NOARG(ScAcceptChgDlg, RefHandle, SvxTPFilter*, void) SC_MOD()->SetRefDialog( nId, true ); - SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame(); - ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId )); + SfxViewFrame& rViewFrm = pViewData->GetViewShell()->GetViewFrame(); + ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(rViewFrm.GetChildWindow( nId )); if(pWnd!=nullptr) { sal_uInt16 nAcceptId=ScAcceptChgDlgWrapper::GetChildWindowId(); - pViewFrm->ShowChildWindow(nAcceptId,false); + rViewFrm.ShowChildWindow(nAcceptId,false); pWnd->SetCloseHdl(LINK( this, ScAcceptChgDlg,RefInfoHandle)); pWnd->SetRefString(pTPFilter->GetRange()); ScSimpleRefDlgWrapper::SetAutoReOpen(false); @@ -830,17 +830,17 @@ IMPL_LINK( ScAcceptChgDlg, RefInfoHandle, const OUString*, pResult, void) ScSimpleRefDlgWrapper::SetAutoReOpen(true); - SfxViewFrame* pViewFrm = pViewData->GetViewShell()->GetViewFrame(); + SfxViewFrame& rViewFrm = pViewData->GetViewShell()->GetViewFrame(); if (pResult) { pTPFilter->SetRange(*pResult); FilterHandle(pTPFilter); - pViewFrm->ShowChildWindow(nId); + rViewFrm.ShowChildWindow(nId); } else { - pViewFrm->SetChildWindow(nId, false); + rViewFrm.SetChildWindow(nId, false); } } diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index d3f709b2a94c..35ae45751c81 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -108,7 +108,7 @@ ScDocShell* ScContentTree::GetManualOrCurrent() SfxViewShell* pViewSh = SfxViewShell::Current(); if ( pViewSh ) { - SfxObjectShell* pObjSh = pViewSh->GetViewFrame()->GetObjectShell(); + SfxObjectShell* pObjSh = pViewSh->GetViewFrame().GetObjectShell(); pSh = dynamic_cast<ScDocShell*>( pObjSh ); } } diff --git a/sc/source/ui/unoobj/dispuno.cxx b/sc/source/ui/unoobj/dispuno.cxx index 93ea182a05b3..7f743c5e6777 100644 --- a/sc/source/ui/unoobj/dispuno.cxx +++ b/sc/source/ui/unoobj/dispuno.cxx @@ -40,11 +40,8 @@ static uno::Reference<view::XSelectionSupplier> lcl_GetSelectionSupplier( const { if ( pViewShell ) { - SfxViewFrame* pViewFrame = pViewShell->GetViewFrame(); - if (pViewFrame) - { - return uno::Reference<view::XSelectionSupplier>( pViewFrame->GetFrame().GetController(), uno::UNO_QUERY ); - } + SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); + return uno::Reference<view::XSelectionSupplier>( rViewFrame.GetFrame().GetController(), uno::UNO_QUERY ); } return uno::Reference<view::XSelectionSupplier>(); } @@ -55,7 +52,7 @@ ScDispatchProviderInterceptor::ScDispatchProviderInterceptor(ScTabViewShell* pVi if ( !pViewShell ) return; - m_xIntercepted.set(uno::Reference<frame::XDispatchProviderInterception>(pViewShell->GetViewFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY)); + m_xIntercepted.set(uno::Reference<frame::XDispatchProviderInterception>(pViewShell->GetViewFrame().GetFrame().GetFrameInterface(), uno::UNO_QUERY)); if (m_xIntercepted.is()) { osl_atomic_increment( &m_refCount ); diff --git a/sc/source/ui/unoobj/docuno.cxx b/sc/source/ui/unoobj/docuno.cxx index ba951e95da84..8f236138b345 100644 --- a/sc/source/ui/unoobj/docuno.cxx +++ b/sc/source/ui/unoobj/docuno.cxx @@ -881,16 +881,16 @@ uno::Reference<datatransfer::XTransferable> ScModelObj::getSelection() if (ScViewData* pViewData = ScDocShell::GetViewData()) { - if ( ScEditShell * pShell = dynamic_cast<ScEditShell*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ) ) + if ( ScEditShell * pShell = dynamic_cast<ScEditShell*>( pViewData->GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ) ) xTransferable = pShell->GetEditView()->GetTransferable(); - else if ( nullptr != dynamic_cast<ScDrawTextObjectBar*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) )) + else if ( nullptr != dynamic_cast<ScDrawTextObjectBar*>( pViewData->GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) )) { ScDrawView* pView = pViewData->GetScDrawView(); OutlinerView* pOutView = pView->GetTextEditOutlinerView(); if (pOutView) xTransferable = pOutView->GetEditView().GetTransferable(); } - else if ( ScDrawShell * pDrawShell = dynamic_cast<ScDrawShell*>( pViewData->GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ) ) + else if ( ScDrawShell * pDrawShell = dynamic_cast<ScDrawShell*>( pViewData->GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ) ) xTransferable = pDrawShell->GetDrawView()->CopyToTransferable(); else xTransferable = pViewData->GetViewShell()->CopyToTransferable(); diff --git a/sc/source/ui/unoobj/viewuno.cxx b/sc/source/ui/unoobj/viewuno.cxx index 984ef70566da..ba292fb15814 100644 --- a/sc/source/ui/unoobj/viewuno.cxx +++ b/sc/source/ui/unoobj/viewuno.cxx @@ -1394,10 +1394,10 @@ void ScTabViewObj::SetZoom(sal_Int16 nZoom) pViewSh->PaintGrid(); pViewSh->PaintTop(); pViewSh->PaintLeft(); - pViewSh->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM ); - pViewSh->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); - pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ZOOM_IN); - pViewSh->GetViewFrame()->GetBindings().Invalidate(SID_ZOOM_OUT); + pViewSh->GetViewFrame().GetBindings().Invalidate( SID_ATTR_ZOOM ); + pViewSh->GetViewFrame().GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); + pViewSh->GetViewFrame().GetBindings().Invalidate(SID_ZOOM_IN); + pViewSh->GetViewFrame().GetBindings().Invalidate(SID_ZOOM_OUT); } sal_Int16 ScTabViewObj::GetZoomType() const @@ -1836,7 +1836,7 @@ void SAL_CALL ScTabViewObj::setPropertyValue( pViewSh->PaintExtras(); pViewSh->InvalidateBorder(); - SfxBindings& rBindings = pViewSh->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pViewSh->GetViewFrame().GetBindings(); rBindings.Invalidate( FID_TOGGLEHEADERS ); // -> check in menu rBindings.Invalidate( FID_TOGGLESYNTAX ); } @@ -2074,11 +2074,11 @@ uno::Sequence<OUString> SAL_CALL ScTabViewObj::getSupportedServiceNames() css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL ScTabViewObj::getTransferable() { SolarMutexGuard aGuard; - ScEditShell* pShell = dynamic_cast<ScEditShell*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); + ScEditShell* pShell = dynamic_cast<ScEditShell*>( GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ); if (pShell) return pShell->GetEditView()->GetTransferable(); - ScDrawTextObjectBar* pTextShell = dynamic_cast<ScDrawTextObjectBar*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); + ScDrawTextObjectBar* pTextShell = dynamic_cast<ScDrawTextObjectBar*>( GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ); if (pTextShell) { ScViewData& rViewData = GetViewShell()->GetViewData(); @@ -2088,7 +2088,7 @@ css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL ScTabViewObj::g return pOutView->GetEditView().GetTransferable(); } - ScDrawShell* pDrawShell = dynamic_cast<ScDrawShell*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); + ScDrawShell* pDrawShell = dynamic_cast<ScDrawShell*>( GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ); if (pDrawShell) return pDrawShell->GetDrawView()->CopyToTransferable(); @@ -2098,12 +2098,12 @@ css::uno::Reference< css::datatransfer::XTransferable > SAL_CALL ScTabViewObj::g void SAL_CALL ScTabViewObj::insertTransferable( const css::uno::Reference< css::datatransfer::XTransferable >& xTrans ) { SolarMutexGuard aGuard; - ScEditShell* pShell = dynamic_cast<ScEditShell*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); + ScEditShell* pShell = dynamic_cast<ScEditShell*>( GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ); if (pShell) pShell->GetEditView()->InsertText( xTrans, OUString(), false ); else { - ScDrawTextObjectBar* pTextShell = dynamic_cast<ScDrawTextObjectBar*>( GetViewShell()->GetViewFrame()->GetDispatcher()->GetShell(0) ); + ScDrawTextObjectBar* pTextShell = dynamic_cast<ScDrawTextObjectBar*>( GetViewShell()->GetViewFrame().GetDispatcher()->GetShell(0) ); if (pTextShell) { ScViewData& rViewData = GetViewShell()->GetViewData(); diff --git a/sc/source/ui/vba/excelvbahelper.cxx b/sc/source/ui/vba/excelvbahelper.cxx index 47621647b096..3224171677e9 100644 --- a/sc/source/ui/vba/excelvbahelper.cxx +++ b/sc/source/ui/vba/excelvbahelper.cxx @@ -276,7 +276,7 @@ getViewFrame( const uno::Reference< frame::XModel >& xModel ) { ScTabViewShell* pViewShell = getBestViewShell( xModel ); if ( pViewShell ) - return pViewShell->GetViewFrame(); + return &pViewShell->GetViewFrame(); return nullptr; } diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx index 6885f9b18ca1..9bc913dcc2b2 100644 --- a/sc/source/ui/vba/vbawindow.cxx +++ b/sc/source/ui/vba/vbawindow.cxx @@ -381,8 +381,8 @@ ScVbaWindow::getWindowState() sal_Int32 nwindowState = xlNormal; // !! TODO !! get view shell from controller ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); - SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame(); - WorkWindow* pWork = static_cast<WorkWindow*>( pViewFrame->GetFrame().GetSystemWindow() ); + SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); + WorkWindow* pWork = static_cast<WorkWindow*>( rViewFrame.GetFrame().GetSystemWindow() ); if ( pWork ) { if ( pWork -> IsMaximized()) @@ -400,8 +400,8 @@ ScVbaWindow::setWindowState( const uno::Any& _windowstate ) _windowstate >>= nwindowState; // !! TODO !! get view shell from controller ScTabViewShell* pViewShell = excel::getBestViewShell( m_xModel ); - SfxViewFrame* pViewFrame = pViewShell -> GetViewFrame(); - WorkWindow* pWork = static_cast<WorkWindow*>( pViewFrame->GetFrame().GetSystemWindow() ); + SfxViewFrame& rViewFrame = pViewShell->GetViewFrame(); + WorkWindow* pWork = static_cast<WorkWindow*>( rViewFrame.GetFrame().GetSystemWindow() ); if ( pWork ) { if ( nwindowState == xlMaximized) diff --git a/sc/source/ui/vba/vbaworksheets.cxx b/sc/source/ui/vba/vbaworksheets.cxx index 48795cb9594c..bd552fbb03bc 100644 --- a/sc/source/ui/vba/vbaworksheets.cxx +++ b/sc/source/ui/vba/vbaworksheets.cxx @@ -491,7 +491,7 @@ void ScVbaWorksheets::PrintPreview( const css::uno::Any& /*EnableChanges*/ ) ScTabViewShell* pViewShell = excel::getBestViewShell( mxModel ); SfxViewFrame* pViewFrame = nullptr; if ( pViewShell ) - pViewFrame = pViewShell->GetViewFrame(); + pViewFrame = &pViewShell->GetViewFrame(); if ( !pViewFrame ) return; diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index 7694061e6093..3b2e69e7364f 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -1284,7 +1284,7 @@ void ScCellShell::GetState(SfxItemSet &rSet) if (rDoc.IsTabProtected(rData.GetTabNo())) { bool bVisible = false; - SfxViewFrame* pViewFrame = ( pTabViewShell ? pTabViewShell->GetViewFrame() : nullptr ); + SfxViewFrame* pViewFrame = ( pTabViewShell ? &pTabViewShell->GetViewFrame() : nullptr ); if ( pViewFrame && pViewFrame->HasChildWindow( nWhich ) ) { SfxChildWindow* pChild = pViewFrame->GetChildWindow( nWhich ); diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 88c1470bc8db..eb8cb4a18382 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -229,7 +229,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { ScModule* pScMod = SC_MOD(); ScTabViewShell* pTabViewShell = GetViewData().GetViewShell(); - SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pTabViewShell->GetViewFrame().GetBindings(); const SfxItemSet* pReqArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -345,7 +345,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if (nResult == RET_OK) { - SfxRequest aRequest(pTabViewShell->GetViewFrame(), FID_INS_CELL); + SfxRequest aRequest(&pTabViewShell->GetViewFrame(), FID_INS_CELL); InsertCells(pTabViewShell, aRequest, pDlg->GetInsCellCmd()); } pDlg->disposeOnce(); @@ -399,7 +399,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if (nResult == RET_OK) { - SfxRequest aRequest(pTabViewShell->GetViewFrame(), FID_INS_CELL); + SfxRequest aRequest(&pTabViewShell->GetViewFrame(), FID_INS_CELL); DeleteCells(pTabViewShell, aRequest, pDlg->GetDelCellCmd()); } pDlg->disposeOnce(); @@ -930,8 +930,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_RANDOM_NUMBER_GENERATOR_DIALOG: { sal_uInt16 nId = ScRandomNumberGeneratorDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -940,8 +940,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_SAMPLING_DIALOG: { sal_uInt16 nId = ScSamplingDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -949,8 +949,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_DESCRIPTIVE_STATISTICS_DIALOG: { sal_uInt16 nId = ScDescriptiveStatisticsDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -958,8 +958,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_ANALYSIS_OF_VARIANCE_DIALOG: { sal_uInt16 nId = ScAnalysisOfVarianceDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -967,8 +967,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_CORRELATION_DIALOG: { sal_uInt16 nId = ScCorrelationDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -976,8 +976,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_COVARIANCE_DIALOG: { sal_uInt16 nId = ScCovarianceDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -985,8 +985,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_EXPONENTIAL_SMOOTHING_DIALOG: { sal_uInt16 nId = ScExponentialSmoothingDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -994,8 +994,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_MOVING_AVERAGE_DIALOG: { sal_uInt16 nId = ScMovingAverageDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -1003,8 +1003,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_REGRESSION_DIALOG: { sal_uInt16 nId = ScRegressionDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -1012,8 +1012,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_TTEST_DIALOG: { sal_uInt16 nId = ScTTestDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -1022,8 +1022,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_FTEST_DIALOG: { sal_uInt16 nId = ScFTestDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -1032,8 +1032,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_ZTEST_DIALOG: { sal_uInt16 nId = ScZTestDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -1042,8 +1042,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_CHI_SQUARE_TEST_DIALOG: { sal_uInt16 nId = ScChiSquareTestDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -1052,8 +1052,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_FOURIER_ANALYSIS_DIALOG: { sal_uInt16 nId = ScFourierAnalysisDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -1065,10 +1065,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if (pReqArgs && pReqArgs->HasItem(SID_SEARCH_RESULTS_DIALOG, &pItem)) { bool bVisible = static_cast<const SfxBoolItem*>(pItem)->GetValue(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); // The window ID should equal the slot ID, but not a biggie if it wasn't. sal_uInt16 nId = sc::SearchResultsDlgWrapper::GetChildWindowId(); - pViewFrm->SetChildWindow(nId, bVisible, false); + rViewFrm.SetChildWindow(nId, bVisible, false); } rReq.Done(); } @@ -1078,8 +1078,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_EDIT_SPARKLINE_GROUP: { sal_uInt16 nId = sc::SparklineDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWindow = pViewFrame->GetChildWindow(nId); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWindow = rViewFrame.GetChildWindow(nId); pScMod->SetRefDialog(nId, pWindow == nullptr); rReq.Done(); } @@ -1088,8 +1088,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_EDIT_SPARKLINE: { sal_uInt16 nId = sc::SparklineDataRangeDialogWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWindow = pViewFrame->GetChildWindow(nId); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWindow = rViewFrame.GetChildWindow(nId); pScMod->SetRefDialog(nId, pWindow == nullptr); rReq.Done(); } @@ -1759,8 +1759,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pDlg->Insert( nFormatId, aName ); } - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); - auto xFrame = pViewFrame->GetFrame().GetFrameInterface(); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); + auto xFrame = rViewFrame.GetFrame().GetFrameInterface(); const OUString aModuleName(vcl::CommandInfoProvider::GetModuleIdentifier(xFrame)); auto aProperties = vcl::CommandInfoProvider::GetCommandProperties(".uno:PasteTextImportDialog", aModuleName); OUString sLabel(vcl::CommandInfoProvider::GetTooltipLabelForCommand(aProperties)); @@ -1898,15 +1898,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case SID_SPELL_DIALOG: { - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); if( rReq.GetArgs() ) - pViewFrame->SetChildWindow( SID_SPELL_DIALOG, + rViewFrame.SetChildWindow( SID_SPELL_DIALOG, static_cast< const SfxBoolItem& >( rReq.GetArgs()-> Get( SID_SPELL_DIALOG ) ).GetValue() ); else - pViewFrame->ToggleChildWindow( SID_SPELL_DIALOG ); + rViewFrame.ToggleChildWindow( SID_SPELL_DIALOG ); - pViewFrame->GetBindings().Invalidate( SID_SPELL_DIALOG ); + rViewFrame.GetBindings().Invalidate( SID_SPELL_DIALOG ); rReq.Ignore(); } break; @@ -2091,8 +2091,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) else { sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -2100,8 +2100,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case FID_ADD_NAME: { sal_uInt16 nId = ScNameDefDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -2131,8 +2131,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) if ( bManaged ) { sal_uInt16 nId = ScCondFormatDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); break; @@ -2286,8 +2286,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) pTabViewShell->GetPool().Put(aDlgItem); sal_uInt16 nId = ScCondFormatDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -2298,8 +2298,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) { sal_uInt16 nId = ScColRowNameRangesDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -2664,8 +2664,8 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) SfxAllItemSet aSet( GetPool() ); aSet.Put( SfxBoolItem( FN_PARAM_1, false ) ); aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhich(SID_ATTR_CHAR_FONT) ) ); - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); - auto xFrame = pViewFrame->GetFrame().GetFrameInterface(); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); + auto xFrame = rViewFrame.GetFrame().GetFrameInterface(); ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(pTabViewShell->GetFrameWeld(), aSet, xFrame)); pDlg->Execute(); } @@ -3112,8 +3112,8 @@ void RunPivotLayoutDialog(ScModule* pScMod, // start layout dialog sal_uInt16 nId = ScPivotLayoutWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } } @@ -3354,8 +3354,8 @@ void ScCellShell::ExecuteXMLSourceDialog() ScModule* pScMod = SC_MOD(); sal_uInt16 nId = ScXMLSourceDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrame->GetChildWindow(nId); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrame.GetChildWindow(nId); pScMod->SetRefDialog(nId, pWnd == nullptr); } diff --git a/sc/source/ui/view/cellsh2.cxx b/sc/source/ui/view/cellsh2.cxx index eb6ee98de193..c34f8ce14267 100644 --- a/sc/source/ui/view/cellsh2.cxx +++ b/sc/source/ui/view/cellsh2.cxx @@ -245,10 +245,10 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) { // check if database beamer is open - SfxViewFrame* pViewFrame = pTabViewShell->GetViewFrame(); + SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame(); bool bWasOpen = false; { - uno::Reference<frame::XFrame> xFrame = pViewFrame->GetFrame().GetFrameInterface(); + uno::Reference<frame::XFrame> xFrame = rViewFrame.GetFrame().GetFrameInterface(); uno::Reference<frame::XFrame> xBeamerFrame = xFrame->findFrame( "_beamer", frame::FrameSearchFlag::CHILDREN); @@ -260,13 +260,13 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) { // close database beamer: just forward to SfxViewFrame - pViewFrame->ExecuteSlot( rReq ); + rViewFrame.ExecuteSlot( rReq ); } else { // show database beamer: SfxViewFrame call must be synchronous - pViewFrame->ExecuteSlot( rReq, false ); // false = synchronous + rViewFrame.ExecuteSlot( rReq, false ); // false = synchronous // select current database in database beamer @@ -275,7 +275,7 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) if (pDBData) pDBData->GetImportParam( aImportParam ); - ScDBDocFunc::ShowInBeamer( aImportParam, pTabViewShell->GetViewFrame() ); + ScDBDocFunc::ShowInBeamer( aImportParam, &pTabViewShell->GetViewFrame() ); } rReq.Done(); // needed because it's a toggle slot } @@ -528,54 +528,51 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) pTabViewShell->UISort( rOutParam ); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - if (pViewFrm) - { - SfxRequest aRequest(pViewFrm, SID_SORT); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxRequest aRequest(&rViewFrm, SID_SORT); - if ( rOutParam.bInplace ) + if ( rOutParam.bInplace ) + { + aRequest.AppendItem( SfxBoolItem( SID_SORT_BYROW, + rOutParam.bByRow ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_HASHEADER, + rOutParam.bHasHeader ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_CASESENS, + rOutParam.bCaseSens ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT, + rOutParam.bNaturalSort ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_INCCOMMENTS, + rOutParam.aDataAreaExtras.mbCellNotes ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_INCIMAGES, + rOutParam.aDataAreaExtras.mbCellDrawObjects ) ); + aRequest.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, + rOutParam.aDataAreaExtras.mbCellFormats ) ); + sal_uInt16 nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; + aRequest.AppendItem( SfxUInt16Item( SID_SORT_USERDEF, nUser ) ); + if ( rOutParam.maKeyState[0].bDoSort ) { - aRequest.AppendItem( SfxBoolItem( SID_SORT_BYROW, - rOutParam.bByRow ) ); - aRequest.AppendItem( SfxBoolItem( SID_SORT_HASHEADER, - rOutParam.bHasHeader ) ); - aRequest.AppendItem( SfxBoolItem( SID_SORT_CASESENS, - rOutParam.bCaseSens ) ); - aRequest.AppendItem( SfxBoolItem( SID_SORT_NATURALSORT, - rOutParam.bNaturalSort ) ); - aRequest.AppendItem( SfxBoolItem( SID_SORT_INCCOMMENTS, - rOutParam.aDataAreaExtras.mbCellNotes ) ); - aRequest.AppendItem( SfxBoolItem( SID_SORT_INCIMAGES, - rOutParam.aDataAreaExtras.mbCellDrawObjects ) ); - aRequest.AppendItem( SfxBoolItem( SID_SORT_ATTRIBS, - rOutParam.aDataAreaExtras.mbCellFormats ) ); - sal_uInt16 nUser = rOutParam.bUserDef ? ( rOutParam.nUserIndex + 1 ) : 0; - aRequest.AppendItem( SfxUInt16Item( SID_SORT_USERDEF, nUser ) ); - if ( rOutParam.maKeyState[0].bDoSort ) - { - aRequest.AppendItem( SfxInt32Item( FN_PARAM_1, - rOutParam.maKeyState[0].nField + 1 ) ); - aRequest.AppendItem( SfxBoolItem( FN_PARAM_2, - rOutParam.maKeyState[0].bAscending ) ); - } - if ( rOutParam.maKeyState[1].bDoSort ) - { - aRequest.AppendItem( SfxInt32Item( FN_PARAM_3, - rOutParam.maKeyState[1].nField + 1 ) ); - aRequest.AppendItem( SfxBoolItem( FN_PARAM_4, - rOutParam.maKeyState[1].bAscending ) ); - } - if ( rOutParam.maKeyState[2].bDoSort ) - { - aRequest.AppendItem( SfxInt32Item( FN_PARAM_5, - rOutParam.maKeyState[2].nField + 1 ) ); - aRequest.AppendItem( SfxBoolItem( FN_PARAM_6, - rOutParam.maKeyState[2].bAscending ) ); - } + aRequest.AppendItem( SfxInt32Item( FN_PARAM_1, + rOutParam.maKeyState[0].nField + 1 ) ); + aRequest.AppendItem( SfxBoolItem( FN_PARAM_2, + rOutParam.maKeyState[0].bAscending ) ); + } + if ( rOutParam.maKeyState[1].bDoSort ) + { + aRequest.AppendItem( SfxInt32Item( FN_PARAM_3, + rOutParam.maKeyState[1].nField + 1 ) ); + aRequest.AppendItem( SfxBoolItem( FN_PARAM_4, + rOutParam.maKeyState[1].bAscending ) ); + } + if ( rOutParam.maKeyState[2].bDoSort ) + { + aRequest.AppendItem( SfxInt32Item( FN_PARAM_5, + rOutParam.maKeyState[2].nField + 1 ) ); + aRequest.AppendItem( SfxBoolItem( FN_PARAM_6, + rOutParam.maKeyState[2].bAscending ) ); } - - aRequest.Done(); } + + aRequest.Done(); } else { @@ -602,8 +599,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) else { sal_uInt16 nId = ScFilterDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -623,8 +620,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) else { sal_uInt16 nId = ScSpecialFilterDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -726,8 +723,8 @@ void ScCellShell::ExecuteDB( SfxRequest& rReq ) { sal_uInt16 nId = ScDbNameDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); @@ -1135,7 +1132,7 @@ void ScCellShell::GetDBState( SfxItemSet& rSet ) rSet.Put(SfxVisibilityItem(nWhich, false)); else // get state (BoolItem) from SfxViewFrame - pTabViewShell->GetViewFrame()->GetSlotState( nWhich, nullptr, &rSet ); + pTabViewShell->GetViewFrame().GetSlotState( nWhich, nullptr, &rSet ); } break; case SID_SBA_BRW_INSERT: diff --git a/sc/source/ui/view/cellsh3.cxx b/sc/source/ui/view/cellsh3.cxx index 9ab0e09ac00e..9e3fcc37bf88 100644 --- a/sc/source/ui/view/cellsh3.cxx +++ b/sc/source/ui/view/cellsh3.cxx @@ -153,7 +153,7 @@ void lcl_lokGetWholeFunctionList() void ScCellShell::Execute( SfxRequest& rReq ) { ScTabViewShell* pTabViewShell = GetViewData().GetViewShell(); - SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pTabViewShell->GetViewFrame().GetBindings(); ScModule* pScMod = SC_MOD(); const SfxItemSet* pReqArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -170,7 +170,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_OPENDLG_FUNCTION: // inplace leads to trouble with EditShell ... //! cannot always be switched ???? - if (!pTabViewShell->GetViewFrame()->GetFrame().IsInPlace()) + if (!pTabViewShell->GetViewFrame().GetFrame().IsInPlace()) pTabViewShell->SetDontSwitch(true); // do not switch off EditShell [[fallthrough]]; @@ -429,8 +429,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) else { sal_uInt16 nId = SID_OPENDLG_FUNCTION; - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); bool bVis = comphelper::LibreOfficeKit::isActive() || pWnd == nullptr; pScMod->SetRefDialog( nId, bVis ); } @@ -441,8 +441,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_OPENDLG_CONSOLIDATE: { sal_uInt16 nId = ScConsolidateDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -496,8 +496,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_OPENDLG_SOLVE: { sal_uInt16 nId = ScSolverDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -506,8 +506,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_OPENDLG_OPTSOLVER: { sal_uInt16 nId = ScOptSolverDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -516,8 +516,8 @@ void ScCellShell::Execute( SfxRequest& rReq ) case SID_OPENDLG_TABOP: { sal_uInt16 nId = ScTabOpDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = pTabViewShell->GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -695,7 +695,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if (nResult == RET_OK) { - SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_ROW_HEIGHT); + SfxRequest pRequest(&pTabViewShell->GetViewFrame(), FID_ROW_HEIGHT); tools::Long nVal = pDlg->GetInputValue(); pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) ); @@ -735,7 +735,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if ( nResult == RET_OK ) { - SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_ROW_OPT_HEIGHT); + SfxRequest pRequest(&pTabViewShell->GetViewFrame(), FID_ROW_OPT_HEIGHT); tools::Long nVal = pDlg->GetInputValue(); pTabViewShell->SetMarkedWidthOrHeight( false, SC_SIZE_OPTIMAL, static_cast<sal_uInt16>(nVal) ); ScGlobal::nLastRowHeightExtra = nVal; @@ -800,7 +800,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ if ( nResult == RET_OK ) { - SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_COL_WIDTH); + SfxRequest pRequest(&pTabViewShell->GetViewFrame(), FID_COL_WIDTH); tools::Long nVal = pDlg->GetInputValue(); pTabViewShell->SetMarkedWidthOrHeight( true, SC_SIZE_DIRECT, static_cast<sal_uInt16>(nVal) ); @@ -838,7 +838,7 @@ void ScCellShell::Execute( SfxRequest& rReq ) ScGlobal::nLastColWidthExtra, STD_EXTRA_WIDTH, eMetric, 2, MAX_EXTRA_WIDTH)); pDlg->StartExecuteAsync([pDlg, pTabViewShell](sal_Int32 nResult){ - SfxRequest pRequest(pTabViewShell->GetViewFrame(), FID_COL_OPT_WIDTH); + SfxRequest pRequest(&pTabViewShell->GetViewFrame(), FID_COL_OPT_WIDTH); if ( nResult == RET_OK ) { tools::Long nVal = pDlg->GetInputValue(); diff --git a/sc/source/ui/view/drawvie3.cxx b/sc/source/ui/view/drawvie3.cxx index ce4d132b87e4..6561423ab2a5 100644 --- a/sc/source/ui/view/drawvie3.cxx +++ b/sc/source/ui/view/drawvie3.cxx @@ -229,7 +229,7 @@ void ScDrawView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) void ScDrawView::UpdateIMap( SdrObject* pObj ) { if ( !(pViewData && - pViewData->GetViewShell()->GetViewFrame()->HasChildWindow( ScIMapChildWindowId() ) && + pViewData->GetViewShell()->GetViewFrame().HasChildWindow( ScIMapChildWindowId() ) && pObj && ( dynamic_cast<const SdrGrafObj*>( pObj) != nullptr || dynamic_cast<const SdrOle2Obj*>( pObj) != nullptr )) ) return; diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index d52f0900f46d..c2190c1623e9 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -486,8 +486,8 @@ void ScDrawView::MarkListHasChanged() // adjust verbs - SfxViewFrame* pViewFrame = pViewSh->GetViewFrame(); - bool bOle = pViewSh->GetViewFrame()->GetFrame().IsInPlace(); + SfxViewFrame& rViewFrame = pViewSh->GetViewFrame(); + bool bOle = pViewSh->GetViewFrame().GetFrame().IsInPlace(); uno::Sequence< embed::VerbDescriptor > aVerbs; if ( pOle2Obj && !bOle ) { @@ -522,16 +522,13 @@ void ScDrawView::MarkListHasChanged() // uno object for view returns drawing objects as selection, // so it must notify its SelectionChangeListeners - if (pViewFrame) + SfxFrame& rFrame = rViewFrame.GetFrame(); + uno::Reference<frame::XController> xController = rFrame.GetController(); + if (xController.is()) { - SfxFrame& rFrame = pViewFrame->GetFrame(); - uno::Reference<frame::XController> xController = rFrame.GetController(); - if (xController.is()) - { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp) - pImp->SelectionChanged(); - } + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp) + pImp->SelectionChanged(); } // update selection transfer object @@ -572,16 +569,13 @@ bool ScDrawView::SdrBeginTextEdit( } } - if ( pViewSh->GetViewFrame() ) + SfxFrame& rFrame = pViewSh->GetViewFrame().GetFrame(); + uno::Reference< frame::XController > xController = rFrame.GetController(); + if (xController.is()) { - SfxFrame& rFrame = pViewSh->GetViewFrame()->GetFrame(); - uno::Reference< frame::XController > xController = rFrame.GetController(); - if (xController.is()) - { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp) - pImp->SelectionChanged(); - } + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp) + pImp->SelectionChanged(); } return bRet; @@ -596,16 +590,13 @@ SdrEndTextEditKind ScDrawView::SdrEndTextEdit( bool bDontDeleteReally ) if (comphelper::LibreOfficeKit::isActive()) SfxLokHelper::notifyOtherViews(pViewSh, LOK_CALLBACK_VIEW_LOCK, "rectangle", "EMPTY"); - if ( pViewSh->GetViewFrame() ) + SfxFrame& rFrame = pViewSh->GetViewFrame().GetFrame(); + uno::Reference< frame::XController > xController = rFrame.GetController(); + if (xController.is()) { - SfxFrame& rFrame = pViewSh->GetViewFrame()->GetFrame(); - uno::Reference< frame::XController > xController = rFrame.GetController(); - if (xController.is()) - { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp) - pImp->SelectionChanged(); - } + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp) + pImp->SelectionChanged(); } return eRet; diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx index 52566f45d7b8..9583f7fb0ac9 100644 --- a/sc/source/ui/view/editsh.cxx +++ b/sc/source/ui/view/editsh.cxx @@ -628,7 +628,7 @@ void ScEditShell::Execute( SfxRequest& rReq ) { // Ensure the field is selected first pEditView->SelectFieldAtCursor(); - rViewData.GetViewShell()->GetViewFrame()->GetDispatcher()->Execute( + rViewData.GetViewShell()->GetViewFrame().GetDispatcher()->Execute( SID_HYPERLINK_DIALOG); } break; @@ -1302,14 +1302,14 @@ void ScEditShell::GetUndoState(SfxItemSet &rSet) { // Undo state is taken from normal ViewFrame state function - SfxViewFrame* pViewFrm = rViewData.GetViewShell()->GetViewFrame(); - if ( pViewFrm && GetUndoManager() ) + SfxViewFrame& rViewFrm = rViewData.GetViewShell()->GetViewFrame(); + if ( GetUndoManager() ) { SfxWhichIter aIter(rSet); sal_uInt16 nWhich = aIter.FirstWhich(); while( nWhich ) { - pViewFrm->GetSlotState( nWhich, nullptr, &rSet ); + rViewFrm.GetSlotState( nWhich, nullptr, &rSet ); nWhich = aIter.NextWhich(); } } diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx index cc3c7312942f..6bcd7119ecb7 100644 --- a/sc/source/ui/view/formatsh.cxx +++ b/sc/source/ui/view/formatsh.cxx @@ -215,7 +215,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) case SID_STYLE_UPDATE_BY_EXAMPLE: { std::unique_ptr<SfxUInt16Item> pFamilyItem; - pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); + pTabViewShell->GetViewFrame().GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); bool bPage = pFamilyItem && SfxStyleFamily::Page == static_cast<SfxStyleFamily>(pFamilyItem->GetValue()); @@ -230,7 +230,7 @@ void ScFormatShell::GetStyleState( SfxItemSet& rSet ) case SID_STYLE_SHOW: { std::unique_ptr<SfxUInt16Item> pFamilyItem; - pTabViewShell->GetViewFrame()->GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); + pTabViewShell->GetViewFrame().GetBindings().QueryState(SID_STYLE_FAMILY, pFamilyItem); bool bPage = pFamilyItem && SfxStyleFamily::Page == static_cast<SfxStyleFamily>(pFamilyItem->GetValue()); if ( bProtected && !bPage ) @@ -977,7 +977,7 @@ void ScFormatShell::ExecuteNumFormat( SfxRequest& rReq ) ScTabViewShell* pTabViewShell = GetViewData().GetViewShell(); const SfxItemSet* pReqArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); - SfxBindings& rBindings = pTabViewShell->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pTabViewShell->GetViewFrame().GetBindings(); pTabViewShell->HideListBox(); // Autofilter-DropDown-Listbox diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index 41db66bc82bd..3f5172ad6a50 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -2164,7 +2164,7 @@ void ScGridWindow::MouseButtonUp( const MouseEvent& rMEvt ) if (DrawMouseButtonUp(rMEvt)) // includes format paint brush handling for drawing objects { ScTabViewShell* pViewShell = mrViewData.GetViewShell(); - SfxBindings& rFrmBindings=pViewShell->GetViewFrame()->GetBindings(); + SfxBindings& rFrmBindings=pViewShell->GetViewFrame().GetBindings(); rFrmBindings.Invalidate(SID_ATTR_TRANSFORM_WIDTH); rFrmBindings.Invalidate(SID_ATTR_TRANSFORM_HEIGHT); rFrmBindings.Invalidate(SID_ATTR_TRANSFORM_POS_X); @@ -2803,24 +2803,21 @@ bool ScGridWindow::PreNotify( NotifyEvent& rNEvt ) vcl::Window* pWindow = rNEvt.GetWindow(); if (pWindow == this) { - SfxViewFrame* pViewFrame = mrViewData.GetViewShell()->GetViewFrame(); - if (pViewFrame) + SfxViewFrame& rViewFrame = mrViewData.GetViewShell()->GetViewFrame(); + css::uno::Reference<css::frame::XController> xController = rViewFrame.GetFrame().GetController(); + if (xController.is()) { - css::uno::Reference<css::frame::XController> xController = pViewFrame->GetFrame().GetController(); - if (xController.is()) + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp && pImp->IsMouseListening()) { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp && pImp->IsMouseListening()) - { - css::awt::MouseEvent aEvent; - lcl_InitMouseEvent( aEvent, *rNEvt.GetMouseEvent() ); - if ( rNEvt.GetWindow() ) - aEvent.Source = rNEvt.GetWindow()->GetComponentInterface(); - if ( nType == NotifyEventType::MOUSEBUTTONDOWN) - bDone = pImp->MousePressed( aEvent ); - else - bDone = pImp->MouseReleased( aEvent ); - } + css::awt::MouseEvent aEvent; + lcl_InitMouseEvent( aEvent, *rNEvt.GetMouseEvent() ); + if ( rNEvt.GetWindow() ) + aEvent.Source = rNEvt.GetWindow()->GetComponentInterface(); + if ( nType == NotifyEventType::MOUSEBUTTONDOWN) + bDone = pImp->MousePressed( aEvent ); + else + bDone = pImp->MouseReleased( aEvent ); } } } @@ -3556,7 +3553,7 @@ void ScGridWindow::KeyInput(const KeyEvent& rKEvt) || rLclKeyCode.GetCode() == KEY_RIGHT) { ScTabViewShell* pViewShell = mrViewData.GetViewShell(); - SfxBindings& rBindings = pViewShell->GetViewFrame()->GetBindings(); + SfxBindings& rBindings = pViewShell->GetViewFrame().GetBindings(); rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_X); rBindings.Invalidate(SID_ATTR_TRANSFORM_POS_Y); } diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index a122544f1110..82e073230910 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -664,7 +664,7 @@ void ScPreview::KeyInput( const KeyEvent& rKEvt ) if(nSlot) { bHandled = true; - pViewShell->GetViewFrame()->GetDispatcher()->Execute( nSlot, SfxCallMode::ASYNCHRON ); + pViewShell->GetViewFrame().GetDispatcher()->Execute( nSlot, SfxCallMode::ASYNCHRON ); } } diff --git a/sc/source/ui/view/prevwsh.cxx b/sc/source/ui/view/prevwsh.cxx index a35122cbfad5..d38c16b2d4ad 100644 --- a/sc/source/ui/view/prevwsh.cxx +++ b/sc/source/ui/view/prevwsh.cxx @@ -252,7 +252,7 @@ void ScPreviewShell::UpdateNeededScrollBars( bool bFromZoom ) Size aPageSize; OutputDevice* pDevice = Application::GetDefaultDevice(); - tools::Long nBarW = GetViewFrame()->GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize(); + tools::Long nBarW = GetViewFrame().GetWindow().GetSettings().GetStyleSettings().GetScrollBarSize(); tools::Long nBarH = nBarW; tools::Long aHeightOffSet = pDevice ? pDevice->PixelToLogic( Size( nBarW, nBarH ), pPreview->GetMapMode() ).Height() : 0; @@ -727,7 +727,7 @@ void ScPreviewShell::Execute( SfxRequest& rReq ) aPrintFunc.UpdatePages(); rReq.Done(); } - GetViewFrame()->GetBindings().Invalidate( nSlot ); + GetViewFrame().GetBindings().Invalidate( nSlot ); } break; case SID_PRINTPREVIEW: @@ -926,7 +926,7 @@ void ScPreviewShell::WriteUserDataSequence(uno::Sequence < beans::PropertyValue rSeq.realloc(3); beans::PropertyValue* pSeq = rSeq.getArray(); - sal_uInt16 nViewID(GetViewFrame()->GetCurViewId()); + sal_uInt16 nViewID(GetViewFrame().GetCurViewId()); pSeq[0].Name = SC_VIEWID; pSeq[0].Value <<= SC_VIEW + OUString::number(nViewID); pSeq[1].Name = SC_ZOOMVALUE; @@ -988,8 +988,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) if( nPage>0 ) { - SfxViewFrame* pSfxViewFrame = GetViewFrame(); - SfxRequest aSfxRequest( pSfxViewFrame, SID_PREVIEW_PREVIOUS ); + SfxViewFrame& rSfxViewFrame = GetViewFrame(); + SfxRequest aSfxRequest( &rSfxViewFrame, SID_PREVIEW_PREVIOUS ); Execute( aSfxRequest ); } } @@ -1011,8 +1011,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) if( nPage<nTotal-1 ) { - SfxViewFrame* pSfxViewFrame = GetViewFrame(); - SfxRequest aSfxRequest( pSfxViewFrame, SID_PREVIEW_NEXT ); + SfxViewFrame& rSfxViewFrame = GetViewFrame(); + SfxRequest aSfxRequest( &rSfxViewFrame, SID_PREVIEW_NEXT ); Execute( aSfxRequest ); } } @@ -1032,8 +1032,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) if( nPage>0 ) { - SfxViewFrame* pSfxViewFrame = GetViewFrame(); - SfxRequest aSfxRequest( pSfxViewFrame, SID_PREVIEW_PREVIOUS ); + SfxViewFrame& rSfxViewFrame = GetViewFrame(); + SfxRequest aSfxRequest( &rSfxViewFrame, SID_PREVIEW_PREVIOUS ); Execute( aSfxRequest ); aCurPos.setY( nVRange ); } @@ -1055,8 +1055,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) } if( nPage<nTotal-1 ) { - SfxViewFrame* pSfxViewFrame = GetViewFrame(); - SfxRequest aSfxRequest( pSfxViewFrame, SID_PREVIEW_NEXT ); + SfxViewFrame& rSfxViewFrame = GetViewFrame(); + SfxRequest aSfxRequest( &rSfxViewFrame, SID_PREVIEW_NEXT ); Execute( aSfxRequest ); aCurPos.setY( 0 ); } @@ -1071,8 +1071,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) tools::Long nTotal = pPreview->GetTotalPages(); if( nTotal && nPage != 0 ) { - SfxViewFrame* pSfxViewFrame = GetViewFrame(); - SfxRequest aSfxRequest( pSfxViewFrame, SID_PREVIEW_FIRST ); + SfxViewFrame& rSfxViewFrame = GetViewFrame(); + SfxRequest aSfxRequest( &rSfxViewFrame, SID_PREVIEW_FIRST ); Execute( aSfxRequest ); } } @@ -1091,8 +1091,8 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) tools::Long nTotal = pPreview->GetTotalPages(); if( nTotal && nPage+1 != nTotal ) { - SfxViewFrame* pSfxViewFrame = GetViewFrame(); - SfxRequest aSfxRequest( pSfxViewFrame, SID_PREVIEW_LAST ); + SfxViewFrame& rSfxViewFrame = GetViewFrame(); + SfxRequest aSfxRequest( &rSfxViewFrame, SID_PREVIEW_LAST ); Execute( aSfxRequest ); } } @@ -1136,7 +1136,7 @@ void ScPreviewShell::DoScroll( sal_uInt16 nMode ) void ScPreviewShell::ExitPreview() { - GetViewFrame()->GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::ASYNCHRON); + GetViewFrame().GetDispatcher()->Execute(SID_VIEWSHELL0, SfxCallMode::ASYNCHRON); } void ScPreviewShell::AddAccessibilityObject( SfxListener& rObject ) diff --git a/sc/source/ui/view/reffact.cxx b/sc/source/ui/view/reffact.cxx index 0133a9074a5f..487f8c8e1812 100644 --- a/sc/source/ui/view/reffact.cxx +++ b/sc/source/ui/view/reffact.cxx @@ -83,7 +83,7 @@ namespace SetController( pViewShell ? \ pViewShell->CreateRefDialogController( p, this, pInfo, pParentP->GetFrameWeld(), sid ) : nullptr ); \ if (pViewShell && !GetController()) \ - pViewShell->GetViewFrame()->SetChildWindow( nId, false ); \ + pViewShell->GetViewFrame().SetChildWindow( nId, false ); \ } @@ -231,7 +231,7 @@ ScAcceptChgDlgWrapper::ScAcceptChgDlgWrapper(vcl::Window* pParentP, else SetController( nullptr ); if (pViewShell && !GetController()) - pViewShell->GetViewFrame()->SetChildWindow( nId, false ); + pViewShell->GetViewFrame().SetChildWindow( nId, false ); } void ScAcceptChgDlgWrapper::ReInitDlg() @@ -284,7 +284,7 @@ ScValidityRefChildWin::ScValidityRefChildWin(vcl::Window* pParentP, pViewShell = dynamic_cast<ScTabViewShell*>( SfxViewShell::Current() ); OSL_ENSURE( pViewShell, "missing view shell :-(" ); if (pViewShell && !xDlg) - pViewShell->GetViewFrame()->SetChildWindow( nId, false ); + pViewShell->GetViewFrame().SetChildWindow( nId, false ); } ScValidityRefChildWin::~ScValidityRefChildWin() diff --git a/sc/source/ui/view/spelleng.cxx b/sc/source/ui/view/spelleng.cxx index 752d565b2b1e..f325d7dd556c 100644 --- a/sc/source/ui/view/spelleng.cxx +++ b/sc/source/ui/view/spelleng.cxx @@ -355,10 +355,10 @@ void ScSpellingEngine::ShowFinishDialog() weld::Widget* ScSpellingEngine::GetDialogParent() { sal_uInt16 nWinId = ScSpellDialogChildWindow::GetChildWindowId(); - SfxViewFrame* pViewFrm = mrViewData.GetViewShell()->GetViewFrame(); - if( pViewFrm->HasChildWindow( nWinId ) ) + SfxViewFrame& rViewFrm = mrViewData.GetViewShell()->GetViewFrame(); + if( rViewFrm.HasChildWindow( nWinId ) ) { - if( SfxChildWindow* pChild = pViewFrm->GetChildWindow( nWinId ) ) + if( SfxChildWindow* pChild = rViewFrm.GetChildWindow( nWinId ) ) { auto xController = pChild->GetController(); if (xController) diff --git a/sc/source/ui/view/tabcont.cxx b/sc/source/ui/view/tabcont.cxx index 35e715c8283b..efecef8cd22f 100644 --- a/sc/source/ui/view/tabcont.cxx +++ b/sc/source/ui/view/tabcont.cxx @@ -205,7 +205,7 @@ void ScTabControl::MouseButtonUp( const MouseEvent& rMEvt ) if ( rMEvt.GetClicks() == 2 && rMEvt.IsLeft() && nMouseClickPageId != 0 && nMouseClickPageId != TabBar::PAGE_NOT_FOUND ) { - SfxDispatcher* pDispatcher = pViewData->GetViewShell()->GetViewFrame()->GetDispatcher(); + SfxDispatcher* pDispatcher = pViewData->GetViewShell()->GetViewFrame().GetDispatcher(); pDispatcher->Execute( FID_TAB_MENU_RENAME, SfxCallMode::SYNCHRON | SfxCallMode::RECORD ); return; } @@ -213,7 +213,7 @@ void ScTabControl::MouseButtonUp( const MouseEvent& rMEvt ) if( nMouseClickPageId == 0 ) { // Click in the area next to the existing tabs: - SfxDispatcher* pDispatcher = pViewData->GetViewShell()->GetViewFrame()->GetDispatcher(); + SfxDispatcher* pDispatcher = pViewData->GetViewShell()->GetViewFrame().GetDispatcher(); pDispatcher->Execute( FID_TAB_DESELECTALL, SfxCallMode::SYNCHRON | SfxCallMode::RECORD ); // forget page ID, to be really sure that the dialog is not called twice nMouseClickPageId = TabBar::PAGE_NOT_FOUND; @@ -317,7 +317,7 @@ void ScTabControl::Select() // for others this is only needed fidgeting if ( bRefMode && pViewData->GetRefType() == SC_REFTYPE_REF ) - if ( pViewData->GetViewShell()->GetViewFrame()->HasChildWindow(SID_OPENDLG_CONSOLIDATE) ) + if ( pViewData->GetViewShell()->GetViewFrame().HasChildWindow(SID_OPENDLG_CONSOLIDATE) ) { ScRange aRange( pViewData->GetRefStartX(), pViewData->GetRefStartY(), pViewData->GetRefStartZ(), diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 048178301f1d..66ddcda2d223 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -739,8 +739,8 @@ void ScTabView::UpdateVarZoom() PaintGrid(); PaintTop(); PaintLeft(); - aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOM ); - aViewData.GetViewShell()->GetViewFrame()->GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); + aViewData.GetViewShell()->GetViewFrame().GetBindings().Invalidate( SID_ATTR_ZOOM ); + aViewData.GetViewShell()->GetViewFrame().GetBindings().Invalidate( SID_ATTR_ZOOMSLIDER ); aViewData.GetBindings().Invalidate(SID_ZOOM_IN); aViewData.GetBindings().Invalidate(SID_ZOOM_OUT); } @@ -961,7 +961,7 @@ bool ScTabView::ScrollCommand( const CommandEvent& rCEvt, ScSplitPos ePos ) const CommandWheelData* pData = rCEvt.GetWheelData(); if (pData && pData->GetMode() == CommandWheelMode::ZOOM) { - if ( !aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace() ) + if ( !aViewData.GetViewShell()->GetViewFrame().GetFrame().IsInPlace() ) { // for ole inplace editing, the scale is defined by the visarea and client size // and can't be changed directly @@ -1001,7 +1001,7 @@ bool ScTabView::GestureZoomCommand(const CommandEvent& rCEvt) if (!pData) return false; - if (aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace()) + if (aViewData.GetViewShell()->GetViewFrame().GetFrame().IsInPlace()) return false; if (pData->meEventType == GestureEventZoomType::Begin) @@ -1409,7 +1409,7 @@ void ScTabView::UpdateHeaderWidth( const ScVSplitPos* pWhich, const SCROW* pPosY ScDocument& rDoc = aViewData.GetDocument(); SCROW nEndPos = rDoc.MaxRow(); - if ( !aViewData.GetViewShell()->GetViewFrame()->GetFrame().IsInPlace() ) + if ( !aViewData.GetViewShell()->GetViewFrame().GetFrame().IsInPlace() ) { // for OLE Inplace always MAXROW @@ -2240,17 +2240,14 @@ void ScTabView::SetNewVisArea() pGridWin[i]->SetMapMode(aOldMode[i]); } - SfxViewFrame* pViewFrame = aViewData.GetViewShell()->GetViewFrame(); - if (pViewFrame) + SfxViewFrame& rViewFrame = aViewData.GetViewShell()->GetViewFrame(); + SfxFrame& rFrame = rViewFrame.GetFrame(); + css::uno::Reference<css::frame::XController> xController = rFrame.GetController(); + if (xController.is()) { - SfxFrame& rFrame = pViewFrame->GetFrame(); - css::uno::Reference<css::frame::XController> xController = rFrame.GetController(); - if (xController.is()) - { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp) - pImp->VisAreaChanged(); - } + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp) + pImp->VisAreaChanged(); } if (aViewData.GetViewShell()->HasAccessibilityObjects()) aViewData.GetViewShell()->BroadcastAccessibility(SfxHint(SfxHintId::ScAccVisAreaChanged)); diff --git a/sc/source/ui/view/tabview3.cxx b/sc/source/ui/view/tabview3.cxx index 0da3ae55b283..d52968c4fdef 100644 --- a/sc/source/ui/view/tabview3.cxx +++ b/sc/source/ui/view/tabview3.cxx @@ -449,17 +449,17 @@ void ScTabView::SetCursor( SCCOL nPosX, SCROW nPosY, bool bNew ) SfxLokHelper::notifyDocumentSizeChanged(aViewData.GetViewShell(), sSize, pModel, false); } -static bool lcl_IsRefDlgActive(SfxViewFrame* pViewFrm) +static bool lcl_IsRefDlgActive(SfxViewFrame& rViewFrm) { ScModule* pScMod = SC_MOD(); if (!pScMod->IsRefDialogOpen()) return false; auto nDlgId = pScMod->GetCurRefDlgId(); - if (!pViewFrm->HasChildWindow(nDlgId)) + if (!rViewFrm.HasChildWindow(nDlgId)) return false; - SfxChildWindow* pChild = pViewFrm->GetChildWindow(nDlgId); + SfxChildWindow* pChild = rViewFrm.GetChildWindow(nDlgId); if (!pChild) return false; @@ -531,16 +531,13 @@ void ScTabView::SetTabProtectionSymbol( SCTAB nTab, const bool bProtect ) void ScTabView::SelectionChanged(bool bFromPaste) { - SfxViewFrame* pViewFrame = aViewData.GetViewShell()->GetViewFrame(); - if (pViewFrame) + SfxViewFrame& rViewFrame = aViewData.GetViewShell()->GetViewFrame(); + uno::Reference<frame::XController> xController = rViewFrame.GetFrame().GetController(); + if (xController.is()) { - uno::Reference<frame::XController> xController = pViewFrame->GetFrame().GetController(); - if (xController.is()) - { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp) - pImp->SelectionChanged(); - } + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp) + pImp->SelectionChanged(); } UpdateAutoFillMark(bFromPaste); // also calls CheckSelectionTransfer @@ -884,14 +881,14 @@ void ScTabView::RemoveHintWindow() } // find window that should not be over the cursor -static weld::Window* lcl_GetCareWin(SfxViewFrame* pViewFrm) +static weld::Window* lcl_GetCareWin(SfxViewFrame& rViewFrm) { //! also spelling ??? (then set the member variables when calling) // search & replace - if (pViewFrm->HasChildWindow(SID_SEARCH_DLG)) + if (rViewFrm.HasChildWindow(SID_SEARCH_DLG)) { - SfxChildWindow* pChild = pViewFrm->GetChildWindow(SID_SEARCH_DLG); + SfxChildWindow* pChild = rViewFrm.GetChildWindow(SID_SEARCH_DLG); if (pChild) { auto xDlgController = pChild->GetController(); @@ -901,9 +898,9 @@ static weld::Window* lcl_GetCareWin(SfxViewFrame* pViewFrm) } // apply changes - if ( pViewFrm->HasChildWindow(FID_CHG_ACCEPT) ) + if ( rViewFrm.HasChildWindow(FID_CHG_ACCEPT) ) { - SfxChildWindow* pChild = pViewFrm->GetChildWindow(FID_CHG_ACCEPT); + SfxChildWindow* pChild = rViewFrm.GetChildWindow(FID_CHG_ACCEPT); if (pChild) { auto xDlgController = pChild->GetController(); @@ -2044,8 +2041,8 @@ void ScTabView::SetTabNo( SCTAB nTab, bool bNew, bool bExtendSelection, bool bSa if (pScMod->IsRefDialogOpen()) { sal_uInt16 nCurRefDlgId=pScMod->GetCurRefDlgId(); - SfxViewFrame* pViewFrm = aViewData.GetViewShell()->GetViewFrame(); - SfxChildWindow* pChildWnd = pViewFrm->GetChildWindow( nCurRefDlgId ); + SfxViewFrame& rViewFrm = aViewData.GetViewShell()->GetViewFrame(); + SfxChildWindow* pChildWnd = rViewFrm.GetChildWindow( nCurRefDlgId ); if (pChildWnd) { if (pChildWnd->GetController()) @@ -2281,7 +2278,7 @@ void ScTabView::KillEditView( bool bNoPaint ) if (bGrabFocus) { // should be done like this, so that Sfx notice it, but it does not work: -//! aViewData.GetViewShell()->GetViewFrame()->GetWindow().GrabFocus(); +//! aViewData.GetViewShell()->GetViewFrame().GetWindow().GrabFocus(); // therefore first like this: GetActiveWin()->GrabFocus(); } diff --git a/sc/source/ui/view/tabview5.cxx b/sc/source/ui/view/tabview5.cxx index bb10ad93e5f7..77280b583cc7 100644 --- a/sc/source/ui/view/tabview5.cxx +++ b/sc/source/ui/view/tabview5.cxx @@ -306,16 +306,13 @@ void ScTabView::TabChanged( bool bSameTabButMoved ) } // notification for XActivationBroadcaster - SfxViewFrame* pViewFrame = aViewData.GetViewShell()->GetViewFrame(); - if (pViewFrame) + SfxViewFrame& rViewFrame = aViewData.GetViewShell()->GetViewFrame(); + uno::Reference<frame::XController> xController = rViewFrame.GetFrame().GetController(); + if (xController.is()) { - uno::Reference<frame::XController> xController = pViewFrame->GetFrame().GetController(); - if (xController.is()) - { - ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); - if (pImp) - pImp->SheetChanged( bSameTabButMoved ); - } + ScTabViewObj* pImp = dynamic_cast<ScTabViewObj*>( xController.get() ); + if (pImp) + pImp->SheetChanged( bSameTabButMoved ); } for (int i = 0; i < 4; i++) diff --git a/sc/source/ui/view/tabvwsh2.cxx b/sc/source/ui/view/tabvwsh2.cxx index 031a32d59c4d..b2fef44d9656 100644 --- a/sc/source/ui/view/tabvwsh2.cxx +++ b/sc/source/ui/view/tabvwsh2.cxx @@ -76,7 +76,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) MakeDrawLayer(); ScTabView* pTabView = GetViewData().GetView(); - SfxBindings& rBindings = GetViewFrame()->GetBindings(); + SfxBindings& rBindings = GetViewFrame().GetBindings(); vcl::Window* pWin = pTabView->GetActiveWin(); ScDrawView* pView = pTabView->GetScDrawView(); @@ -141,7 +141,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) if ( nNewId == SID_FM_CREATE_CONTROL ) { GetViewData().GetDispatcher().Execute(SID_FM_LEAVE_CREATE); - GetViewFrame()->GetBindings().InvalidateAll(false); + GetViewFrame().GetBindings().InvalidateAll(false); //! what kind of slot does the weird controller really need to display this???? } @@ -155,7 +155,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) { // switching from control- to paint function -> deselect in control-controller GetViewData().GetDispatcher().Execute(SID_FM_LEAVE_CREATE); - GetViewFrame()->GetBindings().InvalidateAll(false); + GetViewFrame().GetBindings().InvalidateAll(false); //! what kind of slot does the weird controller really need to display this???? } @@ -289,7 +289,7 @@ void ScTabViewShell::ExecDraw(SfxRequest& rReq) const SfxStringItem* pEnumCommand = rReq.GetArg<SfxStringItem>(nNewId); if ( pEnumCommand ) { - SfxBindings& rBind = GetViewFrame()->GetBindings(); + SfxBindings& rBind = GetViewFrame().GetBindings(); rBind.Invalidate( nNewId ); rBind.Update( nNewId ); @@ -397,7 +397,7 @@ void ScTabViewShell::GetDrawState(SfxItemSet &rSet) { case SID_DRAW_CHART: { - bool bOle = GetViewFrame()->GetFrame().IsInPlace(); + bool bOle = GetViewFrame().GetFrame().IsInPlace(); if ( bOle || !SvtModuleOptions().IsChart() ) rSet.DisableItem( nWhich ); } diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx index ec19d4c1d4a6..5c41a4e49b75 100644 --- a/sc/source/ui/view/tabvwsh3.cxx +++ b/sc/source/ui/view/tabvwsh3.cxx @@ -166,8 +166,8 @@ namespace void ScTabViewShell::Execute( SfxRequest& rReq ) { - SfxViewFrame* pThisFrame = GetViewFrame(); - SfxBindings& rBindings = pThisFrame->GetBindings(); + SfxViewFrame& rThisFrame = GetViewFrame(); + SfxBindings& rBindings = rThisFrame.GetBindings(); ScModule* pScMod = SC_MOD(); const SfxItemSet* pReqArgs = rReq.GetArgs(); sal_uInt16 nSlot = rReq.GetSlot(); @@ -209,7 +209,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case SID_OPENDLG_EDIT_PRINTAREA: { sal_uInt16 nId = ScPrintAreasDlgWrapper::GetChildWindowId(); - SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); + SfxChildWindow* pWnd = rThisFrame.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -603,7 +603,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case SID_PRINTPREVIEW: { - if ( !pThisFrame->GetFrame().IsInPlace() ) // not for OLE + if ( !rThisFrame.GetFrame().IsInPlace() ) // not for OLE { // print preview is now always in the same frame as the tab view // -> always switch this frame back to normal view @@ -612,7 +612,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) // #102785#; finish input pScMod->InputEnterHandler(); - pThisFrame->GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::ASYNCHRON ); + rThisFrame.GetDispatcher()->Execute( SID_VIEWSHELL1, SfxCallMode::ASYNCHRON ); } // else error (e.g. Ole) } @@ -669,10 +669,10 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case FID_FUNCTION_BOX: { // First make sure that the sidebar is visible - pThisFrame->ShowChildWindow(SID_SIDEBAR); + rThisFrame.ShowChildWindow(SID_SIDEBAR); ::sfx2::sidebar::Sidebar::ShowPanel(u"ScFunctionsPanel", - pThisFrame->GetFrame().GetFrameInterface()); + rThisFrame.GetFrame().GetFrameInterface()); rReq.Done (); } break; @@ -728,13 +728,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case FID_TOGGLEINPUTLINE: { sal_uInt16 nId = ScInputWindowWrapper::GetChildWindowId(); - SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); + SfxChildWindow* pWnd = rThisFrame.GetChildWindow( nId ); bool bSet = ( pWnd == nullptr ); const SfxPoolItem* pItem; if ( pReqArgs && pReqArgs->GetItemState(nSlot, true, &pItem) == SfxItemState::SET ) bSet = static_cast<const SfxBoolItem*>(pItem)->GetValue(); - pThisFrame->SetChildWindow( nId, bSet ); + rThisFrame.SetChildWindow( nId, bSet ); rBindings.Invalidate( FID_TOGGLEINPUTLINE ); rReq.AppendItem( SfxBoolItem( nSlot, bSet ) ); rReq.Done(); @@ -748,7 +748,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) { HideNoteMarker(); - if (!GetViewData().GetViewShell()->GetViewFrame()->GetFrame().IsInPlace()) + if (!GetViewData().GetViewShell()->GetViewFrame().GetFrame().IsInPlace()) { // for ole inplace editing, the scale is defined by the visarea and client size // and can't be changed directly @@ -1132,7 +1132,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case FID_CHG_SHOW: { sal_uInt16 nId = ScHighlightChgDlgWrapper::GetChildWindowId(); - SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); + SfxChildWindow* pWnd = rThisFrame.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd == nullptr ); } @@ -1140,13 +1140,13 @@ void ScTabViewShell::Execute( SfxRequest& rReq ) case FID_CHG_ACCEPT: { - pThisFrame->ToggleChildWindow(ScAcceptChgDlgWrapper::GetChildWindowId()); - GetViewFrame()->GetBindings().Invalidate(FID_CHG_ACCEPT); + rThisFrame.ToggleChildWindow(ScAcceptChgDlgWrapper::GetChildWindowId()); + GetViewFrame().GetBindings().Invalidate(FID_CHG_ACCEPT); rReq.Done (); /* sal_uInt16 nId = ScAcceptChgDlgWrapper::GetChildWindowId(); - SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); + SfxChildWindow* pWnd = rThisFrame.GetChildWindow( nId ); pScMod->SetRefDialog( nId, pWnd ? sal_False : sal_True ); */ diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 43084c917971..d82c7e15c11c 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -121,13 +121,13 @@ void ScTabViewShell::Activate(bool bMDI) // RegisterNewTargetNames does not exist anymore - SfxViewFrame* pThisFrame = GetViewFrame(); - if ( mpInputHandler && pThisFrame->HasChildWindow(FID_INPUTLINE_STATUS) ) + SfxViewFrame& rThisFrame = GetViewFrame(); + if ( mpInputHandler && rThisFrame.HasChildWindow(FID_INPUTLINE_STATUS) ) { // actually only required for Reload (last version): // The InputWindow remains, but the View along with the InputHandler is newly created, // that is why the InputHandler must be set at the InputWindow. - SfxChildWindow* pChild = pThisFrame->GetChildWindow(FID_INPUTLINE_STATUS); + SfxChildWindow* pChild = rThisFrame.GetChildWindow(FID_INPUTLINE_STATUS); if (pChild) { ScInputWindow* pWin = static_cast<ScInputWindow*>(pChild->GetWindow()); @@ -190,9 +190,9 @@ void ScTabViewShell::Activate(bool bMDI) // update change dialog - if ( pThisFrame->HasChildWindow(FID_CHG_ACCEPT) ) + if ( rThisFrame.HasChildWindow(FID_CHG_ACCEPT) ) { - SfxChildWindow* pChild = pThisFrame->GetChildWindow(FID_CHG_ACCEPT); + SfxChildWindow* pChild = rThisFrame.GetChildWindow(FID_CHG_ACCEPT); if (pChild) { static_cast<ScAcceptChgDlgWrapper*>(pChild)->ReInitDlg(); @@ -202,7 +202,7 @@ void ScTabViewShell::Activate(bool bMDI) if(pScMod->IsRefDialogOpen()) { sal_uInt16 nModRefDlgId=pScMod->GetCurRefDlgId(); - SfxChildWindow* pChildWnd = pThisFrame->GetChildWindow( nModRefDlgId ); + SfxChildWindow* pChildWnd = rThisFrame.GetChildWindow( nModRefDlgId ); if ( pChildWnd ) { if (auto pController = pChildWnd->GetController()) @@ -253,7 +253,7 @@ void ScTabViewShell::Deactivate(bool bMDI) ActivateView( false, false ); - if ( GetViewFrame()->GetFrame().IsInPlace() ) // inplace + if ( GetViewFrame().GetFrame().IsInPlace() ) // inplace GetViewData().GetDocShell()->UpdateOle(GetViewData(), true); if ( pHdl ) @@ -341,7 +341,7 @@ void ScTabViewShell::UpdateOleZoom() void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize, bool inplaceEditModeChange ) { Size aNewSize( rSize ); - if ( GetViewFrame()->GetFrame().IsInPlace() ) + if ( GetViewFrame().GetFrame().IsInPlace() ) { SvBorder aBorder; GetBorderSize( aBorder, rSize ); @@ -457,7 +457,7 @@ void ScTabViewShell::QueryObjAreaPixel( tools::Rectangle& rRect ) const void ScTabViewShell::Move() { - Point aNewPos = GetViewFrame()->GetWindow().OutputToScreenPixel(Point()); + Point aNewPos = GetViewFrame().GetWindow().OutputToScreenPixel(Point()); if (aNewPos != aWinPos) { @@ -1130,13 +1130,11 @@ IMPL_LINK_NOARG(ScTabViewShell, SimpleRefClose, const OUString*, void) static ScTabViewObj* lcl_GetViewObj( const ScTabViewShell& rShell ) { ScTabViewObj* pRet = nullptr; - if (SfxViewFrame* pViewFrame = rShell.GetViewFrame()) - { - SfxFrame& rFrame = pViewFrame->GetFrame(); - uno::Reference<frame::XController> xController = rFrame.GetController(); - if (xController.is()) - pRet = dynamic_cast<ScTabViewObj*>( xController.get() ); - } + SfxViewFrame& rViewFrame = rShell.GetViewFrame(); + SfxFrame& rFrame = rViewFrame.GetFrame(); + uno::Reference<frame::XController> xController = rFrame.GetController(); + if (xController.is()) + pRet = dynamic_cast<ScTabViewObj*>( xController.get() ); return pRet; } @@ -1165,7 +1163,7 @@ void ScTabViewShell::StartSimpleRefDialog( const OUString& rTitle, const OUString& rInitVal, bool bCloseOnButtonUp, bool bSingleCell, bool bMultiSelection ) { - SfxViewFrame* pViewFrm = GetViewFrame(); + SfxViewFrame& rViewFrm = GetViewFrame(); if ( GetActiveViewShell() != this ) { @@ -1173,14 +1171,14 @@ void ScTabViewShell::StartSimpleRefDialog( // Then the view has to be activated first, the same way as in Execute for SID_CURRENTDOC. // Can't use GrabFocus here, because it needs to take effect immediately. - pViewFrm->GetFrame().Appear(); + rViewFrm.GetFrame().Appear(); } sal_uInt16 nId = ScSimpleRefDlgWrapper::GetChildWindowId(); - SC_MOD()->SetRefDialog( nId, true, pViewFrm ); + SC_MOD()->SetRefDialog( nId, true, &rViewFrm ); - ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId )); + ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(rViewFrm.GetChildWindow( nId )); if (!pWnd) return; @@ -1198,10 +1196,10 @@ void ScTabViewShell::StartSimpleRefDialog( void ScTabViewShell::StopSimpleRefDialog() { - SfxViewFrame* pViewFrm = GetViewFrame(); + SfxViewFrame& rViewFrm = GetViewFrame(); sal_uInt16 nId = ScSimpleRefDlgWrapper::GetChildWindowId(); - ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(pViewFrm->GetChildWindow( nId )); + ScSimpleRefDlgWrapper* pWnd = static_cast<ScSimpleRefDlgWrapper*>(rViewFrm.GetChildWindow( nId )); if (pWnd) { if (auto pWin = pWnd->GetController()) @@ -1213,8 +1211,8 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt) { ScModule* pScMod = SC_MOD(); - SfxViewFrame* pThisFrame = GetViewFrame(); - if ( pThisFrame->GetChildWindow( SID_OPENDLG_FUNCTION ) ) + SfxViewFrame& rThisFrame = GetViewFrame(); + if ( rThisFrame.GetChildWindow( SID_OPENDLG_FUNCTION ) ) return false; vcl::KeyCode aCode = rKEvt.GetKeyCode(); @@ -1314,7 +1312,7 @@ bool ScTabViewShell::TabKeyInput(const KeyEvent& rKEvt) // container app and are executed during Window::KeyInput. // -> don't pass keys to input handler that would be used there // but should call slots instead. - bool bParent = ( GetViewFrame()->GetFrame().IsInPlace() && eFunc != KeyFuncType::DONTKNOW ); + bool bParent = ( GetViewFrame().GetFrame().IsInPlace() && eFunc != KeyFuncType::DONTKNOW ); if( !bUsed && !bDraw && nCode != KEY_RETURN && !bParent ) bUsed = pScMod->InputKeyEvent( rKEvt, true ); // input @@ -1511,12 +1509,12 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) pCurFrameLine.reset( new ::editeng::SvxBorderLine(&aColBlack, 20, SvxBorderLineStyle::SOLID) ); StartListening(*GetViewData().GetDocShell(), DuplicateHandling::Prevent); - StartListening(*GetViewFrame(), DuplicateHandling::Prevent); + StartListening(GetViewFrame(), DuplicateHandling::Prevent); StartListening(*pSfxApp, DuplicateHandling::Prevent); // #i62045# #i62046# application is needed for Calc's own hints SfxViewFrame* pFirst = SfxViewFrame::GetFirst(pDocSh); bool bFirstView = !pFirst - || (pFirst == GetViewFrame() && !SfxViewFrame::GetNext(*pFirst,pDocSh)); + || (pFirst == &GetViewFrame() && !SfxViewFrame::GetNext(*pFirst,pDocSh)); if ( pDocSh->GetCreateMode() == SfxObjectCreateMode::EMBEDDED ) { @@ -1534,7 +1532,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) // show the right cells GetViewData().SetScreenPos( bNegativePage ? aVisArea.TopRight() : aVisArea.TopLeft() ); - if ( GetViewFrame()->GetFrame().IsInPlace() ) // inplace + if ( GetViewFrame().GetFrame().IsInPlace() ) // inplace { pDocSh->SetInplace( true ); // already initiated like this if (rDoc.IsEmbedded()) @@ -1560,7 +1558,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) mpInputHandler.reset(new ScInputHandler); // old version: - // if ( !GetViewFrame()->ISA(SfxTopViewFrame) ) // OLE or Plug-In + // if ( !GetViewFrame().ISA(SfxTopViewFrame) ) // OLE or Plug-In // pInputHandler = new ScInputHandler; // create FormShell before MakeDrawView, so that DrawView can be registered at the @@ -1632,7 +1630,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) if (bLink) { if ( !pFirst ) - pFirst = GetViewFrame(); + pFirst = &GetViewFrame(); if(SC_MOD()->GetCurRefDlgId()==0) { @@ -1661,7 +1659,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) if (bReImport) { if ( !pFirst ) - pFirst = GetViewFrame(); + pFirst = &GetViewFrame(); if(SC_MOD()->GetCurRefDlgId()==0) { pFirst->GetDispatcher()->Execute( SID_REIMPORT_AFTER_LOAD, @@ -1681,7 +1679,7 @@ void ScTabViewShell::Construct( TriState nForceDesignMode ) // #105575#; update only in the first creation of the ViewShell pDocSh->SetUpdateEnabled(false); - if ( GetViewFrame()->GetFrame().IsInPlace() ) + if ( GetViewFrame().GetFrame().IsInPlace() ) UpdateHeaderWidth(); // The inplace activation requires headers to be calculated SvBorder aBorder; @@ -1825,7 +1823,7 @@ ScTabViewShell::~ScTabViewShell() ScDocShell* pDocSh = GetViewData().GetDocShell(); EndListening(*pDocSh); - EndListening(*GetViewFrame()); + EndListening(GetViewFrame()); EndListening(*SfxGetpApp()); // #i62045# #i62046# needed now - SfxViewShell no longer does it SC_MOD()->ViewShellGone(this); diff --git a/sc/source/ui/view/tabvwsh5.cxx b/sc/source/ui/view/tabvwsh5.cxx index b701cc327e5e..fab96304f39f 100644 --- a/sc/source/ui/view/tabvwsh5.cxx +++ b/sc/source/ui/view/tabvwsh5.cxx @@ -296,7 +296,7 @@ void ScTabViewShell::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) case SfxHintId::LanguageChanged: { - GetViewFrame()->GetBindings().Invalidate(SID_LANGUAGE_STATUS); + GetViewFrame().GetBindings().Invalidate(SID_LANGUAGE_STATUS); if ( ScGridWindow* pWin = GetViewData().GetActiveWin() ) pWin->ResetAutoSpell(); } diff --git a/sc/source/ui/view/tabvwsh9.cxx b/sc/source/ui/view/tabvwsh9.cxx index 03aa0615c052..9127bb598a1b 100644 --- a/sc/source/ui/view/tabvwsh9.cxx +++ b/sc/source/ui/view/tabvwsh9.cxx @@ -48,11 +48,11 @@ void ScTabViewShell::ExecChildWin(const SfxRequest& rReq) case SID_GALLERY: { // First make sure that the sidebar is visible - GetViewFrame()->ShowChildWindow(SID_SIDEBAR); + GetViewFrame().ShowChildWindow(SID_SIDEBAR); ::sfx2::sidebar::Sidebar::ShowPanel( u"GalleryPanel", - GetViewFrame()->GetFrame().GetFrameInterface()); + GetViewFrame().GetFrame().GetFrameInterface()); } break; } @@ -81,7 +81,7 @@ void ScTabViewShell::ExecGallery( const SfxRequest& rReq ) // for sounds (linked or not), insert a hyperlink button, // like in Impress and Writer const SfxStringItem aMediaURLItem( SID_INSERT_AVMEDIA, pGalleryItem->GetURL() ); - GetViewFrame()->GetDispatcher()->ExecuteList(SID_INSERT_AVMEDIA, + GetViewFrame().GetDispatcher()->ExecuteList(SID_INSERT_AVMEDIA, SfxCallMode::SYNCHRON, { &aMediaURLItem }); } } @@ -93,12 +93,12 @@ void ScTabViewShell::ExecImageMap( SfxRequest& rReq ) { case SID_IMAP: { - SfxViewFrame* pThisFrame = GetViewFrame(); + SfxViewFrame& rThisFrame = GetViewFrame(); sal_uInt16 nId = ScIMapChildWindowId(); - pThisFrame->ToggleChildWindow( nId ); - GetViewFrame()->GetBindings().Invalidate( SID_IMAP ); + rThisFrame.ToggleChildWindow( nId ); + GetViewFrame().GetBindings().Invalidate( SID_IMAP ); - if ( pThisFrame->HasChildWindow( nId ) ) + if ( rThisFrame.HasChildWindow( nId ) ) { SvxIMapDlg* pDlg = GetIMapDlg(); if ( pDlg ) @@ -158,10 +158,10 @@ void ScTabViewShell::GetImageMapState( SfxItemSet& rSet ) // We don't disable this anymore bool bThere = false; - SfxViewFrame* pThisFrame = GetViewFrame(); + SfxViewFrame& rThisFrame = GetViewFrame(); sal_uInt16 nId = ScIMapChildWindowId(); - if ( pThisFrame->KnowsChildWindow(nId) ) - if ( pThisFrame->HasChildWindow(nId) ) + if ( rThisFrame.KnowsChildWindow(nId) ) + if ( rThisFrame.HasChildWindow(nId) ) bThere = true; ObjectSelectionType eType=GetCurObjectSelectionType(); diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx index 9e86e5319de9..d30733cf1ea9 100644 --- a/sc/source/ui/view/tabvwsha.cxx +++ b/sc/source/ui/view/tabvwsha.cxx @@ -177,8 +177,8 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) SCROW nPosY = rViewData.GetCurY(); SCTAB nTab = rViewData.GetTabNo(); - SfxViewFrame* pThisFrame = GetViewFrame(); - bool bOle = GetViewFrame()->GetFrame().IsInPlace(); + SfxViewFrame& rThisFrame = GetViewFrame(); + bool bOle = GetViewFrame().GetFrame().IsInPlace(); SCTAB nTabSelCount = rMark.GetSelectCount(); @@ -267,9 +267,9 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) { sal_uInt16 nId = ScInputWindowWrapper::GetChildWindowId(); - if ( pThisFrame->KnowsChildWindow( nId ) ) + if ( rThisFrame.KnowsChildWindow( nId ) ) { - SfxChildWindow* pWnd = pThisFrame->GetChildWindow( nId ); + SfxChildWindow* pWnd = rThisFrame.GetChildWindow( nId ); rSet.Put( SfxBoolItem( nWhich, pWnd != nullptr ) ); } else @@ -353,7 +353,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case FID_FUNCTION_BOX: { const bool bBoxOpen = ::sfx2::sidebar::Sidebar::IsPanelVisible(u"ScFunctionsPanel", - pThisFrame->GetFrame().GetFrameInterface()); + rThisFrame.GetFrame().GetFrameInterface()); rSet.Put(SfxBoolItem(nWhich, bBoxOpen)); break; } @@ -472,7 +472,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) case FID_CHG_ACCEPT: { if( - ( !rDoc.GetChangeTrack() && !pThisFrame->HasChildWindow(FID_CHG_ACCEPT) ) + ( !rDoc.GetChangeTrack() && !rThisFrame.HasChildWindow(FID_CHG_ACCEPT) ) || ( pDocShell && pDocShell->IsDocShared() ) ) @@ -482,7 +482,7 @@ void ScTabViewShell::GetState( SfxItemSet& rSet ) else { rSet.Put(SfxBoolItem(FID_CHG_ACCEPT, - pThisFrame->HasChildWindow(FID_CHG_ACCEPT))); + rThisFrame.HasChildWindow(FID_CHG_ACCEPT))); } } break; @@ -754,7 +754,7 @@ void ScTabViewShell::UpdateInputHandler( bool bForce /* = sal_False */, bool bSt pHdl->NotifyChange( &aState, bForce, pSourceSh, bStopEditing ); } - SfxBindings& rBindings = GetViewFrame()->GetBindings(); + SfxBindings& rBindings = GetViewFrame().GetBindings(); rBindings.Invalidate( SID_STATUS_SUM ); // always together with the input row rBindings.Invalidate( SID_ATTR_SIZE ); rBindings.Invalidate( SID_TABLE_CELL ); @@ -838,7 +838,7 @@ void ScTabViewShell::ExecDrawOpt( const SfxRequest& rReq ) ScViewOptions aViewOptions = GetViewData().GetOptions(); ScGridOptions aGridOptions = aViewOptions.GetGridOptions(); - SfxBindings& rBindings = GetViewFrame()->GetBindings(); + SfxBindings& rBindings = GetViewFrame().GetBindings(); const SfxItemSet* pArgs = rReq.GetArgs(); const SfxPoolItem* pItem; sal_uInt16 nSlotId = rReq.GetSlot(); diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index adfdba7228e1..11fba3153460 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -364,7 +364,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) MakeDrawLayer(); - SfxBindings& rBindings = GetViewFrame()->GetBindings(); + SfxBindings& rBindings = GetViewFrame().GetBindings(); ScTabView* pTabView = GetViewData().GetView(); vcl::Window* pWin = pTabView->GetActiveWin(); ScDrawView* pView = pTabView->GetScDrawView(); @@ -548,7 +548,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) break; case SID_FONTWORK_GALLERY_FLOATER: - svx::FontworkBar::execute(*pView, rReq, GetViewFrame()->GetBindings()); + svx::FontworkBar::execute(*pView, rReq, GetViewFrame().GetBindings()); rReq.Ignore(); break; } @@ -556,7 +556,7 @@ void ScTabViewShell::ExecDrawIns(SfxRequest& rReq) void ScTabViewShell::GetDrawInsState(SfxItemSet &rSet) { - bool bOle = GetViewFrame()->GetFrame().IsInPlace(); + bool bOle = GetViewFrame().GetFrame().IsInPlace(); bool bTabProt = GetViewData().GetDocument().IsTabProtected(GetViewData().GetTabNo()); ScDocShell* pDocShell = GetViewData().GetDocShell(); bool bShared = pDocShell && pDocShell->IsDocShared(); @@ -801,11 +801,11 @@ void ScTabViewShell::ExecuteUndo(SfxRequest& rReq) if ( bLockPaint ) pDocSh->UnlockPaint(); - GetViewFrame()->GetBindings().InvalidateAll(false); + GetViewFrame().GetBindings().InvalidateAll(false); } break; // default: -// GetViewFrame()->ExecuteSlot( rReq ); +// GetViewFrame().ExecuteSlot( rReq ); } } @@ -863,7 +863,7 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet) } else // get state from sfx view frame - GetViewFrame()->GetSlotState( nWhich, nullptr, &rSet ); + GetViewFrame().GetSlotState( nWhich, nullptr, &rSet ); break; } case SID_REDO: @@ -888,12 +888,12 @@ void ScTabViewShell::GetUndoState(SfxItemSet &rSet) } else // get state from sfx view frame - GetViewFrame()->GetSlotState( nWhich, nullptr, &rSet ); + GetViewFrame().GetSlotState( nWhich, nullptr, &rSet ); break; } default: // get state from sfx view frame - GetViewFrame()->GetSlotState( nWhich, nullptr, &rSet ); + GetViewFrame().GetSlotState( nWhich, nullptr, &rSet ); } nWhich = aIter.NextWhich(); diff --git a/sc/source/ui/view/tabvwshc.cxx b/sc/source/ui/view/tabvwshc.cxx index 0a636c0b2f33..020cc048005c 100644 --- a/sc/source/ui/view/tabvwshc.cxx +++ b/sc/source/ui/view/tabvwshc.cxx @@ -92,8 +92,8 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialogController* pDialo static_cast<ScNameDefDlg*>(pDialog)->GetNewData(maName, maScope); static_cast<ScNameDefDlg*>(pDialog)->Close(); sal_uInt16 nId = ScNameDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); } @@ -103,8 +103,8 @@ void ScTabViewShell::SwitchBetweenRefDialogs(SfxModelessDialogController* pDialo static_cast<ScNameDlg*>(pDialog)->GetRangeNames(m_RangeMap); static_cast<ScNameDlg*>(pDialog)->Close(); sal_uInt16 nId = ScNameDefDlgWrapper::GetChildWindowId(); - SfxViewFrame* pViewFrm = GetViewFrame(); - SfxChildWindow* pWnd = pViewFrm->GetChildWindow( nId ); + SfxViewFrame& rViewFrm = GetViewFrame(); + SfxChildWindow* pWnd = rViewFrm.GetChildWindow( nId ); SC_MOD()->SetRefDialog( nId, pWnd == nullptr ); } diff --git a/sc/source/ui/view/tabvwshd.cxx b/sc/source/ui/view/tabvwshd.cxx index 86a3c0e623ba..52d97d1a25a9 100644 --- a/sc/source/ui/view/tabvwshd.cxx +++ b/sc/source/ui/view/tabvwshd.cxx @@ -34,10 +34,10 @@ weld::Window* ScTabViewShell::GetDialogParent() // (necessary when a slot is executed from the dialog's OK handler) if (nCurRefDlgId && nCurRefDlgId == SC_MOD()->GetCurRefDlgId()) { - SfxViewFrame* pViewFrm = GetViewFrame(); - if (pViewFrm->HasChildWindow(nCurRefDlgId)) + SfxViewFrame& rViewFrm = GetViewFrame(); + if (rViewFrm.HasChildWindow(nCurRefDlgId)) { - SfxChildWindow* pChild = pViewFrm->GetChildWindow(nCurRefDlgId); + SfxChildWindow* pChild = rViewFrm.GetChildWindow(nCurRefDlgId); if (pChild) { auto xController = pChild->GetController(); diff --git a/sc/source/ui/view/tabvwshf.cxx b/sc/source/ui/view/tabvwshf.cxx index b3db07466984..7580ba7fe603 100644 --- a/sc/source/ui/view/tabvwshf.cxx +++ b/sc/source/ui/view/tabvwshf.cxx @@ -768,7 +768,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) { bool bShowGrid = rViewData.GetShowGrid(); rViewData.SetShowGrid(!bShowGrid); - SfxBindings& rBindings = GetViewFrame()->GetBindings(); + SfxBindings& rBindings = GetViewFrame().GetBindings(); rBindings.Invalidate( FID_TAB_TOGGLE_GRID ); ScDocShellModificator aModificator(*rViewData.GetDocShell()); aModificator.SetDocumentModified(); @@ -887,7 +887,7 @@ void ScTabViewShell::ExecuteTable( SfxRequest& rReq ) { ScDocShell* pDocSh = rViewData.GetDocShell(); uno::Reference<container::XNameReplace> xEvents( new ScSheetEventsObj( pDocSh, nCurrentTab ) ); - uno::Reference<frame::XFrame> xFrame = GetViewFrame()->GetFrame().GetFrameInterface(); + uno::Reference<frame::XFrame> xFrame = GetViewFrame().GetFrame().GetFrameInterface(); SvxAbstractDialogFactory* pDlgFactory = SvxAbstractDialogFactory::Create(); ScopedVclPtr<VclAbstractDialog> pDialog( pDlgFactory->CreateSvxMacroAssignDlg( GetFrameWeld(), xFrame, false, xEvents, 0 ) ); diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index ae68a5dfc725..61d62a8cccd8 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -3129,13 +3129,13 @@ ScDocFunc& ScViewData::GetDocFunc() const SfxBindings& ScViewData::GetBindings() { assert(pView && "GetBindings() without ViewShell"); - return pView->GetViewFrame()->GetBindings(); + return pView->GetViewFrame().GetBindings(); } SfxDispatcher& ScViewData::GetDispatcher() { assert(pView && "GetDispatcher() without ViewShell"); - return *pView->GetViewFrame()->GetDispatcher(); + return *pView->GetViewFrame().GetDispatcher(); } ScMarkData& ScViewData::GetMarkData() @@ -3704,7 +3704,7 @@ void ScViewData::WriteUserDataSequence(uno::Sequence <beans::PropertyValue>& rSe // + 1, because we have to put the view id in the sequence beans::PropertyValue* pSettings = rSettings.getArray(); - sal_uInt16 nViewID(pView->GetViewFrame()->GetCurViewId()); + sal_uInt16 nViewID(pView->GetViewFrame().GetCurViewId()); pSettings[SC_VIEW_ID].Name = SC_VIEWID; pSettings[SC_VIEW_ID].Value <<= SC_VIEW + OUString::number(nViewID); diff --git a/sc/source/ui/view/viewutil.cxx b/sc/source/ui/view/viewutil.cxx index 7607c8f71bfa..3de98a0aef31 100644 --- a/sc/source/ui/view/viewutil.cxx +++ b/sc/source/ui/view/viewutil.cxx @@ -319,7 +319,7 @@ void ScViewUtil::ExecuteCharMap(const SvxFontItem& rOldFont, const ScTabViewShell& rShell) { SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); - SfxViewFrame& rFrame = *rShell.GetViewFrame(); + SfxViewFrame& rFrame = rShell.GetViewFrame(); SfxAllItemSet aSet( rFrame.GetObjectShell()->GetPool() ); aSet.Put( SfxBoolItem( FN_PARAM_1, false ) ); aSet.Put( SvxFontItem( rOldFont.GetFamily(), rOldFont.GetFamilyName(), rOldFont.GetStyleName(), rOldFont.GetPitch(), rOldFont.GetCharSet(), aSet.GetPool()->GetWhich( SID_ATTR_CHAR_FONT ) ) ); @@ -330,7 +330,7 @@ void ScViewUtil::ExecuteCharMap(const SvxFontItem& rOldFont, bool ScViewUtil::IsFullScreen( const SfxViewShell& rViewShell ) { - SfxBindings& rBindings = rViewShell.GetViewFrame()->GetBindings(); + SfxBindings& rBindings = rViewShell.GetViewFrame().GetBindings(); std::unique_ptr<SfxBoolItem> pItem; bool bIsFullScreen = false; |