? source/dockwin.diff Index: inc/sfx2/basedlgs.hxx =================================================================== RCS file: /cvs/framework/sfx2/inc/sfx2/basedlgs.hxx,v retrieving revision 1.2 diff -u -r1.2 basedlgs.hxx --- inc/sfx2/basedlgs.hxx 11 Apr 2007 21:16:29 -0000 1.2 +++ inc/sfx2/basedlgs.hxx 28 Dec 2007 12:57:51 -0000 @@ -116,6 +116,7 @@ Size aSize; SfxModelessDialog_Impl* pImp; + SAL_DLLPRIVATE SfxModelessDialog(SfxModelessDialog &); // not defined SAL_DLLPRIVATE void operator =(SfxModelessDialog &); // not defined @@ -136,6 +137,9 @@ virtual long Notify( NotifyEvent& rNEvt ); SfxBindings& GetBindings() { return *pBindings; } + + DECL_LINK( TimerHdl, Timer* ); + }; // class SfxFloatingWindow -------------------------------------------------- @@ -171,6 +175,9 @@ public: virtual void FillInfo(SfxChildWinInfo&) const; void Initialize (SfxChildWinInfo* pInfo); + + DECL_LINK( TimerHdl, Timer* ); + }; // class SfxSingleTabDialog -------------------------------------------------- Index: source/dialog/basedlgs.cxx =================================================================== RCS file: /cvs/framework/sfx2/source/dialog/basedlgs.cxx,v retrieving revision 1.29 diff -u -r1.29 basedlgs.cxx --- source/dialog/basedlgs.cxx 27 Jun 2007 23:09:26 -0000 1.29 +++ source/dialog/basedlgs.cxx 28 Dec 2007 12:58:43 -0000 @@ -73,11 +73,15 @@ class SfxModelessDialog_Impl : public SfxListener { + public: ByteString aWinState; SfxChildWindow* pMgr; BOOL bConstructed; void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + Timer aMoveTimer; + }; void SfxModelessDialog_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) @@ -100,6 +104,9 @@ SfxChildWindow* pMgr; BOOL bConstructed; void Notify( SfxBroadcaster& rBC, const SfxHint& rHint ); + + Timer aMoveTimer; + }; void SfxFloatingWindow_Impl::Notify( SfxBroadcaster&, const SfxHint& rHint ) @@ -315,13 +322,8 @@ ModelessDialog::Resize(); if ( pImp->bConstructed && pImp->pMgr ) { - if ( !IsRollUp() ) - aSize = GetSizePixel(); - ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; - if ( GetStyle() & WB_SIZEABLE ) - nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); - pImp->aWinState = GetWindowState( nMask ); - GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); + // start timer for saving window status information + pImp->aMoveTimer.Start(); } } @@ -330,14 +332,32 @@ ModelessDialog::Move(); if ( pImp->bConstructed && pImp->pMgr && IsReallyVisible() ) { + // start timer for saving window status information + pImp->aMoveTimer.Start(); + } +} + +IMPL_LINK( SfxModelessDialog, TimerHdl, Timer*, EMPTYARG) +/* + 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 +*/ +{ + pImp->aMoveTimer.Stop(); + if ( pImp->bConstructed && pImp->pMgr ) + { + if ( !IsRollUp() ) + aSize = GetSizePixel(); ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; if ( GetStyle() & WB_SIZEABLE ) nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); pImp->aWinState = GetWindowState( nMask ); GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); } + return 0; } + // ----------------------------------------------------------------------- SfxModelessDialog::SfxModelessDialog( SfxBindings *pBindinx, @@ -354,6 +374,8 @@ SetUniqueId( nId ); if ( pBindinx ) pImp->StartListening( *pBindinx ); + pImp->aMoveTimer.SetTimeout(50); + pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxModelessDialog,TimerHdl)); } // ----------------------------------------------------------------------- @@ -372,6 +394,8 @@ SetUniqueId( nId ); if ( pBindinx ) pImp->StartListening( *pBindinx ); + pImp->aMoveTimer.SetTimeout(50); + pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxModelessDialog,TimerHdl)); } // ----------------------------------------------------------------------- @@ -538,6 +562,9 @@ SetUniqueId( nId ); if ( pBindinx ) pImp->StartListening( *pBindinx ); + pImp->aMoveTimer.SetTimeout(50); + pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxFloatingWindow,TimerHdl)); + } // ----------------------------------------------------------------------- @@ -557,6 +584,9 @@ SetUniqueId( nId ); if ( pBindinx ) pImp->StartListening( *pBindinx ); + pImp->aMoveTimer.SetTimeout(50); + pImp->aMoveTimer.SetTimeoutHdl(LINK(this,SfxFloatingWindow,TimerHdl)); + } //------------------------------------------------------------------------- @@ -614,13 +644,8 @@ FloatingWindow::Resize(); if ( pImp->bConstructed && pImp->pMgr ) { - if ( !IsRollUp() ) - aSize = GetSizePixel(); - ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; - if ( GetStyle() & WB_SIZEABLE ) - nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); - pImp->aWinState = GetWindowState( nMask ); - GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); + // start timer for saving window status information + pImp->aMoveTimer.Start(); } } @@ -629,14 +654,32 @@ FloatingWindow::Move(); if ( pImp->bConstructed && pImp->pMgr ) { + // start timer for saving window status information + pImp->aMoveTimer.Start(); + } +} + +IMPL_LINK( SfxFloatingWindow, TimerHdl, Timer*, EMPTYARG) +/* + 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 +*/ +{ + pImp->aMoveTimer.Stop(); + if ( pImp->bConstructed && pImp->pMgr ) + { + if ( !IsRollUp() ) + aSize = GetSizePixel(); ULONG nMask = WINDOWSTATE_MASK_POS | WINDOWSTATE_MASK_STATE; if ( GetStyle() & WB_SIZEABLE ) nMask |= ( WINDOWSTATE_MASK_WIDTH | WINDOWSTATE_MASK_HEIGHT ); pImp->aWinState = GetWindowState( nMask ); GetBindings().GetWorkWindow_Impl()->ConfigChild_Impl( SFX_CHILDWIN_DOCKINGWINDOW, SFX_ALIGNDOCKINGWINDOW, pImp->pMgr->GetType() ); } + return 0; } + //------------------------------------------------------------------------- void SfxFloatingWindow::StateChanged( StateChangedType nStateChange ) { Index: source/dialog/dockwin.cxx =================================================================== RCS file: /cvs/framework/sfx2/source/dialog/dockwin.cxx,v retrieving revision 1.45 diff -u -r1.45 dockwin.cxx --- source/dialog/dockwin.cxx 10 Jul 2007 15:22:37 -0000 1.45 +++ source/dialog/dockwin.cxx 28 Dec 2007 12:58:45 -0000 @@ -1,4 +1,4 @@ -/************************************************************************* +/************************************************************************* * * OpenOffice.org - a multi-platform office productivity suite * @@ -117,14 +117,8 @@ { if ( IsFloatingMode() ) { - if( !GetFloatingWindow()->IsRollUp() ) - SetFloatingSize( GetOutputSizePixel() ); - pImp->aWinState = GetFloatingWindow()->GetWindowState(); - SfxWorkWindow *pWorkWin = pBindings->GetWorkWindow_Impl(); - SfxChildIdentifier eIdent = SFX_CHILDWIN_DOCKINGWINDOW; - if ( pImp->bSplitable ) - eIdent = SFX_CHILDWIN_SPLITWINDOW; - pWorkWin->ConfigChild_Impl( eIdent, SFX_ALIGNDOCKINGWINDOW, pMgr->GetType() ); + // start timer for saving window status information + pImp->aMoveTimer.Start(); } else { @@ -512,7 +506,6 @@ } SetAlignment( IsFloatingMode() ? SFX_ALIGN_NOALIGNMENT : pImp->GetDockAlignment() ); - pWorkWin->ConfigChild_Impl( eIdent, SFX_ALIGNDOCKINGWINDOW, pMgr->GetType() ); } //------------------------------------------------------------------------- @@ -1606,10 +1599,17 @@ } IMPL_LINK( SfxDockingWindow, TimerHdl, Timer*, EMPTYARG) +/* + 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 +*/ { pImp->aMoveTimer.Stop(); if ( IsReallyVisible() && IsFloatingMode() ) { + if( !GetFloatingWindow()->IsRollUp() ) + SetFloatingSize( GetOutputSizePixel() ); + pImp->aWinState = GetFloatingWindow()->GetWindowState(); SfxChildIdentifier eIdent = SFX_CHILDWIN_DOCKINGWINDOW; if ( pImp->bSplitable ) eIdent = SFX_CHILDWIN_SPLITWINDOW; @@ -1618,4 +1618,3 @@ } return 0; } -