diff options
author | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-09-16 10:03:22 +0200 |
---|---|---|
committer | Cédric Bosdonnat <cedric.bosdonnat.ooo@free.fr> | 2011-09-16 17:07:04 +0200 |
commit | a9904f07de04dbfb2f81ac44ebb4caa88c16c6c1 (patch) | |
tree | d18605ee4055b3e9522e1ca58a4ba4c9afa10f9f /sw | |
parent | Revert "Trying to chop out the uwinapi library" (diff) | |
download | core-a9904f07de04dbfb2f81ac44ebb4caa88c16c6c1.tar.gz core-a9904f07de04dbfb2f81ac44ebb4caa88c16c6c1.zip |
Header/Footer: enable quickly hiding the separators
After having triggered the separators using a mouse-over, hide the
separator when clicking in the main body or typing.
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 5ea839e810df..f69d2a8a5682 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -1302,6 +1302,13 @@ void SwEditWin::KeyInput(const KeyEvent &rKEvt) { SwWrtShell &rSh = rView.GetWrtShell(); + // Hide the header/footer separator if not editing a header of footer + if ( rSh.IsShowHeaderFooterSeparator( ) && !rSh.IsHeaderFooterEdit() ) + { + rSh.SetShowHeaderFooterSeparator( sal_False ); + aOverHeaderFooterTimer.Stop(); + } + if( rKEvt.GetKeyCode().GetCode() == KEY_ESCAPE && pApplyTempl && pApplyTempl->pFormatClipboard ) { @@ -2619,6 +2626,23 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt) { SwWrtShell &rSh = rView.GetWrtShell(); + // Hide the header/footer separator if not editing a header of footer + if ( rSh.IsShowHeaderFooterSeparator( ) && !rSh.IsHeaderFooterEdit() ) + { + const Point aDocPt( PixelToLogic( _rMEvt.GetPosPixel() ) ); + const SwPageFrm* pPageFrm = rSh.GetLayout()->GetPageAtPos( aDocPt ); + if ( pPageFrm ) + { + bool bOverHeadFoot = pPageFrm->IsOverHeaderFooterArea( aDocPt ); + + if ( !bOverHeadFoot ) + { + rSh.SetShowHeaderFooterSeparator( sal_False ); + aOverHeaderFooterTimer.Stop(); + } + } + } + // We have to check if a context menu is shown and we have an UI // active inplace client. In that case we have to ignore the mouse // button down event. Otherwise we would crash (context menu has been |