diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-09-16 17:03:35 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-09-16 17:07:30 +0200 |
commit | 403305d593f98ea3af26dd48b3f342044efe9454 (patch) | |
tree | 31cee80806f905a2213c0e6e5f23e43598b50b60 /sw | |
parent | 363591e7542232088606b8da6e55850b6c84c079 (diff) |
Header/Footer: Don't hide & show the separator windows all the time
This avoids permanent calls to the SwHeaderFooterWin::Paint method. The
loop is now broken and the cursor doesn't blink anymore.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/inc/viewsh.hxx | 2 | ||||
-rwxr-xr-x | sw/source/core/layout/paintfrm.cxx | 8 | ||||
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 3 | ||||
-rw-r--r-- | sw/source/ui/inc/wrtsh.hxx | 1 | ||||
-rw-r--r-- | sw/source/ui/wrtsh/wrtsh1.cxx | 7 |
5 files changed, 11 insertions, 10 deletions
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx index 8c2cab872725..241fb17b8e3e 100644 --- a/sw/inc/viewsh.hxx +++ b/sw/inc/viewsh.hxx @@ -568,7 +568,7 @@ public: void ToggleHeaderFooterEdit( ); sal_Bool IsHeaderFooterEdit( ) const { return bHeaderFooterEdit; } sal_Bool IsShowHeaderFooterSeparator( ) { return bShowHeaderFooterSeparator; } - void SetShowHeaderFooterSeparator( sal_Bool bShow ) { bShowHeaderFooterSeparator = bShow; } + virtual void SetShowHeaderFooterSeparator( sal_Bool bShow ) { bShowHeaderFooterSeparator = bShow; } }; //---- class CurrShell manages global ShellPointer ------------------- diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index 9fa4aae31d90..d923b551b1d0 100755 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2782,14 +2782,6 @@ SwRootFrm::Paint(SwRect const& rRect, SwPrintData const*const pPrintData) const else SwRootFrm::bInPaint = bResetRootPaint = sal_True; - SwWrtShell* pWrtSh = dynamic_cast< SwWrtShell* >( pSh ); - if ( pWrtSh ) - { - SwEditWin& rEditWin = pWrtSh->GetView().GetEditWin(); - rEditWin.HideHeaderFooterControls( ); - } - - SwSavePaintStatics *pStatics = 0; if ( pGlobalShell ) pStatics = new SwSavePaintStatics(); diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 50f7f05d50b4..f2e2e894b331 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -5779,7 +5779,8 @@ void SwEditWin::SetHeaderFooterControl( const SwPageFrm* pPageFrm, bool bHeader, } pControl->SetOffset( aOffset ); - pControl->Show( ); + if ( !pControl->IsVisible() ) + pControl->Show( ); } void SwEditWin::RemoveHeaderFooterControls( const SwPageFrm* pPageFrm ) diff --git a/sw/source/ui/inc/wrtsh.hxx b/sw/source/ui/inc/wrtsh.hxx index 735848f73626..7d0bbfd0e2e1 100644 --- a/sw/source/ui/inc/wrtsh.hxx +++ b/sw/source/ui/inc/wrtsh.hxx @@ -486,6 +486,7 @@ typedef sal_Bool (SwWrtShell:: *FNSimpleMove)(); const SwRedline* GotoRedline( sal_uInt16 nArrPos, sal_Bool bSelect = sal_False); void ChangeHeaderOrFooter(const String& rStyleName, sal_Bool bHeader, sal_Bool bOn, sal_Bool bShowWarning); + virtual void SetShowHeaderFooterSeparator( sal_Bool bShow ); private: diff --git a/sw/source/ui/wrtsh/wrtsh1.cxx b/sw/source/ui/wrtsh/wrtsh1.cxx index ec03fe41cd29..ec54dc271f0a 100644 --- a/sw/source/ui/wrtsh/wrtsh1.cxx +++ b/sw/source/ui/wrtsh/wrtsh1.cxx @@ -1890,4 +1890,11 @@ void SwWrtShell::ChangeHeaderOrFooter( EndAllAction(); } +void SwWrtShell::SetShowHeaderFooterSeparator( sal_Bool bShow ) +{ + ViewShell::SetShowHeaderFooterSeparator( bShow ); + if ( !bShow ) + GetView().GetEditWin().HideHeaderFooterControls( ); +} + /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |