Tag: cws_src680_oj14 User: oj Date: 2007-05-11 09:23:54+0000 Log: #i77036# check overlapping
File Changes: Directory: /dba/reportdesign/source/ui/report/ ============================================== File [changed]: dlgedfunc.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/dlgedfunc.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +40 -9 -------------------- --- dlgedfunc.cxx 2007-05-09 13:52:43+0000 1.1.2.1 +++ dlgedfunc.cxx 2007-05-11 09:23:51+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: dlgedfunc.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:52:43 $ + * last change: $Author: oj $ $Date: 2007/05/11 09:23:51 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -85,7 +85,7 @@ #include <svx/svditer.hxx> #endif - +#define DEFAUL_MOVE_SIZE 100 namespace rptui { using namespace ::com::sun::star; @@ -252,7 +252,7 @@ if ( pHdl ) { Point aHdlPosition( pHdl->GetPos() ); - Rectangle aVisRect( aHdlPosition - Point( 100, 100 ), Size( 200, 200 ) ); + Rectangle aVisRect( aHdlPosition - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) ); pView->MakeVisible( aVisRect, *pParent); } @@ -282,15 +282,15 @@ if ( _rCode.IsMod2() ) { // move in 1 pixel distance - const Size aPixelSize = pParent? pParent->PixelToLogic( Size( 1, 1 ) ) : Size( 100, 100 ); + const Size aPixelSize = pParent? pParent->PixelToLogic( Size( 1, 1 ) ) : Size( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ); nX *= aPixelSize.Width(); nY *= aPixelSize.Height(); } else { // move in 1 mm distance - nX *= 100; - nY *= 100; + nX *= DEFAUL_MOVE_SIZE; + nY *= DEFAUL_MOVE_SIZE; } const SdrHdlList& rHdlList = pView->GetHdlList(); @@ -365,6 +365,37 @@ if ( bWasSnapEnabled ) pView->SetSnapEnabled( FALSE ); + Rectangle aNewRect; + bool bCheck = false; + const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + for (sal_uInt32 i = 0; !bCheck && i < rMarkList.GetMarkCount();++i ) + { + SdrMark* pMark = rMarkList.GetMark(i); + bCheck = dynamic_cast<OUnoObject*>(pMark->GetMarkedSdrObj()) != NULL; + if ( bCheck ) + aNewRect.Union(pMark->GetMarkedSdrObj()->GetLastBoundRect()); + } + + switch(pHdl->GetKind()) + { + case HDL_LEFT: + case HDL_UPLFT: + case HDL_LWLFT: + case HDL_UPPER: + aNewRect.Left() += nX; + aNewRect.Top() += nY; + break; + case HDL_UPRGT: + case HDL_RIGHT: + case HDL_LWRGT: + case HDL_LOWER: + aNewRect.setWidth(aNewRect.getWidth() + nX); + aNewRect.setHeight(aNewRect.getHeight() + nY); + break; + default: + break; + } + if ( !(bCheck && isOver(aNewRect,*pParent->getPage(),*pView)) ) pView->MovAction( aEndPoint ); pView->EndDragObj(); @@ -376,7 +407,7 @@ } // make moved handle visible - const Rectangle aVisRect( aEndPoint - Point( 100, 100 ), Size( 200, 200 ) ); + const Rectangle aVisRect( aEndPoint - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) ); pView->MakeVisible( aVisRect, *pParent); } } --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
