summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/crsr/crsrsh.cxx34
-rw-r--r--sw/source/ui/docvw/edtwin.cxx27
-rw-r--r--sw/source/ui/shells/txtcrsr.cxx19
3 files changed, 45 insertions, 35 deletions
diff --git a/sw/source/core/crsr/crsrsh.cxx b/sw/source/core/crsr/crsrsh.cxx
index 0b78ab99c144..191d02a81807 100644
--- a/sw/source/core/crsr/crsrsh.cxx
+++ b/sw/source/core/crsr/crsrsh.cxx
@@ -675,22 +675,6 @@ int SwCrsrShell::SetCrsr( const Point &rLPt, sal_Bool bOnlyText, bool bBlock )
// same table column and not in header/footer -> back
return bRet;
- // toggle the header/footer mode if needed
- bool bInHeaderFooter = pFrm && ( pFrm->IsHeaderFrm() || pFrm->IsFooterFrm() );
- if ( bInHeaderFooter != IsHeaderFooterEdit() )
- ToggleHeaderFooterEdit();
- else
- {
- // Make sure we have the proper Header/Footer separators shown
- // as these may be changed if clicking on an empty Header/Footer
- SetShowHeaderFooterSeparator( Header, pFrm != NULL && pFrm->IsHeaderFrm( ) );
- SetShowHeaderFooterSeparator( Footer, pFrm != NULL && pFrm->IsFooterFrm( ) );
-
- // Repaint everything
- GetWin()->Invalidate();
- }
-
-
if( pBlockCrsr && bBlock )
{
pBlockCrsr->setEndPoint( rLPt );
@@ -1314,24 +1298,6 @@ void SwCrsrShell::UpdateCrsr( sal_uInt16 eFlags, sal_Bool bIdleEnd )
return; // if not then no update
}
- sal_Bool bInHeader= sal_True;
- if ( IsInHeaderFooter( &bInHeader ) )
- {
- if ( !bInHeader )
- {
- SetShowHeaderFooterSeparator( Footer, true );
- SetShowHeaderFooterSeparator( Header, false );
- }
- else
- {
- SetShowHeaderFooterSeparator( Header, true );
- SetShowHeaderFooterSeparator( Footer, false );
- }
- }
- if ( IsInHeaderFooter() != IsHeaderFooterEdit() )
- ToggleHeaderFooterEdit();
-
-
// #i27301#
SwNotifyAccAboutInvalidTextSelections aInvalidateTextSelections( *this );
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx
index 1565d13aff4e..ab08495c07e1 100644
--- a/sw/source/ui/docvw/edtwin.cxx
+++ b/sw/source/ui/docvw/edtwin.cxx
@@ -2848,8 +2848,33 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
// Repaint everything
Invalidate();
+ }
+ else
+ {
+ // Make sure we have the proper Header/Footer separators shown
+ // as these may be changed if clicking on an empty Header/Footer
+ rSh.SetShowHeaderFooterSeparator( Header, eControl == Header );
+ rSh.SetShowHeaderFooterSeparator( Footer, eControl == Footer );
- return;
+ if ( !rSh.IsHeaderFooterEdit() )
+ rSh.ToggleHeaderFooterEdit();
+
+ // Repaint everything
+ rSh.GetWin()->Invalidate();
+ }
+ }
+ else
+ {
+ if ( rSh.IsHeaderFooterEdit( ) )
+ rSh.ToggleHeaderFooterEdit( );
+ else
+ {
+ // Make sure that the separators are hidden
+ rSh.SetShowHeaderFooterSeparator( Header, false );
+ rSh.SetShowHeaderFooterSeparator( Footer, false );
+
+ // Repaint everything
+ rSh.GetWin()->Invalidate();
}
}
diff --git a/sw/source/ui/shells/txtcrsr.cxx b/sw/source/ui/shells/txtcrsr.cxx
index eb1683d9a391..d6837d4e731a 100644
--- a/sw/source/ui/shells/txtcrsr.cxx
+++ b/sw/source/ui/shells/txtcrsr.cxx
@@ -360,6 +360,25 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq)
rReq.SetReturnValue(SfxBoolItem( nSlot, bRet ));
rReq.Done();
+ sal_Bool bInHeader = sal_True;
+ if ( rSh.IsInHeaderFooter( &bInHeader ) )
+ {
+ if ( !bInHeader )
+ {
+ rSh.SetShowHeaderFooterSeparator( Footer, true );
+ rSh.SetShowHeaderFooterSeparator( Header, false );
+ }
+ else
+ {
+ rSh.SetShowHeaderFooterSeparator( Header, true );
+ rSh.SetShowHeaderFooterSeparator( Footer, false );
+ }
+
+ // Force repaint
+ rSh.GetWin()->Invalidate();
+ }
+ if ( rSh.IsInHeaderFooter() != rSh.IsHeaderFooterEdit() )
+ rSh.ToggleHeaderFooterEdit();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */