Tag: cws_src680_reportdesign02 User: lla Date: 2007-11-26 06:24:47+0000 Modified: dba/reportdesign/inc/RptPage.hxx dba/reportdesign/source/core/sdr/RptPage.cxx dba/reportdesign/source/ui/inc/ViewsWindow.hxx dba/reportdesign/source/ui/inc/dlgedfunc.hxx dba/reportdesign/source/ui/report/ReportSection.cxx dba/reportdesign/source/ui/report/ViewsWindow.cxx dba/reportdesign/source/ui/report/dlgedfunc.cxx dba/reportdesign/util/defs/wntmsci10
Log: #i80260# drag n drop, lines over all sections, no ctrl key need to move obj in different section File Changes: Directory: /dba/reportdesign/inc/ ================================= File [changed]: RptPage.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/inc/RptPage.hxx?r1=1.2&r2=1.2.44.1 Delta lines: +14 -2 -------------------- --- RptPage.hxx 2007-07-09 11:56:02+0000 1.2 +++ RptPage.hxx 2007-11-26 06:24:43+0000 1.2.44.1 @@ -4,9 +4,9 @@ * * $RCSfile: RptPage.hxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.2.44.1 $ * - * last change: $Author: rt $ $Date: 2007/07/09 11:56:02 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:43 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -62,6 +62,13 @@ m_xSection; OReportPage(const OReportPage&); + + bool m_bSpecialInsertMode; + std::vector<SdrObject*> m_aTemporaryObjectList; + // methode to remove temporary objects, created by 'special mode' + // (BegDragObj) + void removeTempObject(SdrObject *_pToRemoveObj); + protected: virtual ::com::sun::star::uno::Reference< ::com::sun::star::uno::XInterface > createUnoPage(); public: @@ -89,6 +96,11 @@ */ void removeSdrObject(const ::com::sun::star::uno::Reference< ::com::sun::star::report::XReportComponent >& _xObject); + void setSpecialMode() {m_bSpecialInsertMode = true;} + bool getSpecialMode() {return m_bSpecialInsertMode;} + // all temporary objects will remove and destroy + void resetSpecialMode(); + /** insert a new SdrObject which belongs to the report component. @param _xObject the report component */ Directory: /dba/reportdesign/source/core/sdr/ ============================================= File [changed]: RptPage.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/RptPage.cxx?r1=1.3&r2=1.3.36.1 Delta lines: +46 -4 -------------------- --- RptPage.cxx 2007-08-03 09:55:28+0000 1.3 +++ RptPage.cxx 2007-11-26 06:24:43+0000 1.3.36.1 @@ -4,9 +4,9 @@ * * $RCSfile: RptPage.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.3.36.1 $ * - * last change: $Author: hr $ $Date: 2007/08/03 09:55:28 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:43 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -68,6 +68,7 @@ :SdrPage( _rModel, bMasterPage ) ,rModel(_rModel) ,m_xSection(_xSection) + ,m_bSpecialInsertMode(false) { DBG_CTOR( rpt_OReportPage,NULL); } @@ -134,6 +135,11 @@ SdrObject* OReportPage::RemoveObject(ULONG nObjNum) { SdrObject* pObj = SdrPage::RemoveObject(nObjNum); + if (getSpecialMode()) + { + return pObj; + } + // this code is evil, but what else shall I do reportdesign::OSection* pSection = reportdesign::OSection::getImplementation(m_xSection); uno::Reference< drawing::XShape> xShape(pObj->getUnoShape(),uno::UNO_QUERY); @@ -190,11 +196,47 @@ return static_cast<cppu::OWeakObject*>( new reportdesign::OReportDrawPage(this,m_xSection) ); } // ----------------------------------------------------------------------------- +void OReportPage::removeTempObject(SdrObject *_pToRemoveObj) +{ + if (_pToRemoveObj) + { + for (ULONG i=0;i<GetObjCount();i++) + { + SdrObject *aObj = GetObj(i); + if (aObj && aObj == _pToRemoveObj) + { + SdrObject* pObject = RemoveObject(i); + (void)pObject; + // delete pObject; + } + } + } +} + +void OReportPage::resetSpecialMode() +{ + vector<SdrObject*>::iterator aIter = m_aTemporaryObjectList.begin(); + vector<SdrObject*>::iterator aEnd = m_aTemporaryObjectList.end(); + + for (; aIter != aEnd; ++aIter) + { + removeTempObject(*aIter); + } + + m_bSpecialInsertMode = false; +} +// ----------------------------------------------------------------------------- void OReportPage::NbcInsertObject(SdrObject* pObj, ULONG nPos, const SdrInsertReason* pReason) { SdrPage::NbcInsertObject(pObj, nPos, pReason); OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >( pObj ); + if (getSpecialMode()) + { + m_aTemporaryObjectList.push_back(pObj); + return; + } + if ( pUnoObj ) { pUnoObj->CreateMediator(); Directory: /dba/reportdesign/source/ui/inc/ =========================================== File [changed]: ViewsWindow.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/ViewsWindow.hxx?r1=1.4&r2=1.4.36.1 Delta lines: +14 -5 -------------------- --- ViewsWindow.hxx 2007-08-03 10:01:53+0000 1.4 +++ ViewsWindow.hxx 2007-11-26 06:24:44+0000 1.4.36.1 @@ -6,9 +6,9 @@ * * $RCSfile: ViewsWindow.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.36.1 $ * - * last change: $Author: hr $ $Date: 2007/08/03 10:01:53 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -320,8 +320,16 @@ */ void BrkAction(); void BegMarkObj(const Point& _aPnt,const OSectionView* _pSection); + private: + void BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _aRect, const OSectionView* _pSection); + void EndDragObj_removeInvisibleObjects(); + Point m_aDragDelta; + ::std::vector<SdrObject*> m_aBegDragTempList; + bool isObjectInMyTempList(SdrObject *); + public: void BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection); void EndDragObj(BOOL _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt); + void EndAction(); void ForceMarkedToAnotherPage(); BOOL IsAction() const; @@ -337,7 +345,8 @@ */ OSectionView* getSectionRelativeToPosition(const OSectionView* _pSection,Point& _rPnt); - void MovAction(const Point& rPnt,const OSectionView* _pSection,bool _bMove = true); + void MovAction(const Point& rPnt,const OSectionView* _pSection,bool _bMove /*= true */); + // void MovAction2(const Point& rPnt,const OSectionView* _pSection); void setPoint(const Point& _aPnt); inline Point getPoint() const { return m_aPoint; } File [changed]: dlgedfunc.hxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/dlgedfunc.hxx?r1=1.4&r2=1.4.36.1 Delta lines: +5 -5 ------------------- --- dlgedfunc.hxx 2007-08-03 12:44:57+0000 1.4 +++ dlgedfunc.hxx 2007-11-26 06:24:44+0000 1.4.36.1 @@ -6,9 +6,9 @@ * * $RCSfile: dlgedfunc.hxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.36.1 $ * - * last change: $Author: hr $ $Date: 2007/08/03 12:44:57 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -59,8 +59,8 @@ DlgEdFunc(const DlgEdFunc&); void operator =(const DlgEdFunc&); protected: - OReportSection* pParent; - OSectionView* pView; + OReportSection* m_pParent; + OSectionView* m_pView; Timer aScrollTimer; Point m_aMDPos; 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.5.18.1&r2=1.5.18.2 Delta lines: +5 -2 ------------------- --- ReportSection.cxx 2007-10-30 06:56:29+0000 1.5.18.1 +++ ReportSection.cxx 2007-11-26 06:24:44+0000 1.5.18.2 @@ -4,9 +4,9 @@ * * $RCSfile: ReportSection.cxx,v $ * - * $Revision: 1.5.18.1 $ + * $Revision: 1.5.18.2 $ * - * last change: $Author: oj $ $Date: 2007/10/30 06:56:29 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -274,6 +274,9 @@ m_pPage->SetLftBorder(nLeftMargin); m_pPage->SetRgtBorder(nRightMargin); +// LLA: TODO +// m_pPage->SetUppBorder(-10000); + m_pView->SetDesignMode( TRUE ); m_pView->StartListening( *m_pModel ); File [changed]: ViewsWindow.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ViewsWindow.cxx?r1=1.5.10.3&r2=1.5.10.4 Delta lines: +253 -49 ---------------------- --- ViewsWindow.cxx 2007-11-08 13:06:04+0000 1.5.10.3 +++ ViewsWindow.cxx 2007-11-26 06:24:44+0000 1.5.10.4 @@ -4,9 +4,9 @@ * * $RCSfile: ViewsWindow.cxx,v $ * - * $Revision: 1.5.10.3 $ + * $Revision: 1.5.10.4 $ * - * last change: $Author: oj $ $Date: 2007/11/08 13:06:04 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -753,6 +753,13 @@ break; } } + + // remove special insert mode + for (aIter = m_aSections.begin();aIter != aEnd ; ++aIter) + { + ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; + pReportSection->getPage()->resetSpecialMode(); + } } } //------------------------------------------------------------------------------ @@ -1167,7 +1174,7 @@ eForceToAnotherPage, eBreakAction }; - struct ApplySectionViewAction : public ::std::unary_function< OViewsWindow::TSectionsMap::value_type, void > + class ApplySectionViewAction : public ::std::unary_function< OViewsWindow::TSectionsMap::value_type, void > { private: SectionViewAction m_eAction; @@ -1184,16 +1191,28 @@ OSectionView& rView( *_rhs.first.first->getView() ); switch ( m_eAction ) { - case eEndDragObj: rView.EndDragObj( m_bCopy ); break; - case eEndAction: if ( rView.IsAction() ) + case eEndDragObj: + rView.EndDragObj( m_bCopy ); + break; + case eEndAction: + if ( rView.IsAction() ) rView.EndAction ( ); break; - case eMoveAction: rView.MovAction ( m_aPoint ); break; - case eMarkAction: rView.BegMarkObj ( m_aPoint ); break; - case eForceToAnotherPage: rView.ForceMarkedToAnotherPage(); break; - case eBreakAction: if ( rView.IsAction() ) + case eMoveAction: + rView.MovAction ( m_aPoint ); + break; + case eMarkAction: + rView.BegMarkObj ( m_aPoint ); + break; + case eForceToAnotherPage: + rView.ForceMarkedToAnotherPage(); + break; + case eBreakAction: + if ( rView.IsAction() ) rView.BrkAction ( ); break; + // default: + } } }; @@ -1201,28 +1220,169 @@ // ----------------------------------------------------------------------------- void OViewsWindow::BrkAction() { + EndDragObj_removeInvisibleObjects(); ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction(eBreakAction) ); } // ----------------------------------------------------------------------------- +void OViewsWindow::BegDragObj_createInvisibleObjectAtPosition(const Rectangle& _aRect, const OSectionView* _pSection) +{ + TSectionsMap::iterator aIter = m_aSections.begin(); + TSectionsMap::iterator aEnd = m_aSections.end(); + Point aNewPos(0,0); + + for (; aIter != aEnd; ++aIter) + { + ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; + pReportSection->getPage()->setSpecialMode(); + OSectionView* pView = pReportSection->getView(); + + if ( pView != _pSection ) + { +// SdrRectObj *pNewObj = new SdrRectObj(OBJ_RECT, _aRect); +// SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Temp Label"))); + SdrObject *pNewObj = new SdrUnoObj(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.form.component.FixedText"))); + if (pNewObj) + { + pNewObj->SetLogicRect(_aRect); + // pNewObj->SetSize(_aRect.GetSize()); + // pNewObj->Move(Size(_aRect.Left(), _aRect.Top())); + + pNewObj->Move(Size(0, aNewPos.Y())); + pReportSection->getPage()->InsertObject(pNewObj); + m_aBegDragTempList.push_back(pNewObj); + Rectangle aRect = pNewObj->GetLogicRect(); + + // pNewObj->SetText(String::CreateFromAscii("Drag helper")); + pView->MarkObj( pNewObj, pView->GetSdrPageView() ); + } + } + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + aNewPos.Y() -= nSectionHeight; +// aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); + } +} +// ----------------------------------------------------------------------------- +bool OViewsWindow::isObjectInMyTempList(SdrObject *_pObj) +{ + ::std::vector<SdrObject*>::iterator aIter = m_aBegDragTempList.begin(); + ::std::vector<SdrObject*>::iterator aEnd = m_aBegDragTempList.end(); + for (; aIter != aEnd; ++aIter) + { + if (*aIter == _pObj) + { + return true; + } + } + return false; +} + +// ----------------------------------------------------------------------------- void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl,const OSectionView* _pSection) { - const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width()); - Point aNewPos = _aPnt; - /*if ( _pHdl ) - aNewPos = _pHdl->GetPos();*/ + OSL_TRACE("BegDragObj Clickpoint X:%d Y:%d\n", _aPnt.X(), _aPnt.Y() ); + + m_aBegDragTempList.clear(); + + // Calculate the absolute clickpoint in the views + Point aAbsolutePnt = _aPnt; TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); - /*for (; aIter != aEnd; ++aIter) + for (; aIter != aEnd; ++aIter) { ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; - if ( pReportSection->getView() == _pSection ) + OSectionView* pView = pReportSection->getView(); + if (pView == _pSection) break; - aNewPos.Y() += pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); - }*/ + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + aAbsolutePnt.Y() += nSectionHeight; + } + m_aDragDelta = Point(SAL_MAX_INT32, SAL_MAX_INT32); + OSL_TRACE("BegDragObj Absolute X:%d Y:%d\n", aAbsolutePnt.X(), aAbsolutePnt.Y() ); + + // Create drag lines over all viewable Views + // Therefore we need to identify the marked objects + // and create temporary objects on all other views at the same position + // relative to its occurance. + + OSL_TRACE("BegDragObj createInvisible Objects\n" ); + int nViewCount = 0; + Point aNewObjPos(0,0); + for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) + { + ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; + + OSectionView* pView = pReportSection->getView(); + + if ( pView->AreObjectsMarked() ) + { + const sal_uInt32 nCount = pView->GetMarkedObjectCount(); + for (sal_uInt32 i=0; i < nCount; ++i) + { + const SdrMark* pM = pView->GetSdrMarkByIndex(i); + SdrObject* pObj = pM->GetMarkedSdrObj(); + if (!isObjectInMyTempList(pObj)) + { + Rectangle aRect( pObj->GetCurrentBoundRect() ); + aRect.Move(0, aNewObjPos.Y()); + OSL_TRACE("BegDragObj createInvisible X:%d Y:%d on View #%d\n", aRect.Left(), aRect.Top(), nViewCount ); + + BegDragObj_createInvisibleObjectAtPosition(aRect, pView); + + // calculate the clickpoint + sal_Int32 nDeltaX = abs(aRect.Left() - aAbsolutePnt.X()); + sal_Int32 nDeltaY = abs(aRect.Top() - aAbsolutePnt.Y()); + if (m_aDragDelta.X() > nDeltaX) + m_aDragDelta.X() = nDeltaX; + if (m_aDragDelta.Y() > nDeltaY) + m_aDragDelta.Y() = nDeltaY; + } + } + } + ++nViewCount; + Rectangle aClipRect = pView->GetWorkArea(); + aClipRect.Top() = -aNewObjPos.Y(); + pView->SetWorkArea( aClipRect ); + + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + aNewObjPos.Y() += nSectionHeight; + + // don't subtract the height of the lines between the views + // aNewObjPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); + } + + Point aNewPos = aAbsolutePnt; + // for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) + // { + // ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; + // if ( pReportSection->getView() == _pSection ) + // break; + // aNewPos.Y() += pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + // } + const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width()); + // long nLastSectionHeight = 0; + // bool bAdd = true; + nViewCount = 0; for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) { ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; + + // if ( pReportSection->getView() == _pSection ) + // { + // bAdd = false; + // aNewPos = _aPnt; + // } + // else if ( bAdd ) + // { + // const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + // aNewPos.Y() += nSectionHeight; + // } + // else + // { + // aNewPos.Y() -= nLastSectionHeight; + // } + + //? SdrHdl* pHdl = _pHdl; if ( pHdl ) { @@ -1232,8 +1392,13 @@ pHdl = rHdlList.GetHdl(_pHdl->GetKind()); } } - pReportSection->getView()->BegDragObj(aNewPos, (OutputDevice*)NULL, pHdl, nDrgLog,NULL); - //aNewPos.Y() -= pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + OSL_TRACE("BegDragObj X:%d Y:%d on View#%d\n", aNewPos.X(), aNewPos.Y(), nViewCount++ ); + pReportSection->getView()->BegDragObj(aNewPos, (OutputDevice*)NULL, pHdl, nDrgLog, NULL); + + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + aNewPos.Y() -= nSectionHeight; + // subtract the height between the views, because they are visible but not from interest here. + aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } } @@ -1246,28 +1411,32 @@ void OViewsWindow::BegMarkObj(const Point& _aPnt,const OSectionView* _pSection) { bool bAdd = true; - Point aNewPos = _aPnt; + TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); + long nLastSectionHeight = 0; for (; aIter != aEnd; ++aIter) { ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; - const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); if ( pReportSection->getView() == _pSection ) { bAdd = false; - aNewPos = _aPnt; + aNewPos = _aPnt; // 2,2 } else if ( bAdd ) { + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); aNewPos.Y() += nSectionHeight; } else { - aNewPos.Y() -= nSectionHeight; + aNewPos.Y() -= nLastSectionHeight; } pReportSection->getView()->BegMarkObj ( aNewPos ); + nLastSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + + aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } //::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( _aPnt , eMarkAction) ); } @@ -1319,14 +1488,35 @@ return pSection; } // ----------------------------------------------------------------------------- -void OViewsWindow::EndDragObj(BOOL _bDragIntoNewSection,const OSectionView* _pSection,const Point& _aPnt) +void OViewsWindow::EndDragObj_removeInvisibleObjects() +{ + TSectionsMap::iterator aIter = m_aSections.begin(); + TSectionsMap::iterator aEnd = m_aSections.end(); + + for (; aIter != aEnd; ++aIter) + { + ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; + pReportSection->getPage()->resetSpecialMode(); + } +} +// ----------------------------------------------------------------------------- +void OViewsWindow::EndDragObj(BOOL _bControlKeyPressed, const OSectionView* _pSection,const Point& _aPnt) { const String sUndoAction = String((ModuleRes(RID_STR_UNDO_CHANGEPOSITION))); UndoManagerListAction aListAction(*getView()->getReportView()->getController()->getUndoMgr(),sUndoAction); - if ( _bDragIntoNewSection ) - { + Point aNewPos = _aPnt; - OSectionView* pInSection = getSectionRelativeToPosition(_pSection,aNewPos); + OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aNewPos); + if (!_bControlKeyPressed && _pSection != pInSection) + { + EndDragObj_removeInvisibleObjects(); + + // we need to manipulate the current clickpoint, we substract the old delta from BeginDrag + // OSectionView* pInSection = getSectionRelativeToPosition(_pSection, aPnt); + // aNewPos.X() -= m_aDragDelta.X(); + // aNewPos.Y() -= m_aDragDelta.Y(); + aNewPos -= m_aDragDelta; + uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects; TSectionsMap::iterator aIter = m_aSections.begin(); const TSectionsMap::iterator aEnd = m_aSections.end(); @@ -1363,6 +1553,7 @@ { uno::Reference< report::XReportComponent> xRC(*pColIter,uno::UNO_QUERY); aPrevious = VCLPoint(xRC->getPosition()); + awt::Size aSize = xRC->getSize(); if ( aNewPos.X() < nLeftMargin ) aNewPos.X() = nLeftMargin; @@ -1379,11 +1570,11 @@ xRC->setPosition(AWTPoint(aNewPos)); if ( (pColIter+1) != pColEnd ) { - uno::Reference< report::XReportComponent> xRCNext(*pColIter,uno::UNO_QUERY); - aNewPos += (VCLPoint(xRCNext->getPosition()) - aPrevious); + uno::Reference< report::XReportComponent> xRCNext(*(pColIter + 1),uno::UNO_QUERY); + Point aNextPosition = VCLPoint(xRCNext->getPosition()); + aNewPos += (aNextPosition - aPrevious); } } - } } catch(uno::Exception&) @@ -1394,7 +1585,10 @@ getView()->getReportView()->getController()->getUndoMgr()->LeaveListAction(); } else + { ::std::for_each( m_aSections.begin(), m_aSections.end(), ApplySectionViewAction( FALSE ) ); + EndDragObj_removeInvisibleObjects(); + } } // ----------------------------------------------------------------------------- void OViewsWindow::EndAction() @@ -1404,7 +1598,11 @@ // ----------------------------------------------------------------------------- void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* _pSection,bool _bMove) { + (void)_bMove; + Point aNewPos = _aPnt; + OSL_TRACE("MovAction X:%d Y:%d\n", aNewPos.X(), aNewPos.Y() ); + Point aHdlPos; SdrHdl* pHdl = _pSection->GetDragHdl(); if ( pHdl ) @@ -1413,16 +1611,18 @@ } TSectionsMap::iterator aIter = m_aSections.begin(); TSectionsMap::iterator aEnd = m_aSections.end(); - if ( _bMove ) - { + //if ( _bMove ) + //{ for (; aIter != aEnd; ++aIter) { ::boost::shared_ptr<OReportSection> pReportSection = aIter->first.first; if ( pReportSection->getView() == _pSection ) break; - aNewPos.Y() += pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); - } + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + aNewPos.Y() += nSectionHeight; + aNewPos.Y() += PixelToLogic(aIter->second.second->GetSizePixel()).Height(); } + //} for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter) { @@ -1433,8 +1633,12 @@ aNewPos = _aPnt + pCurrentHdl->GetPos() - aHdlPos; } pReportSection->getView()->MovAction ( aNewPos ); - if ( _bMove ) - aNewPos.Y() -= pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + // if ( _bMove ) + // { + const long nSectionHeight = pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height(); + aNewPos.Y() -= nSectionHeight; + aNewPos.Y() -= PixelToLogic(aIter->second.second->GetSizePixel()).Height(); + // } } } // ----------------------------------------------------------------------------- File [changed]: dlgedfunc.cxx Url: http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/dlgedfunc.cxx?r1=1.5&r2=1.5.36.1 Delta lines: +155 -126 ----------------------- --- dlgedfunc.cxx 2007-08-06 10:49:22+0000 1.5 +++ dlgedfunc.cxx 2007-11-26 06:24:44+0000 1.5.36.1 @@ -4,9 +4,9 @@ * * $RCSfile: dlgedfunc.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.5.36.1 $ * - * last change: $Author: hr $ $Date: 2007/08/06 10:49:22 $ + * last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -108,7 +108,7 @@ IMPL_LINK( DlgEdFunc, ScrollTimeout, Timer *, ) { - ForceScroll( pParent->PixelToLogic( pParent->GetPointerPosPixel() ) ); + ForceScroll( m_pParent->PixelToLogic( m_pParent->GetPointerPosPixel() ) ); return 0; } @@ -118,15 +118,15 @@ { aScrollTimer.Stop(); - OReportWindow* pReportWindow = pParent->getViewsWindow()->getView(); + OReportWindow* pReportWindow = m_pParent->getViewsWindow()->getView(); OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow(); Size aOut = pReportWindow->GetOutputSizePixel(); aOut.Width() -= REPORT_STARTMARKER_WIDTH; Rectangle aOutRect( pScrollWindow->getScrollOffset(), aOut ); - aOutRect = pParent->PixelToLogic( aOutRect ); - //Rectangle aWorkArea = pParent->getView()->GetWorkArea(); + aOutRect = m_pParent->PixelToLogic( aOutRect ); + //Rectangle aWorkArea = m_pParent->getView()->GetWorkArea(); Point aGcc3WorkaroundTemporary; Rectangle aWorkArea(aGcc3WorkaroundTemporary,pScrollWindow->getTotalSize()); aWorkArea.Right() -= REPORT_STARTMARKER_WIDTH; @@ -156,15 +156,15 @@ //---------------------------------------------------------------------------- DlgEdFunc::DlgEdFunc( OReportSection* _pParent ) -:pParent(_pParent), - pView(_pParent->getView()), +:m_pParent(_pParent), + m_pView(_pParent->getView()), m_xOverlappingObj(NULL), m_pOverlappingObj(NULL), m_bSelectionMode(false) { - // pParent = _pParent; + // m_pParent = _pParent; aScrollTimer.SetTimeoutHdl( LINK( this, DlgEdFunc, ScrollTimeout ) ); - pView->SetActualWin( pParent); + m_pView->SetActualWin( m_pParent); aScrollTimer.SetTimeout( SELENG_AUTOREPEAT_INTERVAL ); } @@ -217,24 +217,24 @@ BOOL DlgEdFunc::MouseButtonDown( const MouseEvent& rMEvt ) { - m_aMDPos = pParent->PixelToLogic( rMEvt.GetPosPixel() ); - pParent->GrabFocus(); + m_aMDPos = m_pParent->PixelToLogic( rMEvt.GetPosPixel() ); + m_pParent->GrabFocus(); BOOL bHandled = FALSE; if ( rMEvt.IsLeft() ) { if ( rMEvt.GetClicks() > 1 ) { // show property browser - if ( pParent->GetMode() != RPTUI_READONLY ) + if ( m_pParent->GetMode() != RPTUI_READONLY ) { uno::Sequence<beans::PropertyValue> aArgs(1); aArgs[0].Name = ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ShowProperties")); aArgs[0].Value <<= sal_True; - pParent->getViewsWindow()->getView()->getReportView()->getController()->executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs); - pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(pParent->getView()); + m_pParent->getViewsWindow()->getView()->getReportView()->getController()->executeUnChecked(SID_SHOW_PROPERTYBROWSER,aArgs); + m_pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_pParent->getView()); // TODO character in shapes // SdrViewEvent aVEvt; - // pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); + // m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); // if ( aVEvt.pRootObj && aVEvt.pRootObj->ISA(SdrTextObj) ) // SetInEditMode(static_cast<SdrTextObj *>(aVEvt.pRootObj),rMEvt, FALSE); bHandled = TRUE; @@ -242,35 +242,35 @@ } else { - SdrHdl* pHdl = pView->PickHandle(m_aMDPos); - //pParent->getViewsWindow()->unmarkAllObjects(pView); + SdrHdl* pHdl = m_pView->PickHandle(m_aMDPos); + //m_pParent->getViewsWindow()->unmarkAllObjects(m_pView); // if selected object was hit, drag object - if ( pHdl!=NULL || pView->IsMarkedHit(m_aMDPos) ) + if ( pHdl!=NULL || m_pView->IsMarkedHit(m_aMDPos) ) { bHandled = TRUE; - pParent->CaptureMouse(); - pParent->getViewsWindow()->BegDragObj(m_aMDPos, pHdl,pView); + m_pParent->CaptureMouse(); + m_pParent->getViewsWindow()->BegDragObj(m_aMDPos, pHdl,m_pView); } } } else if ( rMEvt.IsRight() && !rMEvt.IsLeft() && rMEvt.GetClicks() == 1 ) // mark object when context menu was selected { - SdrPageView* pPV = pView->GetSdrPageView(); + SdrPageView* pPV = m_pView->GetSdrPageView(); SdrViewEvent aVEvt; - if ( pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt) != SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() ) - pParent->getViewsWindow()->unmarkAllObjects(NULL); + if ( m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt) != SDRHIT_MARKEDOBJECT && !rMEvt.IsShift() ) + m_pParent->getViewsWindow()->unmarkAllObjects(NULL); if ( aVEvt.pRootObj ) - pView->MarkObj(aVEvt.pRootObj, pPV); + m_pView->MarkObj(aVEvt.pRootObj, pPV); else - pParent->getViewsWindow()->unmarkAllObjects(NULL); + m_pParent->getViewsWindow()->unmarkAllObjects(NULL); bHandled = TRUE; } else if( !rMEvt.IsLeft() ) bHandled = TRUE; if ( !bHandled ) - pParent->CaptureMouse(); + m_pParent->CaptureMouse(); return bHandled; } @@ -279,7 +279,7 @@ BOOL DlgEdFunc::MouseButtonUp( const MouseEvent& /*rMEvt*/ ) { BOOL bHandled = FALSE; - pParent->getViewsWindow()->stopScrollTimer(); + m_pParent->getViewsWindow()->stopScrollTimer(); return bHandled; } // ----------------------------------------------------------------------------- @@ -287,8 +287,8 @@ { unColorizeOverlappedObj(); aScrollTimer.Stop(); - if ( pParent->IsMouseCaptured() ) - pParent->ReleaseMouse(); + if ( m_pParent->IsMouseCaptured() ) + m_pParent->ReleaseMouse(); } //---------------------------------------------------------------------------- @@ -308,20 +308,20 @@ { case KEY_ESCAPE: { - if ( pParent->getViewsWindow()->IsAction() ) + if ( m_pParent->getViewsWindow()->IsAction() ) { - pParent->getViewsWindow()->BrkAction(); + m_pParent->getViewsWindow()->BrkAction(); bReturn = TRUE; } - else if ( pView->AreObjectsMarked() ) + else if ( m_pView->AreObjectsMarked() ) { - const SdrHdlList& rHdlList = pView->GetHdlList(); + const SdrHdlList& rHdlList = m_pView->GetHdlList(); SdrHdl* pHdl = rHdlList.GetFocusHdl(); if ( pHdl ) ((SdrHdlList&)rHdlList).ResetFocusHdl(); else - pParent->getViewsWindow()->unmarkAllObjects(NULL); - //pView->UnmarkAll(); + m_pParent->getViewsWindow()->unmarkAllObjects(NULL); + //m_pView->UnmarkAll(); bReturn = FALSE; } @@ -332,22 +332,22 @@ if ( !rCode.IsMod1() && !rCode.IsMod2() ) { // mark next object - if ( !pView->MarkNextObj( !rCode.IsShift() ) ) + if ( !m_pView->MarkNextObj( !rCode.IsShift() ) ) { // if no next object, mark first/last - pView->UnmarkAllObj(); - pView->MarkNextObj( !rCode.IsShift() ); + m_pView->UnmarkAllObj(); + m_pView->MarkNextObj( !rCode.IsShift() ); } - if ( pView->AreObjectsMarked() ) - pView->MakeVisible( pView->GetAllMarkedRect(), *pParent); + if ( m_pView->AreObjectsMarked() ) + m_pView->MakeVisible( m_pView->GetAllMarkedRect(), *m_pParent); bReturn = TRUE; } else if ( rCode.IsMod1() && rCode.IsMod2()) { // selected handle - const SdrHdlList& rHdlList = pView->GetHdlList(); + const SdrHdlList& rHdlList = m_pView->GetHdlList(); ((SdrHdlList&)rHdlList).TravelFocusHdl( !rCode.IsShift() ); // guarantee visibility of focused handle @@ -356,7 +356,7 @@ { Point aHdlPosition( pHdl->GetPos() ); Rectangle aVisRect( aHdlPosition - Point( DEFAUL_MOVE_SIZE, DEFAUL_MOVE_SIZE ), Size( 200, 200 ) ); - pView->MakeVisible( aVisRect, *pParent); + m_pView->MakeVisible( aVisRect, *m_pParent); } bReturn = TRUE; @@ -368,19 +368,19 @@ case KEY_LEFT: case KEY_RIGHT: { - pParent->getViewsWindow()->handleKey(rCode); + m_pParent->getViewsWindow()->handleKey(rCode); bReturn = TRUE; } break; default: { - bReturn = pView->KeyInput(_rEvent, pParent); + bReturn = m_pView->KeyInput(_rEvent, m_pParent); } break; } - if ( bReturn && pParent->IsMouseCaptured() ) - pParent->ReleaseMouse(); + if ( bReturn && m_pParent->IsMouseCaptured() ) + m_pParent->ReleaseMouse(); return bReturn; } @@ -430,7 +430,7 @@ { bool bOverlapping = false; SdrViewEvent aVEvt; - bOverlapping = pView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt) != SDRHIT_NONE; + bOverlapping = m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONUP, aVEvt) != SDRHIT_NONE; if (bOverlapping && aVEvt.pObj) { colorizeOverlappedObject(aVEvt.pObj); @@ -445,24 +445,37 @@ // ----------------------------------------------------------------------------- void DlgEdFunc::checkMovementAllowed(const MouseEvent& rMEvt) { - if ( pParent->getViewsWindow()->IsDragObj() ) + if ( m_pParent->getViewsWindow()->IsDragObj() ) { if ( isRectangleHit(rMEvt) ) - pParent->getViewsWindow()->BrkAction(); + m_pParent->getViewsWindow()->BrkAction(); // object was dragged - const Point aPnt( pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); - pParent->getViewsWindow()->EndDragObj( rMEvt.IsMod1() , pView,aPnt ); - pParent->getViewsWindow()->ForceMarkedToAnotherPage(); - pParent->Invalidate(INVALIDATE_CHILDREN); + Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); + if (m_bSelectionMode) + { + m_pParent->getViewsWindow()->EndAction(); + } + else + { + bool bControlKeyPressed = rMEvt.IsMod1(); + // Don't allow points smaller 0 + if (bControlKeyPressed && (aPnt.Y() < 0)) + { + aPnt.Y() = 0; + } + m_pParent->getViewsWindow()->EndDragObj( bControlKeyPressed, m_pView, aPnt ); + } + m_pParent->getViewsWindow()->ForceMarkedToAnotherPage(); + m_pParent->Invalidate(INVALIDATE_CHILDREN); } else - pParent->getViewsWindow()->EndAction(); + m_pParent->getViewsWindow()->EndAction(); } // ----------------------------------------------------------------------------- bool DlgEdFunc::isOnlyCustomShapeMarked() { bool bReturn = true; - const SdrMarkList& rMarkList = pView->GetMarkedObjectList(); + const SdrMarkList& rMarkList = m_pView->GetMarkedObjectList(); for (sal_uInt32 i = 0; i < rMarkList.GetMarkCount();++i ) { SdrMark* pMark = rMarkList.GetMark(i); @@ -486,21 +499,21 @@ } SdrViewEvent aVEvt; - const SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEMOVE, aVEvt); + const SdrHitKind eHit = m_pView->PickAnything(rMEvt, SDRMOUSEMOVE, aVEvt); bool bIsSetPoint = (eHit == SDRHIT_UNMARKEDOBJECT); if ( !bIsSetPoint ) { // no drag rect, we have to check every single select rect - //const Rectangle& rRect = pView->GetDragStat().GetActionRect(); - const SdrDragStat& rDragStat = pView->GetDragStat(); + //const Rectangle& rRect = m_pView->GetDragStat().GetActionRect(); + const SdrDragStat& rDragStat = m_pView->GetDragStat(); if (rDragStat.GetDragMethod() != NULL) { - SdrObjListIter aIter(*pParent->getPage(),IM_DEEPNOGROUPS); + SdrObjListIter aIter(*m_pParent->getPage(),IM_DEEPNOGROUPS); SdrObject* pObjIter = NULL; // loop through all marked objects and check if there new rect overlapps an old one. while( (pObjIter = aIter.Next()) != NULL && !bIsSetPoint) { - if ( pView->IsObjMarked(pObjIter) + if ( m_pView->IsObjMarked(pObjIter) && dynamic_cast<OUnoObject*>(pObjIter) != NULL ) { Rectangle aNewRect = pObjIter->GetLastBoundRect(); @@ -518,7 +531,7 @@ ::ResizeRect(aNewRect,rDragStat.GetRef1(),rDragStat.GetXFact(),rDragStat.GetYFact()); - SdrObject* pObjOverlapped = isOver(aNewRect,*pParent->getPage(),*pView,false,pObjIter); + SdrObject* pObjOverlapped = isOver(aNewRect,*m_pParent->getPage(),*m_pView,false,pObjIter); bIsSetPoint = pObjOverlapped ? true : false; if (pObjOverlapped && !m_bSelectionMode) { @@ -539,8 +552,17 @@ { bool bIsSetPoint = isRectangleHit(rMEvt); if ( bIsSetPoint ) - pParent->SetPointer( Pointer(POINTER_NOTALLOWED)); - + m_pParent->SetPointer( Pointer(POINTER_NOTALLOWED)); + else + { + bool bCtrlKey = rMEvt.IsMod1(); + (void)bCtrlKey; + if (bCtrlKey) + { + m_pParent->SetPointer( Pointer(POINTER_MOVEDATALINK )); + bIsSetPoint = true; + } + } return bIsSetPoint; } //---------------------------------------------------------------------------- @@ -548,14 +570,14 @@ DlgEdFuncInsert::DlgEdFuncInsert( OReportSection* _pParent ) : DlgEdFunc( _pParent ) { - pParent->getView()->SetCreateMode( TRUE ); + m_pParent->getView()->SetCreateMode( TRUE ); } //---------------------------------------------------------------------------- DlgEdFuncInsert::~DlgEdFuncInsert() { - pParent->getView()->SetEditMode( TRUE ); + m_pParent->getView()->SetEditMode( TRUE ); } //---------------------------------------------------------------------------- @@ -566,25 +588,25 @@ return TRUE; SdrViewEvent aVEvt; - const SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); + const SdrHitKind eHit = m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); if( eHit != SDRHIT_UNMARKEDOBJECT ) { // if no action, create object - if ( !pParent->getViewsWindow()->IsAction() ) + if ( !m_pParent->getViewsWindow()->IsAction() ) { - if ( pParent->getViewsWindow()->HasSelection() ) - pParent->getViewsWindow()->unmarkAllObjects(pView); - pView->BegCreateObj(m_aMDPos); - pParent->getViewsWindow()->createDefault(); + if ( m_pParent->getViewsWindow()->HasSelection() ) + m_pParent->getViewsWindow()->unmarkAllObjects(m_pView); + m_pView->BegCreateObj(m_aMDPos); + m_pParent->getViewsWindow()->createDefault(); } } else { if( !rMEvt.IsShift() ) - pParent->getViewsWindow()->unmarkAllObjects(NULL); + m_pParent->getViewsWindow()->unmarkAllObjects(NULL); - pParent->getViewsWindow()->BegMarkObj( m_aMDPos,pView ); + m_pParent->getViewsWindow()->BegMarkObj( m_aMDPos,m_pView ); } return TRUE; @@ -596,44 +618,44 @@ if ( DlgEdFunc::MouseButtonUp( rMEvt ) ) return TRUE; - const Point aPos( pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); - const USHORT nHitLog = USHORT ( pParent->PixelToLogic(Size(3,0)).Width() ); + const Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); + const USHORT nHitLog = USHORT ( m_pParent->PixelToLogic(Size(3,0)).Width() ); BOOL bReturn = TRUE; // object creation active? - if ( pView->IsCreateObj() ) + if ( m_pView->IsCreateObj() ) { - if ( isOver(pView->GetCreateObj(),*pParent->getPage(),*pView) ) + if ( isOver(m_pView->GetCreateObj(),*m_pParent->getPage(),*m_pView) ) { - pParent->getViewsWindow()->BrkAction(); + m_pParent->getViewsWindow()->BrkAction(); // BrkAction disables the create mode - pView->SetCreateMode( TRUE ); + m_pView->SetCreateMode( TRUE ); return TRUE; } - pView->EndCreateObj(SDRCREATE_FORCEEND); + m_pView->EndCreateObj(SDRCREATE_FORCEEND); - if ( !pView->AreObjectsMarked() ) + if ( !m_pView->AreObjectsMarked() ) { - pView->MarkObj(aPos, nHitLog); + m_pView->MarkObj(aPos, nHitLog); } - bReturn = pView->AreObjectsMarked(); + bReturn = m_pView->AreObjectsMarked(); } else checkMovementAllowed(rMEvt); - if ( pView && !pView->AreObjectsMarked() && + if ( m_pView && !m_pView->AreObjectsMarked() && Abs(m_aMDPos.X() - aPos.X()) < nHitLog && Abs(m_aMDPos.Y() - aPos.Y()) < nHitLog && !rMEvt.IsShift() && !rMEvt.IsMod2() ) { - SdrPageView* pPV = pView->GetSdrPageView(); + SdrPageView* pPV = m_pView->GetSdrPageView(); SdrViewEvent aVEvt; - pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); - pView->MarkObj(aVEvt.pRootObj, pPV); + m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); + m_pView->MarkObj(aVEvt.pRootObj, pPV); } - pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(pView); + m_pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_pView); return bReturn; } @@ -643,27 +665,27 @@ { if ( DlgEdFunc::MouseMove(rMEvt ) ) return TRUE; - const Point aPos( pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); + const Point aPos( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); - if ( pView->IsCreateObj() ) + if ( m_pView->IsCreateObj() ) { - pView->SetOrtho(SdrObjCustomShape::doConstructOrthogonal(pView->getSectionWindow()->getViewsWindow()->getShapeType()) ? !rMEvt.IsShift() : rMEvt.IsShift()); - pView->SetAngleSnapEnabled(rMEvt.IsShift()); + m_pView->SetOrtho(SdrObjCustomShape::doConstructOrthogonal(m_pView->getSectionWindow()->getViewsWindow()->getShapeType()) ? !rMEvt.IsShift() : rMEvt.IsShift()); + m_pView->SetAngleSnapEnabled(rMEvt.IsShift()); } bool bIsSetPoint = false; - if ( pView->IsAction() ) + if ( m_pView->IsAction() ) { bIsSetPoint = setMovementPointer(rMEvt); ForceScroll(aPos); - pParent->getViewsWindow()->MovAction(aPos,pView,pView->GetDragMethod() == NULL); + m_pParent->getViewsWindow()->MovAction(aPos,m_pView, m_pView->GetDragMethod() == NULL); } - //if ( isOver(pView->GetCreateObj(),*pParent->getPage(),*pView) ) - // pParent->SetPointer( Pointer(POINTER_NOTALLOWED)); + //if ( isOver(m_pView->GetCreateObj(),*m_pParent->getPage(),*m_pView) ) + // m_pParent->SetPointer( Pointer(POINTER_NOTALLOWED)); //else if ( !bIsSetPoint ) - pParent->SetPointer( pView->GetPreferedPointer( aPos, pParent) ); + m_pParent->SetPointer( m_pView->GetPreferedPointer( aPos, m_pParent) ); return TRUE; } @@ -690,37 +712,37 @@ return TRUE; SdrViewEvent aVEvt; - const SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); + const SdrHitKind eHit = m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); if( eHit == SDRHIT_UNMARKEDOBJECT ) { // if not multi selection, unmark all if ( !rMEvt.IsShift() ) - pParent->getViewsWindow()->unmarkAllObjects(NULL); + m_pParent->getViewsWindow()->unmarkAllObjects(NULL); - if ( pView->MarkObj(m_aMDPos) && rMEvt.IsLeft() ) + if ( m_pView->MarkObj(m_aMDPos) && rMEvt.IsLeft() ) { // drag object - pParent->getViewsWindow()->BegDragObj(m_aMDPos, pView->PickHandle(m_aMDPos), pView); + m_pParent->getViewsWindow()->BegDragObj(m_aMDPos, m_pView->PickHandle(m_aMDPos), m_pView); } else { // select object - pParent->getViewsWindow()->BegMarkObj(m_aMDPos,pView); + m_pParent->getViewsWindow()->BegMarkObj(m_aMDPos,m_pView); } } else { if( !rMEvt.IsShift() ) - pParent->getViewsWindow()->unmarkAllObjects(NULL); - //pView->UnmarkAll(); + m_pParent->getViewsWindow()->unmarkAllObjects(NULL); + //m_pView->UnmarkAll(); if ( rMEvt.GetClicks() == 1 ) { m_bSelectionMode = true; - pParent->getViewsWindow()->BegMarkObj( m_aMDPos ,pView); + m_pParent->getViewsWindow()->BegMarkObj( m_aMDPos ,m_pView); } else - pView->SdrBeginTextEdit( aVEvt.pRootObj,pView->GetSdrPageView(),pParent,sal_False ); + m_pView->SdrBeginTextEdit( aVEvt.pRootObj,m_pView->GetSdrPageView(),m_pParent,sal_False ); } return TRUE; @@ -734,15 +756,15 @@ return TRUE; // get view from parent - const Point aPnt( pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); + const Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); - if ( rMEvt.IsLeft() ) + if ( rMEvt.IsLeft() ) // left mousebutton pressed checkMovementAllowed(rMEvt); - pParent->getViewsWindow()->EndAction(); - pParent->SetPointer( pView->GetPreferedPointer( aPnt, pParent) ); + m_pParent->getViewsWindow()->EndAction(); + m_pParent->SetPointer( m_pView->GetPreferedPointer( aPnt, m_pParent) ); - pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(pView); + m_pParent->getViewsWindow()->getView()->getReportView()->UpdatePropertyBrowserDelayed(m_pView); m_bSelectionMode = false; return TRUE; } @@ -754,19 +776,26 @@ if ( DlgEdFunc::MouseMove(rMEvt ) ) return TRUE; - const Point aPnt( pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); + const Point aPnt( m_pParent->PixelToLogic( rMEvt.GetPosPixel() ) ); bool bIsSetPoint = false; - if ( pView->IsAction() ) + if ( m_pView->IsAction() ) // Drag Mode { bIsSetPoint = setMovementPointer(rMEvt); ForceScroll(aPnt); - pParent->getViewsWindow()->MovAction(aPnt,pView,pView->GetDragMethod() == NULL); + if (m_pView->GetDragMethod()==NULL) + { + m_pParent->getViewsWindow()->MovAction(aPnt, m_pView, true); + } + else + { + m_pParent->getViewsWindow()->MovAction(aPnt, m_pView, false); + } } if ( !bIsSetPoint ) { - pParent->SetPointer( pView->GetPreferedPointer( aPnt, pParent) ); + m_pParent->SetPointer( m_pView->GetPreferedPointer( aPnt, m_pParent) ); // restore color unColorizeOverlappedObj(); @@ -778,17 +807,17 @@ //void DlgEdFuncSelect::SetInEditMode(SdrTextObj* _pTextObj,const MouseEvent& rMEvt, BOOL bQuickDrag) //{ // -// SdrPageView* pPV = pView->GetSdrPageView(); +// SdrPageView* pPV = m_pView->GetSdrPageView(); // if( _pTextObj && _pTextObj->GetPage() == pPV->GetPage() ) // { -// pView->SetCurrentObj(OBJ_TEXT); -// pView->SetEditMode(SDREDITMODE_EDIT); +// m_pView->SetCurrentObj(OBJ_TEXT); +// m_pView->SetEditMode(SDREDITMODE_EDIT); // // BOOL bEmptyOutliner = FALSE; // -// if (!_pTextObj->GetOutlinerParaObject() && pView->GetTextEditOutliner()) +// if (!_pTextObj->GetOutlinerParaObject() && m_pView->GetTextEditOutliner()) // { -// ::SdrOutliner* pOutl = pView->GetTextEditOutliner(); +// ::SdrOutliner* pOutl = m_pView->GetTextEditOutliner(); // ULONG nParaAnz = pOutl->GetParagraphCount(); // Paragraph* p1stPara = pOutl->GetParagraph( 0 ); // @@ -802,7 +831,7 @@ // } // } // -// if (_pTextObj != pView->GetTextEditObject() || bEmptyOutliner) +// if (_pTextObj != m_pView->GetTextEditObject() || bEmptyOutliner) // { // UINT32 nInv = _pTextObj->GetObjInventor(); // UINT16 nSdrObjKind = _pTextObj->GetObjIdentifier(); @@ -853,7 +882,7 @@ // // if (bEmptyOutliner) // { -// pView->SdrEndTextEdit(sal_True); +// m_pView->SdrEndTextEdit(sal_True); // } // // if( _pTextObj ) @@ -865,17 +894,17 @@ // pOutl->SetVertical( TRUE ); // // -// if (pView->SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor) +// if (m_pView->SdrBeginTextEdit(_pTextObj, pPV, pParent, sal_True, pOutl) && _pTextObj->GetObjInventor() == SdrInventor) // { // //bFirstObjCreated = TRUE; // //DeleteDefaultText(); // -// OutlinerView* pOLV = pView->GetTextEditOutlinerView(); +// OutlinerView* pOLV = m_pView->GetTextEditOutlinerView(); // // nSdrObjKind = _pTextObj->GetObjIdentifier(); // // SdrViewEvent aVEvt; -// SdrHitKind eHit = pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); +// SdrHitKind eHit = m_pView->PickAnything(rMEvt, SDRMOUSEBUTTONDOWN, aVEvt); // // if (eHit == SDRHIT_TEXTEDIT) // { Directory: /dba/reportdesign/util/defs/ ======================================= File [changed]: wntmsci10 Url: http://dba.openoffice.org/source/browse/dba/reportdesign/util/defs/wntmsci10?r1=1.4&r2=1.4.36.1 Delta lines: +4 -0 ------------------- --- wntmsci10 2007-08-06 11:08:41+0000 1.4 +++ wntmsci10 2007-11-26 06:24:44+0000 1.4.36.1 @@ -498,3 +498,7 @@ [EMAIL PROTECTED]@rptui@@[EMAIL PROTECTED]@@XZ [EMAIL PROTECTED]@@[EMAIL PROTECTED]@rtl@@@Z [EMAIL PROTECTED]@@[EMAIL PROTECTED]@[EMAIL PROTECTED]@[EMAIL PROTECTED]@@@Z [EMAIL PROTECTED]@rptui@@QAEXXZ [EMAIL PROTECTED]@rptui@@QAE_NXZ [EMAIL PROTECTED]@rptui@@QAEXXZ [EMAIL PROTECTED]@rptui@@AAEXPAVSdrObject@@@Z --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
