Tag: cws_src680_oj14
User: oj      
Date: 2007-05-30 12:28:38+0000
Modified:
   dba/reportdesign/source/ui/report/ScrollHelper.cxx
   dba/reportdesign/source/ui/report/dlgedfunc.cxx

Log:
 #i77065# set thumbpos correctly

File Changes:

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

File [changed]: ScrollHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ScrollHelper.cxx?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +31 -19
---------------------
--- ScrollHelper.cxx    2007-05-21 10:03:17+0000        1.1.2.2
+++ ScrollHelper.cxx    2007-05-30 12:28:35+0000        1.1.2.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ScrollHelper.cxx,v $
  *
- *  $Revision: 1.1.2.2 $
+ *  $Revision: 1.1.2.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/21 10:03:17 $
+ *  last change: $Author: oj $ $Date: 2007/05/30 12:28:35 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -132,12 +132,21 @@
 {
        // the width never change
        //if ( !m_aTotalPixelSize.Width() )
-    m_aTotalPixelSize.Width() = _nWidth; // TODO GetTotalWidth();
-       m_aTotalPixelSize.Height() = _nHeight; // TODO GetTotalHeight();
+    m_aTotalPixelSize.Width() = _nWidth;
+       m_aTotalPixelSize.Height() = _nHeight;
     m_aHScroll.SetRangeMax( m_aTotalPixelSize.Width() );
-    m_aHScroll.SetLineSize( SCR_LINE_SIZE ); // TODO needs to a define
+    m_aHScroll.SetLineSize( SCR_LINE_SIZE ); 
     m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
-       m_aVScroll.SetLineSize( SCR_LINE_SIZE ); // TODO needs to be a define
+       m_aVScroll.SetLineSize( SCR_LINE_SIZE ); 
+    Point aNewPixOffset(-m_aHScroll.GetThumbPos(),-m_aVScroll.GetThumbPos());
+    if ( m_aPixOffset != aNewPixOffset )
+       {
+               const long nX = aNewPixOffset.X() - m_aPixOffset.X();
+               const long nY = aNewPixOffset.Y() - m_aPixOffset.Y();
+               EndScrollImpl(-nX,-nY);
+        m_aPixOffset = aNewPixOffset;
+       }
+    
        Resize();
 }
 
//------------------------------------------------------------------------------
@@ -179,16 +188,16 @@
        const Point aOldPixOffset( m_aPixOffset );
 
        // justify (right/bottom borders should never exceed the window)
-       Size aPixDelta;
-       if ( m_aPixOffset.X() < 0 && (m_aTotalPixelSize.Width()  + 
m_aPixOffset.X()) < aOutPixSz.Width() )
-               aPixDelta.Width()  = aOutPixSz.Width()  - ( m_aPixOffset.X() + 
m_aTotalPixelSize.Width() );
-       if ( m_aPixOffset.Y() < 0 && (m_aTotalPixelSize.Height() + 
m_aPixOffset.Y()) < aOutPixSz.Height() )
-               aPixDelta.Height() = aOutPixSz.Height() - ( m_aPixOffset.Y() + 
m_aTotalPixelSize.Height() );
-       if ( aPixDelta.Width() || aPixDelta.Height() )
-       {
-               m_aPixOffset.X() += aPixDelta.Width();
-               m_aPixOffset.Y() += aPixDelta.Height();
-       }
+       //Size aPixDelta;
+       //if ( m_aPixOffset.X() < 0 && (m_aTotalPixelSize.Width()  + 
m_aPixOffset.X()) < aOutPixSz.Width() )
+       //      aPixDelta.Width()  = aOutPixSz.Width()  - ( m_aPixOffset.X() + 
m_aTotalPixelSize.Width() );
+       //if ( m_aPixOffset.Y() < 0 && (m_aTotalPixelSize.Height() + 
m_aPixOffset.Y()) < aOutPixSz.Height() )
+       //      aPixDelta.Height() = aOutPixSz.Height() - ( m_aPixOffset.Y() + 
m_aTotalPixelSize.Height() );
+       //if ( aPixDelta.Width() || aPixDelta.Height() )
+       //{
+       //      m_aPixOffset.X() += aPixDelta.Width();
+       //      m_aPixOffset.Y() += aPixDelta.Height();
+       //}
 
        // for axis without scrollbar restore the origin
        if ( !bVVisible || !bHVisible )
@@ -310,9 +319,10 @@
        // recompute the logical scroll units
        aDeltaPix.Width() = m_aPixOffset.X() - aNewPixOffset.X();
        aDeltaPix.Height() = m_aPixOffset.Y() - aNewPixOffset.Y();
-       nDeltaX = aDeltaPix.Width();
-       nDeltaY = aDeltaPix.Height();
-       m_aPixOffset = aNewPixOffset;
+       /*nDeltaX = aDeltaPix.Width();
+       nDeltaY = aDeltaPix.Height();*/
+       m_aPixOffset = 
Point(-m_aHScroll.GetThumbPos(),-m_aVScroll.GetThumbPos());
+    
 
        // scrolling?
        if ( nDeltaX != 0 || nDeltaY != 0 )
@@ -350,6 +360,8 @@
 
        if ( !m_bScrolling )
        {
+        m_aPixOffset.X() -= nDeltaX;
+        m_aPixOffset.Y() -= nDeltaY;
                if ( nDeltaX )
                        m_aHScroll.SetThumbPos( -m_aPixOffset.X() );
                if ( nDeltaY )

File [changed]: dlgedfunc.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/dlgedfunc.cxx?r1=1.1.2.4&r2=1.1.2.5
Delta lines:  +3 -2
-------------------
--- dlgedfunc.cxx       2007-05-25 14:24:47+0000        1.1.2.4
+++ dlgedfunc.cxx       2007-05-30 12:28:35+0000        1.1.2.5
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: dlgedfunc.cxx,v $
  *
- *  $Revision: 1.1.2.4 $
+ *  $Revision: 1.1.2.5 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/25 14:24:47 $
+ *  last change: $Author: oj $ $Date: 2007/05/30 12:28:35 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -466,6 +466,7 @@
                // object was dragged
                pView->EndDragObj( rMEvt.IsMod1() );
                pView->ForceMarkedToAnotherPage();
+        pParent->Invalidate();
        }
     else if ( pView->IsAction() )
                pView->EndAction();




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

Reply via email to