Kaydet (Commit) a6176612 authored tarafından Cédric Bosdonnat's avatar Cédric Bosdonnat

Header/Footer: Change the edition mode entering

Single click on header / footer changes the edit mode. But double click
is still needed to enter header / footer mode on objects flying on the
main body to avoid mistakenly selecting them.
üst 89aaee9a
......@@ -179,6 +179,37 @@ SfxShell* lcl_GetShellFromDispatcher( SwView& rView, TypeId nType );
DBG_NAME(edithdl)
namespace
{
bool lcl_CheckHeaderFooterClick( SwWrtShell& rSh, const Point aDocPos, sal_uInt16 nClicks )
{
bool bRet = false;
sal_Bool bOverHdrFtr = rSh.IsOverHeaderFooterPos( aDocPos );
if ( ( rSh.IsHeaderFooterEdit( ) && !bOverHdrFtr ) ||
( !rSh.IsHeaderFooterEdit() && bOverHdrFtr ) )
{
bRet = true;
// Check if there we are in a FlyFrm
Point aPt( aDocPos );
SwPaM aPam( *rSh.GetCurrentShellCursor().GetPoint() );
rSh.GetLayout()->GetCrsrOfst( aPam.GetPoint(), aPt );
const SwStartNode* pStartFly = aPam.GetPoint()->nNode.GetNode().FindFlyStartNode();
int nNbClicks = 1;
if ( pStartFly && !rSh.IsHeaderFooterEdit() )
nNbClicks = 2;
if ( nClicks == nNbClicks )
{
rSh.SwCrsrShell::SetCrsr( aDocPos );
bRet = false;
}
}
return bRet;
}
}
class SwAnchorMarker
{
SdrHdl* pHdl;
......@@ -2602,15 +2633,8 @@ void SwEditWin::MouseButtonDown(const MouseEvent& _rMEvt)
const Point aDocPos( PixelToLogic( rMEvt.GetPosPixel() ) );
sal_Bool bOverHdrFtr = rSh.IsOverHeaderFooterPos( aDocPos );
if ( ( rSh.IsHeaderFooterEdit( ) && !bOverHdrFtr ) ||
( !rSh.IsHeaderFooterEdit() && bOverHdrFtr ) )
{
if ( rMEvt.GetButtons() == MOUSE_LEFT && rMEvt.GetClicks( ) == 2 )
rSh.SwCrsrShell::SetCrsr( aDocPos );
if ( lcl_CheckHeaderFooterClick( rSh, aDocPos, rMEvt.GetClicks() ) )
return;
}
if ( IsChainMode() )
{
......@@ -4673,6 +4697,11 @@ void SwEditWin::Command( const CommandEvent& rCEvt )
if (rView.GetPostItMgr()->IsHit(rCEvt.GetMousePosPixel()))
return;
if ( lcl_CheckHeaderFooterClick( rSh,
PixelToLogic( rCEvt.GetMousePosPixel() ), 1 ) )
return;
if((!pChildWin || pChildWin->GetView() != &rView) &&
!rSh.IsDrawCreate() && !IsDrawAction())
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment