diff options
| author | Caolán McNamara <caolanm@redhat.com> | 2019-06-16 15:19:38 +0100 |
|---|---|---|
| committer | Caolán McNamara <caolanm@redhat.com> | 2019-06-21 22:41:13 +0200 |
| commit | 5b8623863c71ced2cde5091ba4d402f1128e6761 (patch) | |
| tree | b167fe78b9ff310f3d34bda1f0dc2a983acf260f /sfx2 | |
| parent | 5261417cbb3051b812164838d19c0f748573df45 (diff) | |
remove newly unused SfxModelessDialog
Change-Id: I298a96bd3f45d10a92e5f2a853fc4e7a4c52228b
Reviewed-on: https://gerrit.libreoffice.org/74120
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sfx2')
| -rw-r--r-- | sfx2/source/dialog/basedlgs.cxx | 190 |
1 files changed, 0 insertions, 190 deletions
diff --git a/sfx2/source/dialog/basedlgs.cxx b/sfx2/source/dialog/basedlgs.cxx index e1f74636c58f..4291b2000982 100644 --- a/sfx2/source/dialog/basedlgs.cxx +++ b/sfx2/source/dialog/basedlgs.cxx @@ -140,196 +140,6 @@ void SfxModalDialog::dispose() ModalDialog::dispose(); } -void SfxModelessDialog::StateChanged( StateChangedType nStateChange ) -{ - if ( nStateChange == StateChangedType::InitShow ) - { - if ( !pImpl->aWinState.isEmpty() ) - { - SetWindowState( pImpl->aWinState ); - } - else - { - Point aPos = GetPosPixel(); - if ( !aPos.X() ) - { - Size aParentSize = GetParent()->GetOutputSizePixel(); - Size aDlgSize = GetSizePixel(); - aPos.AdjustX(( aParentSize.Width() - aDlgSize.Width() ) / 2 ); - aPos.AdjustY(( aParentSize.Height() - aDlgSize.Height() ) / 2 ); - - Point aPoint; - tools::Rectangle aRect = GetDesktopRectPixel(); - aPoint.setX( aRect.Right() - aDlgSize.Width() ); - aPoint.setY( aRect.Bottom() - aDlgSize.Height() ); - - aPoint = OutputToScreenPixel( aPoint ); - - if ( aPos.X() > aPoint.X() ) - aPos.setX( aPoint.X() ) ; - if ( aPos.Y() > aPoint.Y() ) - aPos.setY( aPoint.Y() ); - - if ( aPos.X() < 0 ) aPos.setX( 0 ); - if ( aPos.Y() < 0 ) aPos.setY( 0 ); - - SetPosPixel( aPos ); - } - } - - pImpl->bConstructed = true; - } - - ModelessDialog::StateChanged( nStateChange ); -} - -void SfxModelessDialog::Resize() - -/* [Description] - - This virtual method of the class FloatingWindow keeps track if a change - in size has been made. When this method is overridden by a derived class, - then the SfxFloatingWindow: Resize() must also be called. -*/ - -{ - ModelessDialog::Resize(); - if ( pImpl->bConstructed && pImpl->pMgr ) - { - // start timer for saving window status information - pImpl->aMoveIdle.Start(); - } -} - -void SfxModelessDialog::Move() -{ - ModelessDialog::Move(); - if ( pImpl->bConstructed && pImpl->pMgr && IsReallyVisible() ) - { - // start timer for saving window status information - pImpl->aMoveIdle.Start(); - } -} - -/* - Implements a timer event that is triggered by a move or resize of the window - This will save config information to Views.xcu with a small delay -*/ -IMPL_LINK_NOARG(SfxModelessDialog, TimerHdl, Timer *, void) -{ - pImpl->aMoveIdle.Stop(); - if ( pImpl->bConstructed && pImpl->pMgr ) - { - WindowStateMask nMask = WindowStateMask::Pos | WindowStateMask::State; - if ( GetStyle() & WB_SIZEABLE ) - nMask |= WindowStateMask::Width | WindowStateMask::Height; - pImpl->aWinState = GetWindowState( nMask ); - GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SfxChildIdentifier::DOCKINGWINDOW, SfxDockingConfig::ALIGNDOCKINGWINDOW, pImpl->pMgr->GetType() ); - } -} - -SfxModelessDialog::SfxModelessDialog(SfxBindings* pBindinx, - SfxChildWindow *pCW, vcl::Window *pParent, const OUString& rID, - const OUString& rUIXMLDescription) - : ModelessDialog(pParent, rID, rUIXMLDescription) -{ - SetInstallLOKNotifierHdl(LINK(this, SfxModelessDialog, InstallLOKNotifierHdl)); - Init(pBindinx, pCW); -} - -IMPL_STATIC_LINK_NOARG(SfxModelessDialog, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*) -{ - return SfxViewShell::Current(); -} - -void SfxModelessDialog::Init(SfxBindings *pBindinx, SfxChildWindow *pCW) -{ - pBindings = pBindinx; - pImpl.reset(new SfxModelessDialog_Impl); - pImpl->pMgr = pCW; - pImpl->bConstructed = false; - pImpl->bClosing = false; - if ( pBindinx ) - pImpl->StartListening( *pBindinx ); - pImpl->aMoveIdle.SetPriority(TaskPriority::RESIZE); - pImpl->aMoveIdle.SetInvokeHandler(LINK(this,SfxModelessDialog,TimerHdl)); -} - -/* [Description] - - If a ModelessDialog is enabled its ViewFrame will be activated. - This is necessary by PluginInFrames. -*/ -bool SfxModelessDialog::EventNotify( NotifyEvent& rEvt ) -{ - if ( pImpl ) - { - if ( rEvt.GetType() == MouseNotifyEvent::GETFOCUS ) - { - pBindings->SetActiveFrame( pImpl->pMgr->GetFrame() ); - pImpl->pMgr->Activate_Impl(); - } - else if ( rEvt.GetType() == MouseNotifyEvent::LOSEFOCUS && !HasChildPathFocus() ) - { - pBindings->SetActiveFrame( css::uno::Reference< css::frame::XFrame > () ); - } - else if( rEvt.GetType() == MouseNotifyEvent::KEYINPUT ) - { - // First, allow KeyInput for Dialog functions ( TAB etc. ) - if (!ModelessDialog::EventNotify(rEvt) && SfxViewShell::Current()) - { - // then also for valid global accelerators. - return SfxViewShell::Current()->GlobalKeyInput_Impl( *rEvt.GetKeyEvent() ); - } - return true; - } - } - - return ModelessDialog::EventNotify( rEvt ); -} - -SfxModelessDialog::~SfxModelessDialog() -{ - disposeOnce(); -} - -void SfxModelessDialog::dispose() -{ - if ( pImpl->pMgr->GetFrame().is() && pImpl->pMgr->GetFrame() == pBindings->GetActiveFrame() ) - pBindings->SetActiveFrame( nullptr ); - pImpl.reset(); - - SfxViewShell* pViewShell = SfxViewShell::Current(); - if (comphelper::LibreOfficeKit::isActive() && pViewShell) - { - pViewShell->notifyWindow(GetLOKWindowId(), "close"); - ReleaseLOKNotifier(); - } - - ModelessDialog::dispose(); -} - - -bool SfxModelessDialog::Close() - -/* [Description] - - The window is closed when the ChildWindow is destroyed by running the - ChildWindow-slots. If this is method is overridden by a derived class - method, then the SfxModelessDialogWindow: Close() must be called afterwards - if the Close() was not cancelled with "return sal_False". -*/ - -{ - // Execute with Parameters, since Toggle is ignored by some ChildWindows. - SfxBoolItem aValue( pImpl->pMgr->GetType(), false); - pBindings->GetDispatcher_Impl()->ExecuteList( - pImpl->pMgr->GetType(), - SfxCallMode::RECORD|SfxCallMode::SYNCHRON, { &aValue } ); - return true; -} - - void SfxModelessDialogController::Initialize(SfxChildWinInfo const *pInfo) /* [Description] |
