diff options
author | Jan Holesovsky <kendy@suse.cz> | 2010-10-13 11:45:37 +0200 |
---|---|---|
committer | Jan Holesovsky <kendy@suse.cz> | 2010-10-13 11:45:37 +0200 |
commit | 9eaf48aa1a5235c016a70739f2c8c57d3645c45a (patch) | |
tree | 961f9b6bb9f189067e0ee4ff25821d68e8871b2c /sw/source/ui/docvw/edtwin.cxx | |
parent | 4fa761a1a0f3fa47f26e684462a4f6cc75b2a71c (diff) | |
parent | c0be68452261575069d0192bfe722c8b398d9973 (diff) |
Merge commit 'ooo/OOO330_m10'
Diffstat (limited to 'sw/source/ui/docvw/edtwin.cxx')
-rw-r--r-- | sw/source/ui/docvw/edtwin.cxx | 47 |
1 files changed, 43 insertions, 4 deletions
diff --git a/sw/source/ui/docvw/edtwin.cxx b/sw/source/ui/docvw/edtwin.cxx index 29e93b55690e..736ea43f6b19 100644 --- a/sw/source/ui/docvw/edtwin.cxx +++ b/sw/source/ui/docvw/edtwin.cxx @@ -191,15 +191,51 @@ class SwAnchorMarker SdrHdl* pHdl; Point aHdlPos; Point aLastPos; + // --> OD 2010-09-16 #i114522# + bool bTopRightHandle; + // <-- public: - SwAnchorMarker( SdrHdl* pH ) : - pHdl( pH ), aHdlPos( pH->GetPos() ), aLastPos( pH->GetPos() ) {} + SwAnchorMarker( SdrHdl* pH ) + : pHdl( pH ) + , aHdlPos( pH->GetPos() ) + , aLastPos( pH->GetPos() ) + // --> OD 2010-09-16 #i114522# + , bTopRightHandle( pH->GetKind() == HDL_ANCHOR_TR ) + // <-- + {} const Point& GetLastPos() const { return aLastPos; } void SetLastPos( const Point& rNew ) { aLastPos = rNew; } void SetPos( const Point& rNew ) { pHdl->SetPos( rNew ); } const Point& GetPos() { return pHdl->GetPos(); } const Point& GetHdlPos() { return aHdlPos; } - void ChgHdl( SdrHdl* pNew ) { pHdl = pNew; } + void ChgHdl( SdrHdl* pNew ) + { + pHdl = pNew; + // --> OD 2010-09-16 #i114522# + if ( pHdl ) + { + bTopRightHandle = (pHdl->GetKind() == HDL_ANCHOR_TR); + } + // <-- + } + // --> OD 2010-09-16 #i114522# + const Point GetPosForHitTest( const OutputDevice& rOut ) + { + Point aHitTestPos( GetPos() ); + aHitTestPos = rOut.LogicToPixel( aHitTestPos ); + if ( bTopRightHandle ) + { + aHitTestPos += Point( -1, 1 ); + } + else + { + aHitTestPos += Point( 1, 1 ); + } + aHitTestPos = rOut.PixelToLogic( aHitTestPos ); + + return aHitTestPos; + } + // <-- }; struct QuickHelpData @@ -3607,7 +3643,10 @@ void SwEditWin::MouseMove(const MouseEvent& _rMEvt) // So the pAnchorMarker has to find the right SdrHdl, if it's // the old one, it will find it with position aOld, if this one // is destroyed, it will find a new one at position GetHdlPos(). - Point aOld = pAnchorMarker->GetPos(); + // --> OD 2010-09-16 #i114522# +// const Point aOld = pAnchorMarker->GetPos(); + const Point aOld = pAnchorMarker->GetPosForHitTest( *(rSh.GetOut()) ); + // <-- Point aNew = rSh.FindAnchorPos( aDocPt ); SdrHdl* pHdl; if( (0!=( pHdl = pSdrView->PickHandle( aOld ) )|| |