User: rt Date: 2008-01-29 13:50:23+0000 Modified: dba/reportdesign/source/ui/misc/UITools.cxx
Log: INTEGRATION: CWS reportdesign02 (1.2.44); FILE MERGED 2007/12/20 07:47:47 oj 1.2.44.2: merge change 2007/10/30 06:56:28 oj 1.2.44.1: #i78939# change pos and size when control is outside page File Changes: Directory: /dba/reportdesign/source/ui/misc/ ============================================ File [changed]: UITools.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/misc/UITools.cxx?r1=1.2&r2=1.3 Delta lines: +29 -4 -------------------- --- UITools.cxx 2007-07-09 11:56:32+0000 1.2 +++ UITools.cxx 2008-01-29 13:50:20+0000 1.3 @@ -70,6 +70,8 @@ #include <svx/charscaleitem.hxx> #include <svx/algitem.hxx> #include <svx/svdpagv.hxx> +#include <toolkit/helper/convert.hxx> +#include "SectionView.hxx" #ifndef RPTUI_TOOLS_HXX #include "UITools.hxx" #endif @@ -865,7 +867,30 @@ return aNames; } - +// ----------------------------------------------------------------------------- +// check overlapping +void correctOverlapping(SdrObject* pControl,::boost::shared_ptr<OReportSection> _pReportSection,bool _bInsert) +{ + OSectionView* pSectionView = _pReportSection->getView(); + uno::Reference< report::XReportComponent> xComponent(pControl->getUnoShape(),uno::UNO_QUERY); + Rectangle aRet(VCLPoint(xComponent->getPosition()),VCLSize(xComponent->getSize())); + aRet.setHeight(aRet.getHeight() + 1); + aRet.setWidth(aRet.getWidth() + 1); + bool bOverlapping = true; + while ( bOverlapping ) + { + SdrObject* pOverlappedObj = isOver(aRet,*_pReportSection->getPage(),*pSectionView,true,pControl); + bOverlapping = pOverlappedObj != NULL; + if ( bOverlapping ) + { + const Rectangle& aLogicRect = pOverlappedObj->GetLogicRect(); + aRet.Move(0,aLogicRect.Top() + aLogicRect.getHeight() - aRet.Top()); + xComponent->setPositionY(aRet.Top()); + } + } + if ( !bOverlapping && _bInsert ) // now insert objects + pSectionView->InsertObjectAtView(pControl,*pSectionView->GetSdrPageView(),SDRINSERT_ADDMARK); +} // ----------------------------------------------------------------------------- } // namespace rptui // ----------------------------------------------------------------------------- --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
