[Libreoffice-commits] core.git: include/sfx2 sfx2/source

Caolán McNamara (via logerrit) logerrit at kemper.freedesktop.org
Fri Jun 21 20:42:37 UTC 2019


 include/sfx2/basedlgs.hxx       |   32 ------
 sfx2/source/dialog/basedlgs.cxx |  190 ----------------------------------------
 2 files changed, 1 insertion(+), 221 deletions(-)

New commits:
commit 5b8623863c71ced2cde5091ba4d402f1128e6761
Author:     Caolán McNamara <caolanm at redhat.com>
AuthorDate: Sun Jun 16 15:19:38 2019 +0100
Commit:     Caolán McNamara <caolanm at redhat.com>
CommitDate: Fri Jun 21 22:41:13 2019 +0200

    remove newly unused SfxModelessDialog
    
    Change-Id: I298a96bd3f45d10a92e5f2a853fc4e7a4c52228b
    Reviewed-on: https://gerrit.libreoffice.org/74120
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/sfx2/basedlgs.hxx b/include/sfx2/basedlgs.hxx
index bbcaef188f4d..5a1b1ce16b28 100644
--- a/include/sfx2/basedlgs.hxx
+++ b/include/sfx2/basedlgs.hxx
@@ -60,37 +60,6 @@ public:
     virtual void dispose() override;
 };
 
-// class SfxModelessDialog --------------------------------------------------
-class SfxModelessDialog_Impl;
-class SFX2_DLLPUBLIC SfxModelessDialog: public ModelessDialog
-{
-    SfxBindings*            pBindings;
-    std::unique_ptr< SfxModelessDialog_Impl > pImpl;
-
-    SfxModelessDialog(SfxModelessDialog const &) = delete;
-    SfxModelessDialog& operator =(SfxModelessDialog const &) = delete;
-
-    void Init(SfxBindings *pBindinx, SfxChildWindow *pCW);
-
-    DECL_DLLPRIVATE_STATIC_LINK(SfxModelessDialog, InstallLOKNotifierHdl, void*, vcl::ILibreOfficeKitNotifier*);
-protected:
-    SfxModelessDialog( SfxBindings*, SfxChildWindow*,
-        vcl::Window*, const OUString& rID, const OUString& rUIXMLDescription );
-    virtual ~SfxModelessDialog() override;
-    virtual void dispose() override;
-    virtual bool            Close() override;
-    virtual void            Resize() override;
-    virtual void            Move() override;
-    virtual void            StateChanged( StateChangedType nStateChange ) override;
-
-public:
-    virtual bool            EventNotify( NotifyEvent& rNEvt ) override;
-    SfxBindings&            GetBindings()
-                            { return *pBindings; }
-
-    DECL_LINK(TimerHdl, Timer *, void);
-};
-
 class SFX2_DLLPUBLIC SfxDialogController : public weld::GenericDialogController
 {
 private:
@@ -112,6 +81,7 @@ public:
 };
 
 class SfxModelessDialog_Impl;
+
 class SFX2_DLLPUBLIC SfxModelessDialogController : public SfxDialogController
 {
     SfxBindings* m_pBindings;
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]


More information about the Libreoffice-commits mailing list