From 86910c87c193345e5e36104e21b8e26790d6846d Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Mon, 15 Dec 2014 16:33:05 +0100 Subject: fdo#82614: sw: Revert "Simplify code path" This reverts commit 07c00671443f3f0a2e2e6c3a54c391f040e8fd2b. The bug is because the check of the GotoHeaderTxt() is inverted. Actually in the old code it is a bit easier to understand what is intended, even though it is more verbose, so just revert the commit. --- sw/source/uibase/shells/txtcrsr.cxx | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'sw') diff --git a/sw/source/uibase/shells/txtcrsr.cxx b/sw/source/uibase/shells/txtcrsr.cxx index 871eb5acc900..d33e34adaaf3 100644 --- a/sw/source/uibase/shells/txtcrsr.cxx +++ b/sw/source/uibase/shells/txtcrsr.cxx @@ -362,14 +362,26 @@ void SwTextShell::ExecMoveMisc(SfxRequest &rReq) break; case FN_TO_HEADER: rSh.MoveCrsr(); - if ( ( FRMTYPE_HEADER & rSh.GetFrmType(0,false) ) || rSh.GotoHeaderTxt() ) + if ( FRMTYPE_HEADER & rSh.GetFrmType(0,false) ) rSh.SttPg(); + else + { + bool bMoved = rSh.GotoHeaderTxt(); + if ( !bMoved ) + rSh.SttPg(); + } bSetRetVal = false; break; case FN_TO_FOOTER: rSh.MoveCrsr(); - if ( ( FRMTYPE_FOOTER & rSh.GetFrmType(0,false) ) || rSh.GotoFooterTxt() ) + if ( FRMTYPE_FOOTER & rSh.GetFrmType(0,false) ) rSh.EndPg(); + else + { + bool bMoved = rSh.GotoFooterTxt(); + if ( !bMoved ) + rSh.EndPg(); + } bSetRetVal = false; break; case FN_FOOTNOTE_TO_ANCHOR: -- cgit