Tag: cws_src680_oj14 User: oj Date: 2007-05-16 17:45:52+0000 Modified: dba/reportdesign/source/ui/inspection/GeometryHandler.cxx dba/reportdesign/source/ui/misc/UITools.cxx dba/reportdesign/source/ui/report/ReportSection.cxx dba/reportdesign/source/ui/report/SectionView.cxx dba/reportdesign/source/ui/report/ViewsWindow.cxx
Log: #i77287# adjust positions and rects File Changes: Directory: /dba/reportdesign/source/ui/inspection/ ================================================== File [changed]: GeometryHandler.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inspection/GeometryHandler.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +34 -10 --------------------- --- GeometryHandler.cxx 2007-05-09 13:59:49+0000 1.1.2.1 +++ GeometryHandler.cxx 2007-05-16 17:45:49+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: GeometryHandler.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:59:49 $ + * last change: $Author: oj $ $Date: 2007/05/16 17:45:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -433,16 +433,18 @@ uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY); if ( xSourceReportComponent.is() ) // check only report components { + sal_Int32 nNewValue = 0; + Value >>= nNewValue; awt::Point aAwtPoint = xSourceReportComponent->getPosition(); awt::Size aAwtSize = xSourceReportComponent->getSize(); if ( nId == PROPERTY_ID_POSITIONX ) - Value >>= aAwtPoint.X; + aAwtPoint.X = nNewValue; else if ( nId == PROPERTY_ID_POSITIONY ) - Value >>= aAwtPoint.Y; + aAwtPoint.Y = nNewValue; else if ( nId == PROPERTY_ID_HEIGHT ) - Value >>= aAwtSize.Height; + aAwtSize.Height = nNewValue; else if ( nId == PROPERTY_ID_WIDTH ) - Value >>= aAwtSize.Width; + aAwtSize.Width = nNewValue; checkPosAndSize(aAwtPoint,aAwtSize); } @@ -607,9 +609,9 @@ switch(nId) { case PROPERTY_ID_POSITIONX: - xNumericControl->setMinValue(beans::Optional<double>(sal_True,nLeftMargin / 1000.0 )); - // run through + case PROPERTY_ID_POSITIONY: case PROPERTY_ID_WIDTH: + xNumericControl->setMinValue(beans::Optional<double>(sal_True,0.0)); xNumericControl->setMaxValue(beans::Optional<double>(sal_True,double(aSize.Width - nLeftMargin - nRightMargin) / 1000.0)); { uno::Reference<report::XFixedLine> xFixedLine(m_xReportComponent,uno::UNO_QUERY); @@ -731,6 +733,16 @@ case PROPERTY_ID_DATAFIELD: return lcl_convertToFormula(_rControlValue,m_aFieldNames);//m_xFormComponentHandler->convertToPropertyValue(PropertyName, _rControlValue); break; + case PROPERTY_ID_POSITIONX: + { + aPropertyValue = m_xFormComponentHandler->convertToPropertyValue(PropertyName, _rControlValue); + sal_Int32 nPosX = 0; + aPropertyValue >>= nPosX; + uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY); + nPosX += lcl_getStyleProperty<sal_Int32>(xSourceReportComponent->getSection()->getReportDefinition(),PROPERTY_LEFTMARGIN); + aPropertyValue <<= nPosX; + } + break; case PROPERTY_ID_CHARFONTNAME: return m_xFormComponentHandler->convertToPropertyValue(PROPERTY_FONTNAME, _rControlValue); default: @@ -805,6 +817,17 @@ case PROPERTY_ID_CHARFONTNAME: aControlValue = m_xFormComponentHandler->convertToControlValue(PROPERTY_FONTNAME, _rPropertyValue, _rControlValueType); break; + case PROPERTY_ID_POSITIONX: + { + uno::Any aTemp = _rPropertyValue; + sal_Int32 nPosX = 0; + aTemp >>= nPosX; + uno::Reference< report::XReportComponent> xSourceReportComponent(m_xReportComponent,uno::UNO_QUERY); + nPosX -= lcl_getStyleProperty<sal_Int32>(xSourceReportComponent->getSection()->getReportDefinition(),PROPERTY_LEFTMARGIN); + aTemp <<= nPosX; + aControlValue = m_xFormComponentHandler->convertToControlValue(PropertyName, aTemp, _rControlValueType); + } + break; default: aControlValue = m_xFormComponentHandler->convertToControlValue(PropertyName, _rPropertyValue, _rControlValueType); } @@ -1043,8 +1066,9 @@ uno::Reference< report::XReportComponent> xReportComponent(xSection->getByIndex(i),uno::UNO_QUERY); if ( xReportComponent.is() && xReportComponent != xSourceReportComponent ) { - ::Rectangle aRect(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); - if ( aSourceRect.IsOver(aRect) ) + ::Rectangle aBoundRect(VCLPoint(xReportComponent->getPosition()),VCLSize(xReportComponent->getSize())); + ::Rectangle aRect = aSourceRect.GetIntersection(aBoundRect); + if ( !aRect.IsEmpty() && (aRect.Left() != aRect.Right() && aRect.Top() != aRect.Bottom() ) ) throw beans::PropertyVetoException(String(ModuleRes( RID_STR_OVERLAP_OTHER_CONTROL)),xSourceReportComponent); } } 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.1.2.2&r2=1.1.2.3 Delta lines: +3 -7 ------------------- --- UITools.cxx 2007-05-11 09:24:19+0000 1.1.2.2 +++ UITools.cxx 2007-05-16 17:45:49+0000 1.1.2.3 @@ -4,9 +4,9 @@ * * $RCSfile: UITools.cxx,v $ * - * $Revision: 1.1.2.2 $ + * $Revision: 1.1.2.3 $ * - * last change: $Author: oj $ $Date: 2007/05/11 09:24:19 $ + * last change: $Author: oj $ $Date: 2007/05/16 17:45:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -63,7 +63,7 @@ #define ITEMID_BRUSH 35 //#define ITEMID_CHARROTATE SID_ATTR_CHAR_ROTATED #include <svx/charscaleitem.hxx> - +#include <svx/svdpagv.hxx> #ifndef RPTUI_TOOLS_HXX #include "UITools.hxx" #endif @@ -541,10 +541,6 @@ if ( pUnoObj ) // this doesn't need to be done for shapes { Rectangle aRect = pUnoObj->GetCurrentBoundRect(); - aRect.Left() -= 1; - aRect.Top() -= 1; - aRect.Right() -= 1; - aRect.Bottom() -= 1; pOverlappedObj = isOver(aRect,_rPage,_rView,_bUnMarkedObjects,_pObj); } return pOverlappedObj; Directory: /dba/reportdesign/source/ui/report/ ============================================== File [changed]: ReportSection.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportSection.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +21 -5 -------------------- --- ReportSection.cxx 2007-05-09 13:50:41+0000 1.1.2.1 +++ ReportSection.cxx 2007-05-16 17:45:49+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: ReportSection.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:50:41 $ + * last change: $Author: oj $ $Date: 2007/05/16 17:45:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -193,8 +193,6 @@ const sal_Int32 nLeftMargin = lcl_getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN); const sal_Int32 nRightMargin = lcl_getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN); - m_pPage->SetLftBorder(nLeftMargin); - m_pPage->SetRgtBorder(nRightMargin); m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) ); // PixelToLogic(Size(0,m_pParent->getTotalHeight(this)) ).Height() } @@ -214,6 +212,7 @@ m_pPage = m_pModel->getPage(m_xSection); m_pView = new OSectionView( m_pModel.get(), this, m_pParent->getView() ); + // without the following call, no grid is painted m_pView->ShowSdrPage( m_pPage ); @@ -232,6 +231,11 @@ m_pView->SetPageVisible(); m_pView->SetApplicationDocumentColor(m_xSection->getBackColor()); + const sal_Int32 nLeftMargin = lcl_getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN); + const sal_Int32 nRightMargin = lcl_getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_RIGHTMARGIN); + m_pPage->SetLftBorder(nLeftMargin); + m_pPage->SetRgtBorder(nRightMargin); + m_pView->SetDesignMode( TRUE ); m_pView->StartListening( *m_pModel ); @@ -521,6 +525,18 @@ } else if ( _rEvent.Source == m_xSection->getReportDefinition() ) { + if ( _rEvent.PropertyName == PROPERTY_LEFTMARGIN ) + { + const sal_Int32 nLeftMargin = lcl_getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_LEFTMARGIN); + m_pPage->SetLftBorder(nLeftMargin); + //m_pView->GetSdrPageView()->SetPageOrigin(Point(nLeftMargin,0)); + } + else if ( _rEvent.PropertyName == PROPERTY_RIGHTMARGIN ) + { + const sal_Int32 nRightMargin = lcl_getStyleProperty<sal_Int32>(m_xSection->getReportDefinition(),PROPERTY_RIGHTMARGIN); + m_pPage->SetRgtBorder(nRightMargin); + } + Resize(); } } File [changed]: SectionView.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/SectionView.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +7 -5 ------------------- --- SectionView.cxx 2007-05-09 13:51:30+0000 1.1.2.1 +++ SectionView.cxx 2007-05-16 17:45:49+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: SectionView.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:51:30 $ + * last change: $Author: oj $ $Date: 2007/05/16 17:45:49 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -150,10 +150,12 @@ rWin.Update(); rWin.Invalidate(); - const DlgEdHint aHint( RPTUI_HINT_WINDOWSCROLLED ); if ( m_pReportWindow ) + { + const DlgEdHint aHint( RPTUI_HINT_WINDOWSCROLLED ); m_pReportWindow->getReportView()->Broadcast( aHint ); } + } } //------------------------------------------------------------------------------ void OSectionView::Notify( SfxBroadcaster& rBC, const SfxHint& rHint ) @@ -173,7 +175,7 @@ } //------------------------------------------------------------------------------ -void OSectionView::ObjectRemovedInAliveMode( const SdrObject* pObject ) +void OSectionView::ObjectRemovedInAliveMode( const SdrObject* _pObject ) { DBG_CHKTHIS( rpt_OSectionView,NULL); const SdrMarkList& rMarkedList = GetMarkedObjectList(); @@ -182,7 +184,7 @@ for( ULONG i = 0; i < nMark; i++ ) { SdrObject* pSdrObj = rMarkedList.GetMark(i)->GetMarkedSdrObj(); - if (pObject == pSdrObj) + if (_pObject == pSdrObj) { SdrPageView* pPgView = GetSdrPageView(); BrkAction(); File [changed]: ViewsWindow.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ViewsWindow.cxx?r1=1.1.2.1&r2=1.1.2.2 Delta lines: +16 -18 --------------------- --- ViewsWindow.cxx 2007-05-09 13:52:06+0000 1.1.2.1 +++ ViewsWindow.cxx 2007-05-16 17:45:50+0000 1.1.2.2 @@ -4,9 +4,9 @@ * * $RCSfile: ViewsWindow.cxx,v $ * - * $Revision: 1.1.2.1 $ + * $Revision: 1.1.2.2 $ * - * last change: $Author: oj $ $Date: 2007/05/09 13:52:06 $ + * last change: $Author: oj $ $Date: 2007/05/16 17:45:50 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -129,27 +129,27 @@ switch(_nControlModification) { case ControlModification::LEFT: - nXTemp += aOverlappingRect.Right() - aNewRect.Left() +1; + nXTemp += aOverlappingRect.Right() - aNewRect.Left(); bMoveAllowed = _nXMov != nXTemp; break; case ControlModification::RIGHT: - nXTemp += aOverlappingRect.Left() - aNewRect.Right() -1; + nXTemp += aOverlappingRect.Left() - aNewRect.Right(); bMoveAllowed = _nXMov != nXTemp; break; case ControlModification::TOP: - nYTemp += aOverlappingRect.Bottom() - aNewRect.Top() +1; + nYTemp += aOverlappingRect.Bottom() - aNewRect.Top(); bMoveAllowed = _nYMov != nYTemp; break; case ControlModification::BOTTOM: - nYTemp += aOverlappingRect.Top() - aNewRect.Bottom() -1; + nYTemp += aOverlappingRect.Top() - aNewRect.Bottom(); bMoveAllowed = _nYMov != nYTemp; break; case ControlModification::CENTER_HORIZONTAL: - nXTemp += aOverlappingRect.Center().X() - aNewRect.Center().X() -1; + nXTemp += aOverlappingRect.Center().X() - aNewRect.Center().X(); bMoveAllowed = _nXMov != nXTemp; break; case ControlModification::CENTER_VERTICAL: - nYTemp += aOverlappingRect.Center().Y() - aNewRect.Center().Y() -1; + nYTemp += aOverlappingRect.Center().Y() - aNewRect.Center().Y(); bMoveAllowed = _nYMov != nYTemp; break; case ControlModification::HEIGHT_GREATEST: @@ -180,9 +180,9 @@ aNewRect.Top() = aIntersectionRect.Bottom(); } } - nYTemp = aNewRect.getHeight() - 1; + nYTemp = aNewRect.getHeight(); bMoveAllowed = _nYMov != nYTemp; - nXTemp = aNewRect.getWidth() - 1; + nXTemp = aNewRect.getWidth(); bMoveAllowed = bMoveAllowed && _nXMov != nXTemp; } } @@ -871,9 +871,7 @@ { const SdrMark* pM = pView->GetSdrMarkByIndex(i); SdrObject* pObj = pM->GetMarkedSdrObj(); - const Point aOfs(pM->GetPageView()->GetPageOrigin()); Rectangle aObjRect(_bBoundRects ? pObj->GetCurrentBoundRect() : pObj->GetSnapRect()); - aObjRect.Move(aOfs.X(),aOfs.Y()); _rSortRectangles.insert(TRectangleMap::value_type(aObjRect,TRectangleMap::data_type(pObj,pView))); } } @@ -892,19 +890,19 @@ switch(_nControlModification) { case ControlModification::WIDTH_SMALLEST: - if ( _rResize.GetWidth() > aObjRect.GetWidth() ) + if ( _rResize.getWidth() > aObjRect.getWidth() ) _rResize = aObjRect; break; case ControlModification::HEIGHT_SMALLEST: - if ( _rResize.GetHeight() > aObjRect.GetHeight() ) + if ( _rResize.getHeight() > aObjRect.getHeight() ) _rResize = aObjRect; break; case ControlModification::WIDTH_GREATEST: - if ( _rResize.GetWidth() < aObjRect.GetWidth() ) + if ( _rResize.getWidth() < aObjRect.getWidth() ) _rResize = aObjRect; break; case ControlModification::HEIGHT_GREATEST: - if ( _rResize.GetHeight() < aObjRect.GetHeight() ) + if ( _rResize.getHeight() < aObjRect.getHeight() ) _rResize = aObjRect; break; } @@ -1024,7 +1022,7 @@ if ( pView == aInterSectRectIter->second.second ) { SdrObject* pPreviousObj = aInterSectRectIter->second.first; - Rectangle aIntersectRect = aTest.GetIntersection((_bBoundRects ? pPreviousObj->GetCurrentBoundRect() : pPreviousObj->GetSnapRect())); + Rectangle aIntersectRect = aTest.GetIntersection(_bBoundRects ? pPreviousObj->GetCurrentBoundRect() : pPreviousObj->GetSnapRect()); if ( !aIntersectRect.IsEmpty() ) { *pValue = aRefFun(&aIntersectRect) - aGetFun(&aObjRect); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
