cui/source/dialogs/hltpbase.cxx | 2 - include/sfx2/frame.hxx | 5 --- include/sfx2/viewfrm.hxx | 4 -- sd/source/ui/slideshow/slideshow.cxx | 4 +- sd/source/ui/slideshow/slideshowimpl.cxx | 2 - sd/source/ui/tools/EventMultiplexer.cxx | 2 - sd/source/ui/view/outlview.cxx | 2 - sfx2/source/appl/workwin.cxx | 2 - sfx2/source/control/dispatch.cxx | 16 +-------- sfx2/source/doc/objserv.cxx | 50 +------------------------------ sfx2/source/doc/objxtor.cxx | 2 - sfx2/source/view/frame.cxx | 49 +----------------------------- sfx2/source/view/frame2.cxx | 1 sfx2/source/view/ipclient.cxx | 12 +++---- sfx2/source/view/viewfrm.cxx | 37 ++-------------------- sw/source/ui/chrdlg/chardlg.cxx | 2 - sw/source/uibase/docvw/romenu.cxx | 6 +-- sw/source/uibase/shells/basesh.cxx | 2 - sw/source/uibase/shells/frmsh.cxx | 2 - sw/source/uibase/shells/grfsh.cxx | 2 - sw/source/uibase/uiview/pview.cxx | 3 - sw/source/uibase/uiview/view.cxx | 7 ---- 22 files changed, 35 insertions(+), 179 deletions(-)
New commits: commit 2b3de550ef1e28cd4231352c91634f67aa6d642f Author: Noel Grandin <noel.gran...@collabora.co.uk> Date: Wed Nov 2 12:03:28 2016 +0200 remove pParentFrame from SfxFrame Found by the singlevalfields loplugin. Dead as least as far back as commit 93a7b558588be1f12e137329548b706daccc07df Author: Frank Schoenheit [fs] <frank.schoenh...@sun.com> Date: Fri Nov 27 21:16:24 2009 +0100 [CWS autorecovery] merged SfxTopFrame into SfxFrame SfxTopFrame was the only class deriving from the abstract class SfxFrame, so both can effectively be treated as one class. Arguably when that commit was done, SfxFrame should also have been renamed to SfxTopFrame, since that it was it now seems to be. Expanding the nullptr value off that field means that: SfxFrame::GetTopFrame always return this SfxFrame::IsParent always returns false SfxViewFrame::GetTopFrame is now the same as SfxViewFrame::GetFrame SfxViewFrame::GetParentViewFrame now returns null Change-Id: Iac088fa485c3d7299d1553845ced2f5ced3c85f2 Reviewed-on: https://gerrit.libreoffice.org/30485 Reviewed-by: Noel Grandin <noel.gran...@collabora.co.uk> Tested-by: Noel Grandin <noel.gran...@collabora.co.uk> diff --git a/cui/source/dialogs/hltpbase.cxx b/cui/source/dialogs/hltpbase.cxx index bb63d88..efa0335 100644 --- a/cui/source/dialogs/hltpbase.cxx +++ b/cui/source/dialogs/hltpbase.cxx @@ -152,7 +152,7 @@ void SvxHyperlinkTabPageBase::InitStdControls () SfxDispatcher* pDispatch = GetDispatcher(); SfxViewFrame* pViewFrame = pDispatch ? pDispatch->GetFrame() : nullptr; - SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetTopFrame() : nullptr; + SfxFrame* pFrame = pViewFrame ? &pViewFrame->GetFrame() : nullptr; if ( pFrame ) { std::unique_ptr<TargetList> pList(new TargetList); diff --git a/include/sfx2/frame.hxx b/include/sfx2/frame.hxx index 284075a..209fb69 100644 --- a/include/sfx2/frame.hxx +++ b/include/sfx2/frame.hxx @@ -95,7 +95,6 @@ class SFX2_DLLPUBLIC SfxFrame : public SvCompatWeakBase<SfxFrame> friend class SfxFrameWindow_Impl; private: - SfxFrame* pParentFrame; SfxFrameArr_Impl* pChildArr; std::unique_ptr< SfxFrame_Impl > pImpl; VclPtr<vcl::Window> pWindow; @@ -119,8 +118,6 @@ public: bool DoClose(); sal_uInt16 GetChildFrameCount() const; SfxFrame* GetChildFrame( sal_uInt16 nPos ) const; - SfxFrame* GetParentFrame() const - { return pParentFrame; } void SetPresentationMode( bool bSet ); SystemWindow* GetSystemWindow() const; @@ -130,8 +127,6 @@ public: SfxObjectShell* GetCurrentDocument() const; SfxViewFrame* GetCurrentViewFrame() const; - SfxFrame& GetTopFrame() const; - bool IsParent( SfxFrame* ) const; sal_uInt32 GetFrameType() const; static void GetDefaultTargetList( TargetList& ); diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx index 99f5fbc..fcfdf31 100644 --- a/include/sfx2/viewfrm.hxx +++ b/include/sfx2/viewfrm.hxx @@ -110,8 +110,6 @@ public: void DoActivate(bool bMDI); void DoDeactivate(bool bMDI, SfxViewFrame *pOld=nullptr); - SfxViewFrame* GetParentViewFrame() const; - using SfxShell::GetDispatcher; SfxDispatcher* GetDispatcher() { return m_pDispatcher; } SfxBindings& GetBindings() { return *m_pBindings; } @@ -149,8 +147,6 @@ public: bool DoClose(); sal_uIntPtr GetFrameType() const { return GetFrame().GetFrameType(); } - SfxFrame& GetTopFrame() const - { return GetFrame().GetTopFrame(); } void GetTargetList( TargetList& rList ) const { GetFrame().GetTargetList( rList ); } diff --git a/sd/source/ui/slideshow/slideshow.cxx b/sd/source/ui/slideshow/slideshow.cxx index 9f18403..902c869 100644 --- a/sd/source/ui/slideshow/slideshow.cxx +++ b/sd/source/ui/slideshow/slideshow.cxx @@ -613,7 +613,7 @@ WorkWindow *SlideShow::GetWorkWindow() if( !pShell || !pShell->GetViewFrame() ) return nullptr; - return dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent()); + return dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetFrame().GetWindow().GetParent()); } bool SlideShow::IsExitAfterPresenting() const @@ -668,7 +668,7 @@ void SAL_CALL SlideShow::end() if( pShell && pShell->GetViewFrame() ) { - WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetTopFrame().GetWindow().GetParent()); + WorkWindow* pWorkWindow = dynamic_cast<WorkWindow*>(pShell->GetViewFrame()->GetFrame().GetWindow().GetParent()); if( pWorkWindow ) { pWorkWindow->StartPresentationMode( (mxController.is() && mxController->maPresSettings.mbAlwaysOnTop) diff --git a/sd/source/ui/slideshow/slideshowimpl.cxx b/sd/source/ui/slideshow/slideshowimpl.cxx index d21d6f5..dd430e2 100644 --- a/sd/source/ui/slideshow/slideshowimpl.cxx +++ b/sd/source/ui/slideshow/slideshowimpl.cxx @@ -2485,7 +2485,7 @@ void SlideshowImpl::setActiveXToolbarsVisible( bool bVisible ) try { Reference< frame::XLayoutManager > xLayoutManager; - Reference< beans::XPropertySet > xFrameProps( pViewFrame->GetFrame().GetTopFrame().GetFrameInterface(), UNO_QUERY_THROW ); + Reference< beans::XPropertySet > xFrameProps( pViewFrame->GetFrame().GetFrameInterface(), UNO_QUERY_THROW ); if ( ( xFrameProps->getPropertyValue( "LayoutManager" ) >>= xLayoutManager ) && xLayoutManager.is() ) diff --git a/sd/source/ui/tools/EventMultiplexer.cxx b/sd/source/ui/tools/EventMultiplexer.cxx index 8a38ebd..924a5e9 100644 --- a/sd/source/ui/tools/EventMultiplexer.cxx +++ b/sd/source/ui/tools/EventMultiplexer.cxx @@ -208,7 +208,7 @@ EventMultiplexer::Implementation::Implementation (ViewShellBase& rBase) // Connect to the frame to listen for controllers being exchanged. // Listen to changes of certain properties. Reference<frame::XFrame> xFrame ( - mrBase.GetFrame()->GetTopFrame().GetFrameInterface(), + mrBase.GetFrame()->GetFrame().GetFrameInterface(), uno::UNO_QUERY); mxFrameWeak = xFrame; if (xFrame.is()) diff --git a/sd/source/ui/view/outlview.cxx b/sd/source/ui/view/outlview.cxx index c8ec0a1..35dd486 100644 --- a/sd/source/ui/view/outlview.cxx +++ b/sd/source/ui/view/outlview.cxx @@ -147,7 +147,7 @@ OutlineView::OutlineView( DrawDocShell& rDocSh, vcl::Window* pWindow, OutlineVie maBulletFont.SetOutline(false); maBulletFont.SetShadow(false); - Reference<XFrame> xFrame (mrOutlineViewShell.GetViewShellBase().GetFrame()->GetTopFrame().GetFrameInterface(), UNO_QUERY); + Reference<XFrame> xFrame (mrOutlineViewShell.GetViewShellBase().GetFrame()->GetFrame().GetFrameInterface(), UNO_QUERY); const OUString aSlotURL( ".uno:ShowSlide" ); maSlideImage = GetImage( xFrame, aSlotURL, true ); diff --git a/sfx2/source/appl/workwin.cxx b/sfx2/source/appl/workwin.cxx index f98235a..61a688c 100644 --- a/sfx2/source/appl/workwin.cxx +++ b/sfx2/source/appl/workwin.cxx @@ -462,7 +462,7 @@ void SfxWorkWindow::Sort_Impl() // constructor for workwin of a Frame SfxWorkWindow::SfxWorkWindow( vcl::Window *pWin, SfxFrame *pFrm, SfxFrame* pMaster ) : - pParent( pFrm->GetParentFrame() ? pFrm->GetParentFrame()->GetWorkWindow_Impl() : nullptr ), + pParent( nullptr ), pBindings(&pFrm->GetCurrentViewFrame()->GetBindings()), pWorkWin (pWin), pConfigShell( nullptr ), diff --git a/sfx2/source/control/dispatch.cxx b/sfx2/source/control/dispatch.cxx index 11d950e..80936ae 100644 --- a/sfx2/source/control/dispatch.cxx +++ b/sfx2/source/control/dispatch.cxx @@ -464,16 +464,7 @@ SfxDispatcher::SfxDispatcher() */ SfxDispatcher::SfxDispatcher(SfxViewFrame *pViewFrame) { - if ( pViewFrame ) - { - SfxViewFrame *pFrame = pViewFrame->GetParentViewFrame(); - if ( pFrame ) - Construct_Impl( pFrame->GetDispatcher() ); - else - Construct_Impl( nullptr ); - } - else - Construct_Impl( nullptr ); + Construct_Impl( nullptr ); xImp->pFrame = pViewFrame; } @@ -1299,8 +1290,7 @@ void SfxDispatcher::Update_Impl( bool bForce ) SetMenu_Impl(); SfxWorkWindow *pWorkWin = xImp->pFrame->GetFrame().GetWorkWindow_Impl(); - SfxWorkWindow *pTaskWin = xImp->pFrame->GetTopFrame().GetWorkWindow_Impl(); - pTaskWin->ResetStatusBar_Impl(); + pWorkWin->ResetStatusBar_Impl(); SfxDispatcher *pDispat = this; while ( pDispat ) @@ -1326,7 +1316,7 @@ void SfxDispatcher::Update_Impl( bool bForce ) pActDispat = pActDispat->xImp->pParent; } - Update_Impl_( bUIActive, !bIsIPActive, bIsIPActive, pTaskWin ); + Update_Impl_( bUIActive, !bIsIPActive, bIsIPActive, pWorkWin ); if ( (bUIActive || bIsActive) && !comphelper::LibreOfficeKit::isActive() ) pWorkWin->UpdateObjectBars_Impl(); diff --git a/sfx2/source/doc/objserv.cxx b/sfx2/source/doc/objserv.cxx index 1cccb0a..4f5b420 100644 --- a/sfx2/source/doc/objserv.cxx +++ b/sfx2/source/doc/objserv.cxx @@ -422,12 +422,6 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) if ( !pFrame ) return; - if ( pFrame->GetFrame().GetParentFrame() ) - { - pFrame->GetTopViewFrame()->GetObjectShell()->ExecuteSlot( rReq ); - return; - } - if ( !IsOwnStorageFormat( *GetMedium() ) ) return; @@ -757,31 +751,13 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) case SID_CLOSEDOC: { SfxViewFrame *pFrame = GetFrame(); - if ( pFrame && pFrame->GetFrame().GetParentFrame() ) - { - // If SID_CLOSEDOC is executed through menu and so on, but - // the current document is in a frame, then the - // FrameSetDocument should actually be closed. - pFrame->GetTopViewFrame()->GetObjectShell()->ExecuteSlot( rReq ); - rReq.Done(); - return; - } bool bInFrameSet = false; sal_uInt16 nFrames=0; pFrame = SfxViewFrame::GetFirst( this ); while ( pFrame ) { - if ( pFrame->GetFrame().GetParentFrame() ) - { - // In this document there still exists a view that is - // in a FrameSet , which of course may not be closed - // geclosed werden - bInFrameSet = true; - } - else - nFrames++; - + nFrames++; pFrame = SfxViewFrame::GetNext( *pFrame, this ); } @@ -791,8 +767,7 @@ void SfxObjectShell::ExecFile_Impl(SfxRequest &rReq) pFrame = SfxViewFrame::GetFirst( this ); while ( pFrame ) { - if ( !pFrame->GetFrame().GetParentFrame() ) - pFrame->GetFrame().DoClose(); + pFrame->GetFrame().DoClose(); pFrame = SfxViewFrame::GetNext( *pFrame, this ); } } @@ -985,14 +960,6 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) SfxViewFrame* pFrame = GetFrame(); if ( !pFrame ) pFrame = SfxViewFrame::GetFirst( this ); - if ( pFrame ) - { - if ( pFrame->GetFrame().GetParentFrame() ) - { - pFrame = pFrame->GetTopViewFrame(); - pDoc = pFrame->GetObjectShell(); - } - } if ( !pFrame || !pDoc->HasName() || !IsOwnStorageFormat( *pDoc->GetMedium() ) ) @@ -1016,18 +983,7 @@ void SfxObjectShell::GetState_Impl(SfxItemSet &rSet) case SID_CLOSEDOC: { - SfxObjectShell *pDoc = this; - SfxViewFrame *pFrame = GetFrame(); - if ( pFrame && pFrame->GetFrame().GetParentFrame() ) - { - - // If SID_CLOSEDOC is executed through menu and so on, but - // the current document is in a frame, then the - // FrameSetDocument should actually be closed. - pDoc = pFrame->GetTopViewFrame()->GetObjectShell(); - } - - if ( pDoc->GetFlags() & SfxObjectShellFlags::DONTCLOSE ) + if ( GetFlags() & SfxObjectShellFlags::DONTCLOSE ) rSet.DisableItem(nWhich); else rSet.Put(SfxStringItem(nWhich, SfxResId(STR_CLOSEDOC).toString())); diff --git a/sfx2/source/doc/objxtor.cxx b/sfx2/source/doc/objxtor.cxx index d6a8a5a..55f256cf 100644 --- a/sfx2/source/doc/objxtor.cxx +++ b/sfx2/source/doc/objxtor.cxx @@ -583,7 +583,7 @@ bool SfxObjectShell::PrepareClose if ( bUI && IsModified() && pFrame ) { // restore minimized - SfxFrame& rTop = pFrame->GetTopFrame(); + SfxFrame& rTop = pFrame->GetFrame(); SfxViewFrame::SetViewFrame( rTop.GetCurrentViewFrame() ); pFrame->GetFrame().Appear(); diff --git a/sfx2/source/view/frame.cxx b/sfx2/source/view/frame.cxx index fa2376f..9e80816 100644 --- a/sfx2/source/view/frame.cxx +++ b/sfx2/source/view/frame.cxx @@ -100,12 +100,6 @@ SfxFrame::~SfxFrame() if ( it != pFramesArr_Impl->end() ) pFramesArr_Impl->erase( it ); - if ( pParentFrame ) - { - pParentFrame->RemoveChildFrame_Impl( this ); - pParentFrame = nullptr; - } - delete pImpl->pDescr; if ( pChildArr ) @@ -253,14 +247,6 @@ void SfxFrame::RemoveChildFrame_Impl( SfxFrame* pFrame ) pChildArr->erase( it ); }; -SfxFrame& SfxFrame::GetTopFrame() const -{ - const SfxFrame* pParent = this; - while ( pParent->pParentFrame ) - pParent = pParent->pParentFrame; - return *const_cast< SfxFrame* >( pParent ); -} - bool SfxFrame::IsClosing_Impl() const { return pImpl->bClosing; @@ -315,9 +301,7 @@ SfxViewFrame* SfxFrame::GetCurrentViewFrame() const SfxDispatcher* SfxFrame::GetDispatcher_Impl() const { - if ( pImpl->pCurrentViewFrame ) - return pImpl->pCurrentViewFrame->GetDispatcher(); - return GetParentFrame()->GetDispatcher_Impl(); + return pImpl->pCurrentViewFrame->GetDispatcher(); } bool SfxFrame::IsAutoLoadLocked_Impl() const @@ -410,7 +394,6 @@ void SfxFrame::UpdateDescriptor( SfxObjectShell *pDoc ) assert(pDoc && "NULL-Document inserted ?!"); - GetParentFrame(); const SfxMedium *pMed = pDoc->GetMedium(); GetDescriptor()->SetActualURL( pMed->GetOrigURL() ); @@ -458,7 +441,7 @@ SfxFrameDescriptor* SfxFrame::GetDescriptor() const if ( !pImpl->pDescr ) { - DBG_ASSERT( !GetParentFrame(), "No TopLevel-Frame, but no Descriptor!" ); + DBG_ASSERT( true, "No TopLevel-Frame, but no Descriptor!" ); pImpl->pDescr = new SfxFrameDescriptor; if ( GetCurrentDocument() ) pImpl->pDescr->SetURL( GetCurrentDocument()->GetMedium()->GetOrigURL() ); @@ -478,10 +461,7 @@ void SfxFrame::GetDefaultTargetList(TargetList& rList) void SfxFrame::GetTargetList( TargetList& rList ) const { - if ( !GetParentFrame() ) - { - SfxFrame::GetDefaultTargetList(rList); - } + SfxFrame::GetDefaultTargetList(rList); SfxViewFrame* pView = GetCurrentViewFrame(); if( pView && pView->GetViewShell() && pChildArr ) @@ -495,19 +475,6 @@ void SfxFrame::GetTargetList( TargetList& rList ) const } } -bool SfxFrame::IsParent( SfxFrame *pFrame ) const -{ - SfxFrame *pParent = pParentFrame; - while ( pParent ) - { - if ( pParent == pFrame ) - return true; - pParent = pParent->pParentFrame; - } - - return false; -} - void SfxFrame::InsertTopFrame_Impl( SfxFrame* pFrame ) { SfxFrameArr_Impl& rArr = *SfxGetpApp()->Get_Impl()->pTopFrames; @@ -676,8 +643,6 @@ void SfxFrame::Appear() GetCurrentViewFrame()->Show(); GetWindow().Show(); pImpl->xFrame->getContainerWindow()->setVisible( true ); - if ( pParentFrame ) - pParentFrame->Appear(); Reference < css::awt::XTopWindow > xTopWindow( pImpl->xFrame->getContainerWindow(), UNO_QUERY ); if ( xTopWindow.is() ) xTopWindow->toFront(); @@ -721,12 +686,6 @@ void SfxFrame::SetToolSpaceBorderPixel_Impl( const SvBorder& rBorder ) else aSize.Height() = 0; - if ( GetParentFrame() ) - { - bool bHasTools = rBorder.Left() != rBorder.Right() || rBorder.Top() != rBorder.Bottom(); - pF->GetWindow().SetBorderStyle( bHasTools ? WindowBorderStyle::NORMAL : WindowBorderStyle::NOBORDER ); - } - pF->GetWindow().SetPosSizePixel( aPos, aSize ); } } @@ -742,8 +701,6 @@ SfxWorkWindow* SfxFrame::GetWorkWindow_Impl() const { if ( pImpl->pWorkWin ) return pImpl->pWorkWin; - else if ( pParentFrame ) - return pParentFrame->GetWorkWindow_Impl(); else return nullptr; } diff --git a/sfx2/source/view/frame2.cxx b/sfx2/source/view/frame2.cxx index 2672aa5..6f8e7d4 100644 --- a/sfx2/source/view/frame2.cxx +++ b/sfx2/source/view/frame2.cxx @@ -290,7 +290,6 @@ SfxFrame* SfxFrame::Create( const Reference < XFrame >& i_rFrame ) SfxFrame::SfxFrame( vcl::Window& i_rContainerWindow ) :SvCompatWeakBase<SfxFrame>( this ) - ,pParentFrame( nullptr ) ,pChildArr( nullptr ) ,pWindow( nullptr ) { diff --git a/sfx2/source/view/ipclient.cxx b/sfx2/source/view/ipclient.cxx index bc98810..3b080e8 100644 --- a/sfx2/source/view/ipclient.cxx +++ b/sfx2/source/view/ipclient.cxx @@ -929,7 +929,7 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) if ( !nError ) { - m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true); + m_pViewSh->GetViewFrame()->GetFrame().LockResize_Impl(true); try { m_pImp->m_xObject->setClientSite( m_pImp->m_xClient ); @@ -982,8 +982,8 @@ ErrCode SfxInPlaceClient::DoVerb( long nVerb ) } SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); - pFrame->GetTopFrame().LockResize_Impl(false); - pFrame->GetTopFrame().Resize(); + pFrame->GetFrame().LockResize_Impl(false); + pFrame->GetFrame().Resize(); } } } @@ -1041,7 +1041,7 @@ void SfxInPlaceClient::DeactivateObject() } } - m_pViewSh->GetViewFrame()->GetTopFrame().LockResize_Impl(true); + m_pViewSh->GetViewFrame()->GetFrame().LockResize_Impl(true); if ( (m_pImp->m_xObject->getStatus( m_pImp->m_nAspect ) & embed::EmbedMisc::MS_EMBED_ACTIVATEWHENVISIBLE) || svt::EmbeddedObjectRef::IsGLChart(m_pImp->m_xObject) ) @@ -1062,8 +1062,8 @@ void SfxInPlaceClient::DeactivateObject() SfxViewFrame* pFrame = m_pViewSh->GetViewFrame(); SfxViewFrame::SetViewFrame( pFrame ); - pFrame->GetTopFrame().LockResize_Impl(false); - pFrame->GetTopFrame().Resize(); + pFrame->GetFrame().LockResize_Impl(false); + pFrame->GetFrame().Resize(); } catch (css::uno::Exception& ) {} diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx index 2d698db..5ce84be 100644 --- a/sfx2/source/view/viewfrm.cxx +++ b/sfx2/source/view/viewfrm.cxx @@ -204,7 +204,6 @@ static bool AskPasswordToModify_Impl( const uno::Reference< task::XInteractionHa void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) { - SfxFrame *pParent = GetFrame().GetParentFrame(); if ( rReq.GetSlot() == SID_RELOAD ) { // When CTRL-Reload, reload the active Frame @@ -222,18 +221,6 @@ void SfxViewFrame::ExecReload_Impl( SfxRequest& rReq ) } } } - else - { - // When CTRL-Edit, edit the TopFrame. - sal_uInt16 nModifier = rReq.GetModifier(); - - if ( ( nModifier & KEY_MOD1 ) && pParent ) - { - SfxViewFrame *pTop = GetTopViewFrame(); - pTop->ExecReload_Impl( rReq ); - return; - } - } SfxObjectShell* pSh = GetObjectShell(); switch ( rReq.GetSlot() ) @@ -1510,7 +1497,7 @@ void SfxViewFrame::Enable( bool bEnable ) { m_pImpl->bEnabled = bEnable; - vcl::Window *pWindow = &GetFrame().GetTopFrame().GetWindow(); + vcl::Window *pWindow = &GetFrame().GetWindow(); if ( !bEnable ) m_pImpl->bWindowWasEnabled = pWindow->IsInputEnabled(); if ( !bEnable || m_pImpl->bWindowWasEnabled ) @@ -1595,12 +1582,6 @@ void SfxViewFrame::MakeActive_Impl( bool bGrabFocus ) { bPreview = true; } - else - { - SfxViewFrame* pParent = GetParentViewFrame(); - if ( pParent ) - pParent->SetActiveChildFrame_Impl( this ); - } css::uno::Reference< css::frame::XFrame > xFrame = GetFrame().GetFrameInterface(); if ( !bPreview ) @@ -2218,16 +2199,6 @@ void SfxViewFrame::ToTop() /* [Description] - The ParentViewFrame is the ViewFrame of the ParentFrames. -*/ -SfxViewFrame* SfxViewFrame::GetParentViewFrame() const -{ - SfxFrame *pFrame = GetFrame().GetParentFrame(); - return pFrame ? pFrame->GetCurrentViewFrame() : nullptr; -} - -/* [Description] - GetFrame returns the Frame, in which the ViewFrame is located. */ SfxFrame& SfxViewFrame::GetFrame() const @@ -2237,7 +2208,7 @@ SfxFrame& SfxViewFrame::GetFrame() const SfxViewFrame* SfxViewFrame::GetTopViewFrame() const { - return GetFrame().GetTopFrame().GetCurrentViewFrame(); + return GetFrame().GetCurrentViewFrame(); } vcl::Window& SfxViewFrame::GetWindow() const @@ -2843,7 +2814,7 @@ void SfxViewFrame::ChildWindowExecute( SfxRequest &rReq ) { if (!SvtModuleOptions().IsModuleInstalled(SvtModuleOptions::EModule::DATABASE)) return; - Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface(); + Reference < XFrame > xFrame = GetFrame().GetFrameInterface(); Reference < XFrame > xBeamer( xFrame->findFrame( "_beamer", FrameSearchFlag::CHILDREN ) ); bool bHasChild = xBeamer.is(); bool bShow = pShowItem ? pShowItem->GetValue() : !bHasChild; @@ -2950,7 +2921,7 @@ void SfxViewFrame::ChildWindowState( SfxItemSet& rState ) } else if ( nSID == SID_BROWSER ) { - Reference < XFrame > xFrame = GetFrame().GetTopFrame().GetFrameInterface()-> + Reference < XFrame > xFrame = GetFrame().GetFrameInterface()-> findFrame( "_beamer", FrameSearchFlag::CHILDREN ); if ( !xFrame.is() ) rState.DisableItem( nSID ); diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx index 3d37b43..1211e6e 100644 --- a/sw/source/ui/chrdlg/chardlg.cxx +++ b/sw/source/ui/chrdlg/chardlg.cxx @@ -169,7 +169,7 @@ SwCharURLPage::SwCharURLPage(vcl::Window* pParent, const SfxItemSet& rCoreSet) ::FillCharStyleListBox(*m_pNotVisitedLB, pView->GetDocShell()); TargetList* pList = new TargetList; - const SfxFrame& rFrame = pView->GetViewFrame()->GetTopFrame(); + const SfxFrame& rFrame = pView->GetViewFrame()->GetFrame(); rFrame.GetTargetList(*pList); if ( !pList->empty() ) { diff --git a/sw/source/uibase/docvw/romenu.cxx b/sw/source/uibase/docvw/romenu.cxx index d8ebac8..11a4e30 100644 --- a/sw/source/uibase/docvw/romenu.cxx +++ b/sw/source/uibase/docvw/romenu.cxx @@ -186,10 +186,8 @@ SwReadOnlyPopup::SwReadOnlyPopup( const Point &rDPos, SwView &rV ) : else EnableItem( MN_READONLY_LOADGRAPHIC, false ); - bool bReloadFrame = nullptr != rSh.GetView().GetViewFrame()->GetFrame().GetParentFrame(); - EnableItem( MN_READONLY_RELOAD_FRAME, - bReloadFrame ); - EnableItem( MN_READONLY_RELOAD, !bReloadFrame); + EnableItem( MN_READONLY_RELOAD_FRAME, false ); + EnableItem( MN_READONLY_RELOAD); Check( MN_READONLY_EDITDOC, SID_EDITDOC, rDis ); Check( MN_READONLY_SELECTION_MODE, FN_READONLY_SELECTION_MODE, rDis ); diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx index 7eb5f48..f7daef9 100644 --- a/sw/source/uibase/shells/basesh.cxx +++ b/sw/source/uibase/shells/basesh.cxx @@ -170,7 +170,7 @@ static void lcl_UpdateIMapDlg( SwWrtShell& rSh ) void* pEditObj = GraphicType::NONE != nGrfType && GraphicType::Default != nGrfType ? rSh.GetIMapInventor() : nullptr; std::unique_ptr<TargetList> pList(new TargetList); - rSh.GetView().GetViewFrame()->GetTopFrame().GetTargetList(*pList); + rSh.GetView().GetViewFrame()->GetFrame().GetTargetList(*pList); SfxItemSet aSet( rSh.GetAttrPool(), RES_URL, RES_URL ); rSh.GetFlyFrameAttr( aSet ); diff --git a/sw/source/uibase/shells/frmsh.cxx b/sw/source/uibase/shells/frmsh.cxx index d1eb5f0..764d004 100644 --- a/sw/source/uibase/shells/frmsh.cxx +++ b/sw/source/uibase/shells/frmsh.cxx @@ -464,7 +464,7 @@ void SwFrameShell::Execute(SfxRequest &rReq) if(pArgs && pArgs->GetItemState(FN_FORMAT_FRAME_DLG, false, &pItem) == SfxItemState::SET) sDefPage = OUStringToOString(static_cast<const SfxStringItem *>(pItem)->GetValue(), RTL_TEXTENCODING_UTF8); - aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); + aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame())); FieldUnit eMetric = ::GetDfltMetric(dynamic_cast<SwWebView*>( &GetView()) != nullptr ); SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric) )); SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create(); diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx index 91307fb..8553c3e 100644 --- a/sw/source/uibase/shells/grfsh.cxx +++ b/sw/source/uibase/shells/grfsh.cxx @@ -337,7 +337,7 @@ void SwGrfShell::Execute(SfxRequest &rReq) aSet.Put(SfxBoolItem(FN_KEEP_ASPECT_RATIO, aUsrPref.IsKeepRatio())); aSet.Put(SfxBoolItem( SID_ATTR_GRAF_KEEP_ZOOM, aUsrPref.IsGrfKeepZoom())); - aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetTopFrame())); + aSet.Put(SfxFrameItem( SID_DOCFRAME, &GetView().GetViewFrame()->GetFrame())); SfxObjectShell * sh = rSh.GetDoc()->GetPersist(); if (sh != nullptr && sh->HasName()) diff --git a/sw/source/uibase/uiview/pview.cxx b/sw/source/uibase/uiview/pview.cxx index a30321c..9b89c39 100644 --- a/sw/source/uibase/uiview/pview.cxx +++ b/sw/source/uibase/uiview/pview.cxx @@ -1185,8 +1185,7 @@ SwPagePreview::SwPagePreview(SfxViewFrame *pViewFrame, SfxViewShell* pOldSh): m_sPageStr(SW_RES(STR_PAGE)), m_pHScrollbar(nullptr), m_pVScrollbar(nullptr), - m_pScrollFill(VclPtr<ScrollBarBox>::Create( &pViewFrame->GetWindow(), - pViewFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), + m_pScrollFill(VclPtr<ScrollBarBox>::Create( &pViewFrame->GetWindow(), WB_SIZEABLE )), mnPageCount( 0 ), mbResetFormDesignMode( false ), mbFormDesignModeToReset( false ) diff --git a/sw/source/uibase/uiview/view.cxx b/sw/source/uibase/uiview/view.cxx index b5a0d53..b0dba6e 100644 --- a/sw/source/uibase/uiview/view.cxx +++ b/sw/source/uibase/uiview/view.cxx @@ -691,7 +691,7 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_pFormShell(nullptr), m_pHScrollbar(nullptr), m_pVScrollbar(nullptr), - m_pScrollFill(VclPtr<ScrollBarBox>::Create( &_pFrame->GetWindow(), _pFrame->GetFrame().GetParentFrame() ? 0 : WB_SIZEABLE )), + m_pScrollFill(VclPtr<ScrollBarBox>::Create( &_pFrame->GetWindow(), WB_SIZEABLE )), m_pVRuler(VclPtr<SvxRuler>::Create(&GetViewFrame()->GetWindow(), m_pEditWin, SvxRulerSupportFlags::TABS | SvxRulerSupportFlags::PARAGRAPH_MARGINS_VERTICAL| SvxRulerSupportFlags::BORDERS | SvxRulerSupportFlags::REDUCED_METRIC, @@ -874,11 +874,6 @@ SwView::SwView( SfxViewFrame *_pFrame, SfxViewShell* pOldSh ) m_pVRuler->SetActive(); SfxViewFrame* pViewFrame = GetViewFrame(); - if( pViewFrame->GetFrame().GetParentFrame()) - { - aUsrPref.SetViewHRuler(false); - aUsrPref.SetViewVRuler(false); - } StartListening(*pViewFrame, true); StartListening(rDocSh, true); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits