Tag: cws_src680_reportdesign02
User: lla     
Date: 2007-11-28 15:19:32+0000
Modified:
   dba/reportdesign/source/ui/inc/ViewsWindow.hxx
   dba/reportdesign/source/ui/report/ViewsWindow.cxx
   dba/reportdesign/source/ui/report/dlgedfunc.cxx

Log:
 #i80260# with pressed ctrl key it isn't possible to move the object out of the 
section.

File Changes:

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.36.1&r2=1.4.36.2
Delta lines:  +3 -3
-------------------
--- ViewsWindow.hxx     2007-11-26 06:24:44+0000        1.4.36.1
+++ ViewsWindow.hxx     2007-11-28 15:19:29+0000        1.4.36.2
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: ViewsWindow.hxx,v $
  *
- *  $Revision: 1.4.36.1 $
+ *  $Revision: 1.4.36.2 $
  *
- *  last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $
+ *  last change: $Author: lla $ $Date: 2007/11/28 15:19:29 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -345,7 +345,7 @@
         */
         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 */, bool _bControlKeySet);
         // void MovAction2(const Point& rPnt,const OSectionView* _pSection);
         void setPoint(const Point& _aPnt);
         inline Point getPoint() const { return m_aPoint; }

Directory: /dba/reportdesign/source/ui/report/
==============================================

File [changed]: ViewsWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ViewsWindow.cxx?r1=1.5.10.4&r2=1.5.10.5
Delta lines:  +47 -15
---------------------
--- ViewsWindow.cxx     2007-11-26 06:24:44+0000        1.5.10.4
+++ ViewsWindow.cxx     2007-11-28 15:19:29+0000        1.5.10.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ViewsWindow.cxx,v $
  *
- *  $Revision: 1.5.10.4 $
+ *  $Revision: 1.5.10.5 $
  *
- *  last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $
+ *  last change: $Author: lla $ $Date: 2007/11/28 15:19:29 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1596,12 +1596,13 @@
     ::std::for_each( m_aSections.begin(), m_aSections.end(), 
ApplySectionViewAction() );
 }
 // 
-----------------------------------------------------------------------------
-void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* 
_pSection,bool _bMove)
+void OViewsWindow::MovAction(const Point& _aPnt,const OSectionView* 
_pSection,bool _bMove, bool _bControlKeySet)
 {
        (void)_bMove;
 
-       Point aNewPos = _aPnt;
-    OSL_TRACE("MovAction X:%d Y:%d\n", aNewPos.X(), aNewPos.Y() );
+       Point aRealMousePos = _aPnt;
+       Point aCurrentSectionPos;
+    OSL_TRACE("MovAction X:%d Y:%d\n", aRealMousePos.X(), aRealMousePos.Y() );
 
     Point aHdlPos;
     SdrHdl* pHdl = _pSection->GetDragHdl();
@@ -1609,20 +1610,51 @@
     {
         aHdlPos = pHdl->GetPos();
     }
-    TSectionsMap::iterator aIter = m_aSections.begin();
+    TSectionsMap::iterator aIter/*  = m_aSections.begin() */;
     TSectionsMap::iterator aEnd = m_aSections.end();
+
     //if ( _bMove )
     //{
-    for (; aIter != aEnd; ++aIter)
+    for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
     {
         ::boost::shared_ptr<OReportSection> pReportSection = 
aIter->first.first;
         if ( pReportSection->getView() == _pSection )
             break;
         const long nSectionHeight = 
pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height();
-        aNewPos.Y() += nSectionHeight;
-        aNewPos.Y() += 
PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+        aCurrentSectionPos.Y() += nSectionHeight;
+               const long nSectionSeparator = 
PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+               aCurrentSectionPos.Y() += nSectionSeparator;
     }
     //}
+       aRealMousePos += aCurrentSectionPos;
+
+    // If control key is pressed the work area is limited to the section with 
the current selection.
+       Point aPosForWorkArea(0,0);
+    for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
+       {
+               ::boost::shared_ptr<OReportSection> pReportSection = 
aIter->first.first;
+        OSectionView* pView = pReportSection->getView();
+               const long nSectionHeight = 
pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height();
+               const long nSeparatorHeight = 
PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+
+               if (_bControlKeySet)
+               {
+                       Rectangle aClipRect = pView->GetWorkArea();
+                       aClipRect.Top() = aCurrentSectionPos.Y() - 
aPosForWorkArea.Y() - nSeparatorHeight;
+                       // if (aClipRect.Top() < 0) aClipRect.Top() = 0;
+                       aClipRect.Bottom() = aClipRect.Top() + nSectionHeight;
+                       pView->SetWorkArea( aClipRect );
+               }
+               else
+               {
+                       Rectangle aClipRect = pView->GetWorkArea();
+                       aClipRect.Top() = -aPosForWorkArea.Y();
+                       pView->SetWorkArea( aClipRect );
+               }
+        aPosForWorkArea.Y() += nSectionHeight;
+           // aNewPos.Y() += 
PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+    }
+       
 
     for (aIter = m_aSections.begin(); aIter != aEnd; ++aIter)
     {
@@ -1630,14 +1662,14 @@
         SdrHdl* pCurrentHdl = pReportSection->getView()->GetDragHdl();
         if ( pCurrentHdl )
         {
-            aNewPos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
+            aRealMousePos = _aPnt + pCurrentHdl->GetPos() - aHdlPos;
         }
-        pReportSection->getView()->MovAction ( aNewPos );
+        pReportSection->getView()->MovAction ( aRealMousePos );
         // if ( _bMove )
                // {
         const long nSectionHeight = 
pReportSection->PixelToLogic(pReportSection->GetOutputSizePixel()).Height();
-        aNewPos.Y() -= nSectionHeight;
-        aNewPos.Y() -= 
PixelToLogic(aIter->second.second->GetSizePixel()).Height();
+        aRealMousePos.Y() -= nSectionHeight;
+        aRealMousePos.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.36.1&r2=1.5.36.2
Delta lines:  +6 -5
-------------------
--- dlgedfunc.cxx       2007-11-26 06:24:44+0000        1.5.36.1
+++ dlgedfunc.cxx       2007-11-28 15:19:29+0000        1.5.36.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dlgedfunc.cxx,v $
  *
- *  $Revision: 1.5.36.1 $
+ *  $Revision: 1.5.36.2 $
  *
- *  last change: $Author: lla $ $Date: 2007/11/26 06:24:44 $
+ *  last change: $Author: lla $ $Date: 2007/11/28 15:19:29 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -678,7 +678,7 @@
        {
         bIsSetPoint = setMovementPointer(rMEvt);
                ForceScroll(aPos);
-        m_pParent->getViewsWindow()->MovAction(aPos,m_pView, 
m_pView->GetDragMethod() == NULL);
+        m_pParent->getViewsWindow()->MovAction(aPos,m_pView, 
m_pView->GetDragMethod() == NULL, false);
        }
 
     //if ( isOver(m_pView->GetCreateObj(),*m_pParent->getPage(),*m_pView) )
@@ -785,11 +785,12 @@
                ForceScroll(aPnt);
                if (m_pView->GetDragMethod()==NULL)
                {
-                       m_pParent->getViewsWindow()->MovAction(aPnt, m_pView, 
true);
+                       m_pParent->getViewsWindow()->MovAction(aPnt, m_pView, 
true, false);
                }
                else
                {
-                       m_pParent->getViewsWindow()->MovAction(aPnt, m_pView, 
false);
+                       bool bControlKey = rMEvt.IsMod1();
+                       m_pParent->getViewsWindow()->MovAction(aPnt, m_pView, 
false, bControlKey);
                }
        }    
   




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to