[Libreoffice-commits] core.git: include/sfx2 sfx2/source
Stephan Bergmann
sbergman at redhat.com
Fri Oct 7 17:24:03 UTC 2016
include/sfx2/viewfrm.hxx | 1 -
sfx2/source/appl/app.cxx | 32 +++++++++++++-------------------
sfx2/source/view/viewfrm.cxx | 39 +++++++--------------------------------
3 files changed, 20 insertions(+), 52 deletions(-)
New commits:
commit 3d5d631e5ea9dd897abd5de61a92a75ba22b040e
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Oct 7 19:20:30 2016 +0200
SfxViewFrame::GetParentViewFrame_Impl always returns nullptr
...ever since 4d61332a3cb172cdfe29f64efb325f6ef20c573c "[CWS autorecovery]
removed (now) unused methods in Sfx(Top)Frame"
Change-Id: I3a1bc00d8a11337211cdf7265ad8e5e7d5363600
diff --git a/include/sfx2/viewfrm.hxx b/include/sfx2/viewfrm.hxx
index a413638..bc18c91 100644
--- a/include/sfx2/viewfrm.hxx
+++ b/include/sfx2/viewfrm.hxx
@@ -196,7 +196,6 @@ public:
SAL_DLLPRIVATE void StateView_Impl( SfxItemSet &rSet );
SAL_DLLPRIVATE void ExecHistory_Impl( SfxRequest &rReq );
SAL_DLLPRIVATE void StateHistory_Impl( SfxItemSet &rSet );
- SAL_DLLPRIVATE static SfxViewFrame* GetParentViewFrame_Impl();
SAL_DLLPRIVATE void ForceOuterResize_Impl();
SAL_DLLPRIVATE bool IsResizeInToOut_Impl() const;
SAL_DLLPRIVATE void UpdateDocument_Impl();
diff --git a/sfx2/source/appl/app.cxx b/sfx2/source/appl/app.cxx
index 0b0c2d8..9d13885 100644
--- a/sfx2/source/appl/app.cxx
+++ b/sfx2/source/appl/app.cxx
@@ -312,41 +312,35 @@ void SfxApplication::SetViewFrame_Impl( SfxViewFrame *pFrame )
{
if ( pFrame != pImpl->pViewFrame )
{
- // get the containerframes ( if one of the frames is an InPlaceFrame )
- SfxViewFrame *pOldContainerFrame = pImpl->pViewFrame;
- while ( pOldContainerFrame && SfxViewFrame::GetParentViewFrame_Impl() )
- pOldContainerFrame = SfxViewFrame::GetParentViewFrame_Impl();
- SfxViewFrame *pNewContainerFrame = pFrame;
- while ( pNewContainerFrame && SfxViewFrame::GetParentViewFrame_Impl() )
- pNewContainerFrame = SfxViewFrame::GetParentViewFrame_Impl();
+ SfxViewFrame *pOldFrame = pImpl->pViewFrame;
// DocWinActivate : both frames belong to the same TopWindow
// TopWinActivate : both frames belong to different TopWindows
- bool bTaskActivate = pOldContainerFrame != pNewContainerFrame;
+ bool bTaskActivate = pOldFrame != pFrame;
- if ( pOldContainerFrame )
+ if ( pOldFrame )
{
if ( bTaskActivate )
- NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldContainerFrame->GetObjectShell(), pOldContainerFrame->GetFrame().GetController() ) );
- pOldContainerFrame->DoDeactivate( bTaskActivate, pFrame );
+ NotifyEvent( SfxViewEventHint( SFX_EVENT_DEACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::DEACTIVATEDOC), pOldFrame->GetObjectShell(), pOldFrame->GetFrame().GetController() ) );
+ pOldFrame->DoDeactivate( bTaskActivate, pFrame );
- if( pOldContainerFrame->GetProgress() )
- pOldContainerFrame->GetProgress()->Suspend();
+ if( pOldFrame->GetProgress() )
+ pOldFrame->GetProgress()->Suspend();
}
pImpl->pViewFrame = pFrame;
- if( pNewContainerFrame )
+ if( pFrame )
{
- pNewContainerFrame->DoActivate( bTaskActivate );
- if ( bTaskActivate && pNewContainerFrame->GetObjectShell() )
+ pFrame->DoActivate( bTaskActivate );
+ if ( bTaskActivate && pFrame->GetObjectShell() )
{
- pNewContainerFrame->GetObjectShell()->PostActivateEvent_Impl( pNewContainerFrame );
- NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::ACTIVATEDOC), pNewContainerFrame->GetObjectShell(), pNewContainerFrame->GetFrame().GetController() ) );
+ pFrame->GetObjectShell()->PostActivateEvent_Impl( pFrame );
+ NotifyEvent(SfxViewEventHint(SFX_EVENT_ACTIVATEDOC, GlobalEventConfig::GetEventName(GlobalEventId::ACTIVATEDOC), pFrame->GetObjectShell(), pFrame->GetFrame().GetController() ) );
}
- SfxProgress *pProgress = pNewContainerFrame->GetProgress();
+ SfxProgress *pProgress = pFrame->GetProgress();
if ( pProgress )
{
if( pProgress->IsSuspended() )
diff --git a/sfx2/source/view/viewfrm.cxx b/sfx2/source/view/viewfrm.cxx
index 1a161f3..4fb03e4 100644
--- a/sfx2/source/view/viewfrm.cxx
+++ b/sfx2/source/view/viewfrm.cxx
@@ -1550,16 +1550,6 @@ void SfxViewFrame::SetViewShell_Impl( SfxViewShell *pVSh )
m_pImpl->bResizeInToOut = false;
}
-/* [Description]
-
- The ParentViewFrame of the Containers ViewFrame in the internal InPlace
-*/
-//TODO/LATER: is it still necessary? is there a replacement for GetParentViewFrame_Impl?
-SfxViewFrame* SfxViewFrame::GetParentViewFrame_Impl()
-{
- return nullptr;
-}
-
void SfxViewFrame::ForceOuterResize_Impl()
{
m_pImpl->bResizeInToOut = true;
@@ -1583,20 +1573,11 @@ void SfxViewFrame::Enable( bool bEnable )
{
m_pImpl->bEnabled = bEnable;
- // e.g. InPlace-Frames have a parent...
- SfxViewFrame *pParent = GetParentViewFrame_Impl();
- if ( pParent )
- {
- pParent->Enable( bEnable );
- }
- else
- {
- vcl::Window *pWindow = &GetFrame().GetTopFrame().GetWindow();
- if ( !bEnable )
- m_pImpl->bWindowWasEnabled = pWindow->IsInputEnabled();
- if ( !bEnable || m_pImpl->bWindowWasEnabled )
- pWindow->EnableInput( bEnable );
- }
+ vcl::Window *pWindow = &GetFrame().GetTopFrame().GetWindow();
+ if ( !bEnable )
+ m_pImpl->bWindowWasEnabled = pWindow->IsInputEnabled();
+ if ( !bEnable || m_pImpl->bWindowWasEnabled )
+ pWindow->EnableInput( bEnable );
// cursor and focus
SfxViewShell* pViewSh = GetViewShell();
@@ -1684,7 +1665,6 @@ void SfxViewFrame::MakeActive_Impl( bool bGrabFocus )
pParent->SetActiveChildFrame_Impl( this );
}
- SfxViewFrame* pCurrent = SfxViewFrame::Current();
css::uno::Reference< css::frame::XFrame > xFrame = GetFrame().GetFrameInterface();
if ( !bPreview )
{
@@ -1699,8 +1679,7 @@ void SfxViewFrame::MakeActive_Impl( bool bGrabFocus )
if (pWindow && pWindow->HasChildPathFocus() && bGrabFocus)
{
SfxInPlaceClient *pCli = GetViewShell()->GetUIActiveClient();
- if ( ( !pCli || !pCli->IsObjectUIActive() ) &&
- ( !pCurrent || SfxViewFrame::GetParentViewFrame_Impl() != this ) )
+ if ( !pCli || !pCli->IsObjectUIActive() )
GetFrame().GrabFocusOnComponent_Impl();
}
}
@@ -2810,11 +2789,7 @@ void SfxViewFrame::MiscState_Impl(SfxItemSet &rSet)
{
case SID_CURRENT_URL:
{
- // Get the ContainerFrame, when internal InPlace.
- SfxViewFrame *pFrame = this;
- if ( SfxViewFrame::GetParentViewFrame_Impl() )
- pFrame = SfxViewFrame::GetParentViewFrame_Impl();
- rSet.Put( SfxStringItem( nWhich, pFrame->GetActualPresentationURL_Impl() ) );
+ rSet.Put( SfxStringItem( nWhich, GetActualPresentationURL_Impl() ) );
break;
}
More information about the Libreoffice-commits
mailing list