Tag: cws_dev300_dba31c
User: oj      
Date: 2008-10-16 09:45:55+0000
Modified:
   dba/reportdesign/source/ui/inc/DesignView.hxx
   dba/reportdesign/source/ui/inc/ReportController.hxx
   dba/reportdesign/source/ui/inc/ReportWindow.hxx
   dba/reportdesign/source/ui/inc/ScrollHelper.hxx
   dba/reportdesign/source/ui/inc/SectionWindow.hxx
   dba/reportdesign/source/ui/inc/StartMarker.hxx
   dba/reportdesign/source/ui/inc/UITools.hxx
   dba/reportdesign/source/ui/inc/ViewsWindow.hxx
   dba/reportdesign/source/ui/misc/UITools.cxx
   dba/reportdesign/source/ui/report/DesignView.cxx
   dba/reportdesign/source/ui/report/ReportController.cxx
   dba/reportdesign/source/ui/report/ReportSection.cxx
   dba/reportdesign/source/ui/report/ReportWindow.cxx
   dba/reportdesign/source/ui/report/ScrollHelper.cxx
   dba/reportdesign/source/ui/report/SectionWindow.cxx
   dba/reportdesign/source/ui/report/StartMarker.cxx
   dba/reportdesign/source/ui/report/ViewsWindow.cxx
   dba/reportdesign/source/ui/report/dlgedfunc.cxx

Log:
 #i77916# pre work form zooming

File Changes:

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

File [changed]: DesignView.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/DesignView.hxx?r1=1.8&r2=1.8.2.1
Delta lines:  +3 -3
-------------------
--- DesignView.hxx      2008-08-19 10:10:10+0000        1.8
+++ DesignView.hxx      2008-10-16 09:45:50+0000        1.8.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: DesignView.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -273,7 +273,7 @@
 
         /** zoom the ruler and view windows
         */
-        void            zoom(const sal_Int16 _nZoom);
+        void            zoom(const Fraction& _aZoom);
 
         /** fills the vector with all selected control models
             /param  _rSelection The vector will be filled and will not be 
cleared before.

File [changed]: ReportController.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/ReportController.hxx?r1=1.11&r2=1.11.2.1
Delta lines:  +6 -2
-------------------
--- ReportController.hxx        2008-08-19 10:10:50+0000        1.11
+++ ReportController.hxx        2008-10-16 09:45:50+0000        1.11.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportController.hxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -176,6 +176,10 @@
                */
                void openSortingAndGroupingDialog();
 
+        /** opens the zoom dialog
+        */
+        void openZoomDialog();
+
                /** returns the position of the group inside the groups 
collection
                */
                sal_Int32 getGroupPosition(const 
::com::sun::star::uno::Reference< ::com::sun::star::report::XGroup >& _xGroup);

File [changed]: ReportWindow.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/ReportWindow.hxx?r1=1.6&r2=1.6.2.1
Delta lines:  +6 -6
-------------------
--- ReportWindow.hxx    2008-08-19 10:11:19+0000        1.6
+++ ReportWindow.hxx    2008-10-16 09:45:50+0000        1.6.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportWindow.hxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.6.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -120,7 +120,7 @@
         */
         BOOL HasSelection();
 
-               Point                   getScrollOffset() const;
+               Point                   getThumbPos() const;
 
                /** removes the section at the given position.
                *
@@ -162,9 +162,9 @@
                */
                sal_Int32               getMaxMarkerWidth(sal_Bool _bWithEnd) 
const;
 
-               void                    ScrollChildren(long nDeltaX, long 
nDeltaY);
+               void                    ScrollChildren(const Point& _aThumbPos);
 
-               void                    notifyHeightChanged();
+               void                    notifySizeChanged();
 
                /** unmark all objects on the views without the given one.
                *
@@ -220,7 +220,7 @@
 
         /** zoom the ruler and view windows
         */
-        void zoom(const sal_Int16 _nZoom);
+        void zoom(const Fraction& _aZoom);
 
         /** fills the vector with all selected control models
             /param  _rSelection The vector will be filled and will not be 
cleared before.

File [changed]: ScrollHelper.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/ScrollHelper.hxx?r1=1.7&r2=1.7.2.1
Delta lines:  +4 -6
-------------------
--- ScrollHelper.hxx    2008-08-19 10:11:34+0000        1.7
+++ ScrollHelper.hxx    2008-10-16 09:45:50+0000        1.7.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ScrollHelper.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -66,7 +66,6 @@
                ScrollBar                       m_aVScroll;
                ScrollBarBox            m_aCornerWin;           // window in 
the bottom right corner
                Size                            m_aTotalPixelSize;
-               Point                           m_aPixOffset;           // 
offset to virtual window (pixel)
                ODesignView*        m_pParent;
                OReportWindow           m_aReportWindow;
         ::rtl::Reference<comphelper::OPropertyChangeMultiplexer >
@@ -76,7 +75,6 @@
                Size ResizeScrollBars();
                void ImplInitSettings();
         void impl_initScrollBar( ScrollBar& _rScrollBar ) const;
-               void impl_scrollContent( long nDeltaX, long nDeltaY );
 
         OScrollWindowHelper(OScrollWindowHelper&);
         void operator =(OScrollWindowHelper&);
@@ -95,7 +93,7 @@
                */
                void                                    initialize();
 
-               inline Point                    getScrollOffset() const { 
return 
Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; }
+               inline Point                    getThumbPos() const { return 
Point(m_aHScroll.GetThumbPos(),m_aVScroll.GetThumbPos())/*m_aScrollOffset*/; }
                inline const OReportWindow&     getReportWindow() const { 
return m_aReportWindow; }
                void                                    setTotalSize(sal_Int32 
_nWidth ,sal_Int32 _nHeight);
                inline Size                             getTotalSize() const { 
return m_aTotalPixelSize; }
@@ -218,7 +216,7 @@
 
         /** zoom the ruler and view windows
         */
-        void zoom(const sal_Int16 _nZoom);
+        void zoom(const Fraction& _aZoom);
 
         /** fills the vector with all selected control models
             /param  _rSelection The vector will be filled and will not be 
cleared before.

File [changed]: SectionWindow.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/SectionWindow.hxx?r1=1.2&r2=1.2.2.1
Delta lines:  +3 -3
-------------------
--- SectionWindow.hxx   2008-08-19 10:11:59+0000        1.2
+++ SectionWindow.hxx   2008-10-16 09:45:50+0000        1.2.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: SectionWindow.hxx,v $
- * $Revision: 1.2 $
+ * $Revision: 1.2.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -121,9 +121,9 @@
 
         /** zoom the ruler and view windows
         */
-        void zoom(const sal_Int16 _nZoom);
+        void zoom(const Fraction& _aZoom);
 
-        void scrollChildren(long _nDeltaX);
+        void scrollChildren(long _nThumbPosX);
     };
 
//==============================================================================
 } // rptui

File [changed]: StartMarker.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/StartMarker.hxx?r1=1.5&r2=1.5.2.1
Delta lines:  +3 -3
-------------------
--- StartMarker.hxx     2008-08-19 10:12:28+0000        1.5
+++ StartMarker.hxx     2008-10-16 09:45:51+0000        1.5.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: StartMarker.hxx,v $
- * $Revision: 1.5 $
+ * $Revision: 1.5.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -87,7 +87,7 @@
 
         /** zoom the ruler and view windows
         */
-        void            zoom(const sal_Int16 _nZoom);
+        void            zoom(const Fraction& _aZoom);
        };
 }
 #endif // RPTUI_STARTMARKER_HXX

File [changed]: UITools.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/UITools.hxx?r1=1.6&r2=1.6.2.1
Delta lines:  +4 -4
-------------------
--- UITools.hxx 2008-08-19 10:12:42+0000        1.6
+++ UITools.hxx 2008-10-16 09:45:51+0000        1.6.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: UITools.hxx,v $
- * $Revision: 1.6 $
+ * $Revision: 1.6.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -166,10 +166,10 @@
     Rectangle getRectangleFromControl(SdrObject* pControl);
 
     /** sets the map mode at the window
-        @param  _nZoom      in percentage
+        @param  _aZoom      the zoom scale
         @param  _rWindow    where to set the map mode
     */
-    void setZoomFactor(const sal_Int16 _nZoom,Window& _rWindow);
+    void setZoomFactor(const Fraction& _aZoom,Window& _rWindow);
 }
 #endif //RPTUI_UITOOLS_HXX
 

File [changed]: ViewsWindow.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/ViewsWindow.hxx?r1=1.8&r2=1.8.2.1
Delta lines:  +4 -4
-------------------
--- ViewsWindow.hxx     2008-08-19 10:13:07+0000        1.8
+++ ViewsWindow.hxx     2008-10-16 09:45:51+0000        1.8.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ViewsWindow.hxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -353,9 +353,9 @@
 
         /** zoom the ruler and view windows
         */
-        void zoom(const sal_Int16 _nZoom);
+        void zoom(const Fraction& _aZoom);
 
-        void scrollChildren(long nDeltaX, long nDeltaY);
+        void scrollChildren(const Point& _aThumbPos);
 
         /** fills the vector with all selected control models
             /param  _rSelection The vector will be filled and will not be 
cleared before.

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.8&r2=1.8.2.1
Delta lines:  +5 -7
-------------------
--- UITools.cxx 2008-08-19 10:15:04+0000        1.8
+++ UITools.cxx 2008-10-16 09:45:51+0000        1.8.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: UITools.cxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -1081,13 +1081,11 @@
         
rSectionView.InsertObjectAtView(_pControl,*rSectionView.GetSdrPageView(),SDRINSERT_ADDMARK);
 }
 // 
-----------------------------------------------------------------------------
-// 
-----------------------------------------------------------------------------
-void setZoomFactor(const sal_Int16 _nZoom,Window& _rWindow)
+void setZoomFactor(const Fraction& _aZoom,Window& _rWindow)
 {
-    Fraction aZoom(_nZoom,100);
     MapMode aMapMode( _rWindow.GetMapMode() );
-    aMapMode.SetScaleX(aZoom);
-    aMapMode.SetScaleY(aZoom);
+    aMapMode.SetScaleX(_aZoom);
+    aMapMode.SetScaleY(_aZoom);
     _rWindow.SetMapMode(aMapMode);
 }
 // 
-----------------------------------------------------------------------------

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

File [changed]: DesignView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/DesignView.cxx?r1=1.8&r2=1.8.2.1
Delta lines:  +4 -4
-------------------
--- DesignView.cxx      2008-08-19 10:16:24+0000        1.8
+++ DesignView.cxx      2008-10-16 09:45:51+0000        1.8.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: DesignView.cxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -749,9 +749,9 @@
     return m_aScrollWindow.getMarkedObjectCount();
 }
 // 
-----------------------------------------------------------------------------
-void ODesignView::zoom(const sal_Int16 _nZoom)
+void ODesignView::zoom(const Fraction& _aZoom)
 {
-    m_aScrollWindow.zoom(_nZoom);
+    m_aScrollWindow.zoom(_aZoom);
 }
 //============================================================================
 } // rptui

File [changed]: ReportController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportController.cxx?r1=1.20.2.2&r2=1.20.2.3
Delta lines:  +66 -9
--------------------
--- ReportController.cxx        2008-09-09 07:41:44+0000        1.20.2.2
+++ ReportController.cxx        2008-10-16 09:45:51+0000        1.20.2.3
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportController.cxx,v $
- * $Revision: 1.20.2.2 $
+ * $Revision: 1.20.2.3 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -115,6 +115,9 @@
 #include <svx/brshitem.hxx>
 #include <svx/flagsdef.hxx> //CHINA001
 #include <svx/svdpagv.hxx>
+#include <svx/svxdlg.hxx>
+#include <svx/zoom_def.hxx>
+#include <svx/dialogs.hrc>
 
 #include "DesignView.hxx"
 #include "ModuleHelper.hxx"
@@ -1594,7 +1597,11 @@
         case SID_GROUP:
             break;
         case SID_ATTR_ZOOM:
-            if ( aArgs.getLength() == 1 && aArgs[0].Name.equalsAscii("Zoom") )
+            if ( aArgs.getLength() == 0 )
+            {
+                openZoomDialog();
+            }
+            else if ( aArgs.getLength() == 1 && 
aArgs[0].Name.equalsAscii("Zoom") )
             {
                 SvxZoomItem aZoomItem;
                 aZoomItem.PutValue(aArgs[0].Value);
@@ -3847,15 +3854,12 @@
 void OReportController::impl_zoom_nothrow()
 {
     Fraction aZoom(m_nZoomValue,100);
-    MapMode aMapMode = m_pMyOwnView->GetMapMode();
-    aMapMode.SetScaleX(aZoom);
-    aMapMode.SetScaleY(aZoom);
-    m_pMyOwnView->SetMapMode(aMapMode);
-    m_pMyOwnView->zoom(m_nZoomValue);
+    setZoomFactor(aZoom,*m_pMyOwnView);
+    m_pMyOwnView->zoom(aZoom);
     // TRY
     /*m_pMyOwnView->Invalidate(INVALIDATE_NOCHILDREN);*/
-    InvalidateFeature(SID_ATTR_ZOOM);
-    InvalidateFeature(SID_ATTR_ZOOMSLIDER);
+    InvalidateFeature(SID_ATTR_ZOOM,Reference< XStatusListener >(),sal_True);
+    InvalidateFeature(SID_ATTR_ZOOMSLIDER,Reference< XStatusListener 
>(),sal_True);
 }
 // 
-----------------------------------------------------------------------------
 sal_Bool OReportController::isFormatCommandEnabled(sal_uInt16 _nCommand,const 
uno::Reference< report::XReportControlFormat>& _xReportControlFormat) const
@@ -3918,3 +3922,56 @@
        _rState.bChecked = m_pMyOwnView->GetInsertObj() == OBJ_CUSTOMSHAPE && 
sShapeType.compareToAscii(_pCustomShapeType) == 0;
 }
 // 
-----------------------------------------------------------------------------
+void OReportController::openZoomDialog()
+{
+    SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+       if ( pFact )
+       {
+        static SfxItemInfo aItemInfos[] =
+           {                   
+                   { SID_ATTR_ZOOM, SFX_ITEM_POOLABLE }
+        };
+        SfxPoolItem* pDefaults[] =
+           {
+                   new SvxZoomItem()
+        };
+        static USHORT pRanges[] =
+           {
+                   SID_ATTR_ZOOM,SID_ATTR_ZOOM,
+            0
+           };
+        try
+        {
+            ::std::auto_ptr<SfxItemPool> pPool( new 
SfxItemPool(String::CreateFromAscii("ZoomProperties"), 
SID_ATTR_ZOOM,SID_ATTR_ZOOM, aItemInfos, pDefaults) );
+                   pPool->SetDefaultMetric( SFX_MAPUNIT_100TH_MM );    // 
ripped, don't understand why
+                   pPool->FreezeIdRanges();                                    
        // the same
+
+                   ::std::auto_ptr<SfxItemSet> pDescriptor(new 
SfxItemSet(*pPool, pRanges));
+                   // fill it
+            pDescriptor->Put(SvxZoomItem( SVX_ZOOM_PERCENT, m_nZoomValue, 
SID_ATTR_ZOOM ));
+
+            ::std::auto_ptr<AbstractSvxZoomDialog> pDlg( 
pFact->CreateSvxZoomDialog(NULL, *pDescriptor.get(), RID_SVXDLG_ZOOM) );
+                   DBG_ASSERT(pDlg.get(), "Dialogdiet fail!");//CHINA001
+                   pDlg->SetLimits( 20, 400 );
+                   pDlg->HideButton( ZOOMBTN_OPTIMAL );
+            pDlg->HideButton( ZOOMBTN_PAGEWIDTH );
+            pDlg->HideButton( ZOOMBTN_WHOLEPAGE );
+                   bool bCancel = ( RET_CANCEL == pDlg->Execute() );
+
+                   if ( !bCancel )
+                   {
+                           const SvxZoomItem&  rZoomItem = (const 
SvxZoomItem&)pDlg->GetOutputItemSet()->Get( SID_ATTR_ZOOM );
+                           m_nZoomValue = rZoomItem.GetValue();
+                impl_zoom_nothrow();
+                   } // if ( !bCancel )
+        }
+        catch(uno::Exception&)
+           {
+            DBG_UNHANDLED_EXCEPTION();
+           }
+
+       for (sal_uInt16 i=0; i<sizeof(pDefaults)/sizeof(pDefaults[0]); ++i)
+               delete pDefaults[i];
+       } // if(pFact)
+}
+// 
-----------------------------------------------------------------------------

File [changed]: ReportSection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportSection.cxx?r1=1.12&r2=1.12.2.1
Delta lines:  +22 -10
---------------------
--- ReportSection.cxx   2008-08-19 10:17:07+0000        1.12
+++ ReportSection.cxx   2008-10-16 09:45:51+0000        1.12.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportSection.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -63,6 +63,9 @@
 
 #include <connectivity/dbtools.hxx>
 
+#include <vcl/lineinfo.hxx>
+#include "ColorChanger.hxx"
+
 #include <svtools/itempool.hxx>
 #include <svtools/extcolorcfg.hxx>
 #include <unotools/confignode.hxx>
@@ -101,7 +104,6 @@
     EnableChildTransparentMode();
        SetHelpId(HID_REPORTSECTION);
        SetMapMode( MapMode( MAP_100TH_MM ) );
-    EnableMapMode();
     
        try
        {
@@ -114,7 +116,6 @@
 
     m_pFunc.reset(new DlgEdFuncSelect( this ));
     m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( /* 
m_pParent->getViewsWindow()->getView()->getReportView()->getController().getORB()
 */ ) );
-       Show();
 }
 
//------------------------------------------------------------------------------
 OReportSection::~OReportSection()
@@ -140,6 +141,8 @@
 
//------------------------------------------------------------------------------
 void OReportSection::Paint( const Rectangle& rRect )
 {
+    Window::Paint(rRect);
+
        if ( m_pView )
        {
          // repaint, get PageView and prepare Region
@@ -166,16 +169,14 @@
             pPgView->GetView().EndDrawLayers(*pTargetPaintWindow);
         }
 
-               
-               const Region aReg(rRect);
-               m_pView->CompleteRedraw(this,aReg);
+               m_pView->CompleteRedraw(this,aPaintRectRegion);
        }
 }
 
//------------------------------------------------------------------------------
 void OReportSection::Resize()
 {
        Window::Resize();
-       if ( m_xSection.is() && m_pPage && m_pView )
+       if ( false && m_xSection.is() && m_pPage && m_pView )
        {
                uno::Reference<report::XReportDefinition> xReportDefinition = 
m_xSection->getReportDefinition();
                m_pPage->SetSize( Size( 
getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight())
 );
@@ -230,7 +231,18 @@
        m_pView->SetDesignMode( TRUE ); 
 
        m_pView->StartListening( *m_pModel  );
-       Resize();
+       /*Resize();*/
+    if ( m_xSection.is() && m_pPage && m_pView )
+       {
+               uno::Reference<report::XReportDefinition> xReportDefinition = 
m_xSection->getReportDefinition();
+               m_pPage->SetSize( Size( 
getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width,5*m_xSection->getHeight())
 );
+               const Size aPageSize = m_pPage->GetSize();
+               const sal_Int32 nLeftMargin = 
getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
+               const sal_Int32 nRightMargin = 
getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
+               m_pView->SetWorkArea( Rectangle( Point( nLeftMargin, 0), 
Size(aPageSize.Width() - nLeftMargin - nRightMargin,aPageSize.Height()) ) );
+       } // if ( m_xSection.is() && m_pPage && m_pView )
+
+    //SetBackground( Wallpaper( COL_BLUE ));
 }
 // 
-----------------------------------------------------------------------------
 void OReportSection::Paste(const uno::Sequence< beans::NamedValue >& 
_aAllreadyCopiedObjects,bool _bForce)

File [changed]: ReportWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportWindow.cxx?r1=1.9&r2=1.9.2.1
Delta lines:  +51 -41
---------------------
--- ReportWindow.cxx    2008-08-19 10:17:21+0000        1.9
+++ ReportWindow.cxx    2008-10-16 09:45:51+0000        1.9.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportWindow.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -134,7 +134,6 @@
        
        m_aViewsWindow.addSection(_xSection,_sColorEntry,_nPosition);   
        
-       Resize();
        m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
 }
 
//------------------------------------------------------------------------------
@@ -152,11 +151,11 @@
 
//------------------------------------------------------------------------------
 sal_Int32 OReportWindow::getMaxMarkerWidth(sal_Bool _bWithEnd) const
 {
-    Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
-    aStartWith *= m_aViewsWindow.GetMapMode().GetScaleX();
+    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    aStartWidth *= m_aViewsWindow.GetMapMode().GetScaleX();
     if ( _bWithEnd )
-        aStartWith += Fraction(long(REPORT_ENDMARKER_WIDTH));
-       return sal_Int32((long)aStartWith);
+        aStartWidth += Fraction(long(REPORT_ENDMARKER_WIDTH));
+       return sal_Int32((long)aStartWidth);
 }
 
//------------------------------------------------------------------------------
 sal_Int32 OReportWindow::GetTotalWidth() const
@@ -164,11 +163,14 @@
        sal_Int32 nWidth = 0;
        if ( !m_aViewsWindow.empty() )
        {
-        Fraction aStartWith(long(REPORT_ENDMARKER_WIDTH + 
REPORT_STARTMARKER_WIDTH));
-        aStartWith *= m_aViewsWindow.GetMapMode().GetScaleX();
+        Fraction aStartWidth(long(REPORT_ENDMARKER_WIDTH + 
REPORT_STARTMARKER_WIDTH ));
+        const Fraction aZoom(m_pView->getController().getZoomValue(),100);
+        aStartWidth *= aZoom; // m_aViewsWindow.GetMapMode().GetScaleX();;
                const sal_Int32 nPaperWidth = 
getStyleProperty<awt::Size>(m_pView->getController().getReportDefinition(),PROPERTY_PAPERSIZE).Width;
-               const Size aPageSize = 
m_aViewsWindow.LogicToPixel(Size(nPaperWidth,0));
-               nWidth = aPageSize.Width() + long(aStartWith);
+        Fraction aPaperWidth(nPaperWidth,1);
+        aPaperWidth *= aZoom;
+               const Size aPageSize = LogicToPixel(Size(aPaperWidth,0));
+               nWidth = aPageSize.Width() + long(aStartWidth);
        }
        return nWidth; 
 }
@@ -179,16 +181,17 @@
        if ( !m_aViewsWindow.empty() )
        {
                const Size aTotalOutputSize = GetOutputSizePixel();
-        Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
-        aStartWith *= m_aViewsWindow.GetMapMode().GetScaleX();
+        Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+        const Fraction aZoom(m_pView->getController().getZoomValue(),100);
+        aStartWidth *= aZoom;
 
-               const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 
SECTION_OFFSET ), MAP_APPFONT );
-               Point aStartPoint((long)aStartWith + aOffset.X(),0);
+               const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), 
MAP_APPFONT );
+               Point aStartPoint((long)aStartWidth + aOffset.X(),0);
                uno::Reference<report::XReportDefinition> xReportDefinition = 
getReportView()->getController().getReportDefinition();
                const sal_Int32 nPaperWidth = 
getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width;
                sal_Int32 nLeftMargin = 
getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_LEFTMARGIN);
                sal_Int32 nRightMargin = 
getStyleProperty<sal_Int32>(xReportDefinition,PROPERTY_RIGHTMARGIN);
-               Size aPageSize  = 
m_aViewsWindow.LogicToPixel(Size(nPaperWidth,0));
+               Size aPageSize  = m_aViewsWindow.LogicToPixel(Size(nPaperWidth 
,0));
                nLeftMargin     = 
m_aViewsWindow.LogicToPixel(Size(nLeftMargin,0)).Width();
                nRightMargin    = 
m_aViewsWindow.LogicToPixel(Size(nRightMargin,0)).Width();
 
@@ -211,9 +214,9 @@
        }
 }
 
//------------------------------------------------------------------------------
-Point OReportWindow::getScrollOffset() const
+Point OReportWindow::getThumbPos() const
 {
-       return m_pParent->getScrollOffset();
+       return m_pParent->getThumbPos();
 }
 
//------------------------------------------------------------------------------
 void OReportWindow::ImplInitSettings()
@@ -235,22 +238,24 @@
 
//------------------------------------------------------------------------------
 sal_Int32 OReportWindow::GetTotalHeight() const
 {
-       return m_aHRuler.GetSizePixel().Height() + 
m_aViewsWindow.getTotalHeight();
+       return m_aViewsWindow.getTotalHeight();
+    /*Size aHeight(PixelToLogic(Size(0,m_aViewsWindow.getTotalHeight())));
+    Fraction aH(aHeight.Height());
+    const Fraction aZoom(m_pView->getController().getZoomValue(),100);
+    aH *= aZoom;
+    return aH;*/
 }
 
//------------------------------------------------------------------------------
-void OReportWindow::ScrollChildren(long nDeltaX, long nDeltaY)
+void OReportWindow::ScrollChildren(const Point& _aThumbPos)
 {
-    if ( nDeltaX )
-    {
            MapMode aMap = m_aHRuler.GetMapMode();
            Point aOrg( aMap.GetOrigin() );
-           aMap.SetOrigin( Point(aOrg.X() - nDeltaX, aOrg.Y()));
+    aMap.SetOrigin( Point(- _aThumbPos.X(), aOrg.Y()));
            m_aHRuler.SetMapMode( aMap );
-           m_aHRuler.Scroll(-nDeltaX,0);
-    }
+    m_aHRuler.Scroll(-(aOrg.X() + _aThumbPos.X()),0);
 
-       
-    m_aViewsWindow.scrollChildren(nDeltaX,nDeltaY);
+    /*const Point aPos(PixelToLogic(_aThumbPos));*/
+    m_aViewsWindow.scrollChildren(_aThumbPos);
 }
 //----------------------------------------------------------------------------
 USHORT OReportWindow::getSectionCount() const
@@ -258,11 +263,9 @@
        return m_aViewsWindow.getSectionCount();
 }
 //----------------------------------------------------------------------------
-void OReportWindow::notifyHeightChanged()
+void OReportWindow::notifySizeChanged()
 {
        m_pParent->setTotalSize(GetTotalWidth(),GetTotalHeight());
-    //Resize();
-    //Invalidate(INVALIDATE_TRANSPARENT);
 }
 //----------------------------------------------------------------------------
 BOOL OReportWindow::HasSelection()
@@ -371,7 +374,6 @@
 // 
-----------------------------------------------------------------------------
 void OReportWindow::setDragStripes(BOOL bOn)
 {
-    
     m_aViewsWindow.setDragStripes(bOn);
 }
 // 
-----------------------------------------------------------------------------
@@ -385,13 +387,21 @@
     return m_aViewsWindow.getMarkedObjectCount();
 }
 // 
-----------------------------------------------------------------------------
-void OReportWindow::zoom(const sal_Int16 _nZoom)
+void OReportWindow::zoom(const Fraction& _aZoom)
 {
-    m_aHRuler.SetZoom(Fraction(_nZoom,100));
+    m_aHRuler.SetZoom(_aZoom);
     m_aHRuler.Invalidate();
     
-    m_aViewsWindow.zoom(_nZoom);
-    notifyHeightChanged();
+    notifySizeChanged();
+    
+    const Point aNewThumbPos( m_pParent->getThumbPos() );
+
+    setZoomFactor(_aZoom,*this);
+    m_aViewsWindow.zoom(_aZoom);
+
+    notifySizeChanged();
+
+    ScrollChildren( aNewThumbPos );
     Resize();
     
     Invalidate(INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | 
INVALIDATE_TRANSPARENT);

File [changed]: ScrollHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ScrollHelper.cxx?r1=1.9&r2=1.9.2.1
Delta lines:  +22 -59
---------------------
--- ScrollHelper.cxx    2008-08-19 10:17:34+0000        1.9
+++ ScrollHelper.cxx    2008-10-16 09:45:51+0000        1.9.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ScrollHelper.cxx,v $
- * $Revision: 1.9 $
+ * $Revision: 1.9.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -46,13 +46,11 @@
 using namespace ::com::sun::star;
 
 // 
-----------------------------------------------------------------------------
-void lcl_setScrollBar(sal_Int32 _nNewValue,sal_Int32 _nOffSet,const Point& 
_aPos,const Size& _aSize,ScrollBar& _rScrollBar)
+void lcl_setScrollBar(sal_Int32 _nNewValue,const Point& _aPos,const Size& 
_aSize,ScrollBar& _rScrollBar)
 {
     _rScrollBar.SetPosSizePixel(_aPos,_aSize);
        _rScrollBar.SetPageSize( _nNewValue );
        _rScrollBar.SetVisibleSize( _nNewValue );
-    (void)_nOffSet;
-       //_rScrollBar.SetThumbPos( -_nOffSet );
 }
 
 // 
-----------------------------------------------------------------------------
@@ -97,6 +95,7 @@
     aStyle.SetDragFullOptions( aStyle.GetDragFullOptions() | 
DRAGFULL_OPTION_SCROLL ); // live scrolling
     aSettings.SetStyleSettings( aStyle );
     _rScrollBar.SetSettings( aSettings );
+    //_rScrollBar.SetMapMode( MapMode( MAP_100TH_MM ) );
 
        _rScrollBar.SetScrollHdl( LINK( this, OScrollWindowHelper, ScrollHdl ) 
);
     _rScrollBar.SetLineSize( SCR_LINE_SIZE ); 
@@ -115,16 +114,12 @@
 {
     m_aTotalPixelSize.Width() = _nWidth;
        m_aTotalPixelSize.Height() = _nHeight;
-    m_aHScroll.SetRangeMax( m_aTotalPixelSize.Width() );
+
+    // now set the ranges without start marker
+    Fraction aStartWidth(REPORT_STARTMARKER_WIDTH * 
m_pParent->getController().getZoomValue(),100);
+    long nWidth = long(_nWidth - (double)aStartWidth);
+    m_aHScroll.SetRangeMax( nWidth );
     m_aVScroll.SetRangeMax( m_aTotalPixelSize.Height() );
-    /*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();
-               impl_scrollContent( -nX, -nY );
-        m_aPixOffset = aNewPixOffset;
-       }*/
     
        Resize();
 }
@@ -136,6 +131,7 @@
     if ( aOutPixSz.Width() == 0 || aOutPixSz.Height() == 0 )
         return aOutPixSz;
 
+    aOutPixSz.Height() -= m_aReportWindow.getRulerHeight();
        // determine the size of the output-area and if we need scrollbars
        const long nScrSize = 
GetSettings().GetStyleSettings().GetScrollBarSize();
        bool bVVisible = false; // by default no vertical-ScrollBar
@@ -164,7 +160,7 @@
        }
        while ( bChanged );   // until no visibility has changed
 
-       const Point aOldPixOffset( m_aPixOffset );
+    aOutPixSz.Height() += m_aReportWindow.getRulerHeight();
 
        // show or hide scrollbars
        m_aVScroll.Show( bVVisible );
@@ -182,66 +178,32 @@
        const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 
SECTION_OFFSET ), MAP_APPFONT );
        // resize scrollbars and set their ranges
        {       
-        Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
+        Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
         const Fraction aZoom(m_pParent->getController().getZoomValue(),100);
-        aStartWith *= aZoom;
+        aStartWidth *= aZoom;
 
-        const sal_Int32 nOldThumbPos = m_aHScroll.GetThumbPos();
-               const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X();
-        lcl_setScrollBar(nNewWidth,m_aPixOffset.X(),Point( (long)aStartWith + 
aOffset.X(), aOutPixSz.Height() ),Size( aOutPixSz.Width() - long(aStartWith), 
nScrSize ),m_aHScroll);
-        m_aPixOffset.X() += nOldThumbPos - m_aHScroll.GetThumbPos();
+               const sal_Int32 nNewWidth = aOutPixSz.Width() - aOffset.X() - 
(long)aStartWidth;
+        lcl_setScrollBar(nNewWidth,Point( (long)aStartWidth + aOffset.X(), 
aOutPixSz.Height() ),Size( nNewWidth, nScrSize ),m_aHScroll);
        }
        {
-        const sal_Int32 nOldThumbPos = m_aVScroll.GetThumbPos();
                const sal_Int32 nNewHeight = aOutPixSz.Height() - 
m_aReportWindow.getRulerHeight();
-        lcl_setScrollBar(nNewHeight,m_aPixOffset.Y(),Point( aOutPixSz.Width(), 
m_aReportWindow.getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll);
-        m_aPixOffset.Y() += nOldThumbPos - m_aVScroll.GetThumbPos();
+        lcl_setScrollBar(nNewHeight,Point( aOutPixSz.Width(), 
m_aReportWindow.getRulerHeight() ),Size( nScrSize,nNewHeight),m_aVScroll);
        }
 
-       // select the shifted map-mode
-       if ( m_aPixOffset != aOldPixOffset )
-       {
-               const long nX = m_aPixOffset.X() - aOldPixOffset.X();
-               const long nY = m_aPixOffset.Y() - aOldPixOffset.Y();
-               impl_scrollContent( -nX, -nY );
-       }
        return aOutPixSz;
 }
 
//------------------------------------------------------------------------------
-void OScrollWindowHelper::impl_scrollContent( long nDeltaX, long nDeltaY )
-{
-       m_aReportWindow.ScrollChildren(nDeltaX,nDeltaY);
-}
-//------------------------------------------------------------------------------
 void OScrollWindowHelper::Resize()
 {
        OScrollWindowHelper_BASE::Resize();
- //   Size aSize = GetOutputSizePixel();
- //   const Size aMinSize(getMaxMarkerWidth(sal_False),0);
- //   bool bResize = false;
-       //if( aSize.Width() < aMinSize.Width() )
-       //{
-       //      aSize.setWidth( aMinSize.Width() );
-       //      bResize = true;
-       //}
-       //if( aSize.Height() < aMinSize.Height() )
-       //{
-       //      aSize.setHeight( aMinSize.Height() );
-       //      bResize = true;
-       //}
-       //if( bResize )
- //   {
- //       
//static_cast<SplitWindow*>(GetParent())->SetItemSize(2,aSize.getWidth());
-       //      SetOutputSizePixel( aSize );
- //   }
        const Size aTotalOutputSize = ResizeScrollBars();
 
-       m_aReportWindow.SetPosSizePixel(Point( 0, 0 ),Size( 
aTotalOutputSize.Width(), aTotalOutputSize.Height()));
+       m_aReportWindow.SetPosSizePixel(Point( 0, 0 ),aTotalOutputSize);
 }
 
//------------------------------------------------------------------------------
 IMPL_LINK( OScrollWindowHelper, ScrollHdl, ScrollBar*, /*pScroll*/ )
 {
-       impl_scrollContent( m_aHScroll.GetDelta(), m_aVScroll.GetDelta() );
+    m_aReportWindow.ScrollChildren( getThumbPos() );
     return 0;
 }
 
//------------------------------------------------------------------------------
@@ -416,7 +378,7 @@
 // 
-----------------------------------------------------------------------------
 void OScrollWindowHelper::_propertyChanged(const beans::PropertyChangeEvent& 
/*_rEvent*/) throw( uno::RuntimeException)
 {
-    m_aReportWindow.notifyHeightChanged();
+    m_aReportWindow.notifySizeChanged();
 }
 // 
-----------------------------------------------------------------------------
 void OScrollWindowHelper::setGridSnap(BOOL bOn)
@@ -439,9 +401,10 @@
     return m_aReportWindow.getMarkedObjectCount();
 }
 // 
-----------------------------------------------------------------------------
-void OScrollWindowHelper::zoom(const sal_Int16 _nZoom)
+void OScrollWindowHelper::zoom(const Fraction& _aZoom)
 {
-    m_aReportWindow.zoom(_nZoom);
+    m_aReportWindow.zoom(_aZoom);
+    Resize();
     Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
 }
 // 
-----------------------------------------------------------------------------

File [changed]: SectionWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/SectionWindow.cxx?r1=1.3&r2=1.3.2.1
Delta lines:  +47 -37
---------------------
--- SectionWindow.cxx   2008-08-22 13:57:02+0000        1.3
+++ SectionWindow.cxx   2008-10-16 09:45:51+0000        1.3.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: SectionWindow.cxx,v $
- * $Revision: 1.3 $
+ * $Revision: 1.3.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -68,23 +68,26 @@
 {
     DBG_CTOR( rpt_OSectionWindow,NULL);
        SetUniqueId(UID_RPT_SECTIONSWINDOW);
-       SetMapMode( MapMode( MAP_100TH_MM ) );
-    EnableMapMode();
+    const MapMode& rMapMode = _pParent->GetMapMode();
+       SetMapMode( rMapMode );
        ImplInitSettings();
-
     // TRY
     m_aSplitter.SetMapMode( MapMode( MAP_100TH_MM ) );
-    m_aSplitter.EnableMapMode();
-
     m_aSplitter.SetStartSplitHdl(LINK(this, OSectionWindow,StartSplitHdl));
        m_aSplitter.SetSplitHdl(LINK(this, OSectionWindow,SplitHdl));
        m_aSplitter.SetEndSplitHdl(LINK(this, OSectionWindow,EndSplitHdl));
     m_aSplitter.SetBackground( Wallpaper( 
Application::GetSettings().GetStyleSettings().GetFaceColor() ));
     
m_aSplitter.SetSplitPosPixel(m_aSplitter.LogicToPixel(Size(0,_xSection->getHeight())).Height());
-       m_aSplitter.Show();
+       
     
     m_aStartMarker.setCollapsedHdl(LINK(this,OSectionWindow,Collapsed));
 
+    m_aStartMarker.zoom(rMapMode.GetScaleX());
+    setZoomFactor(rMapMode.GetScaleX(),m_aReportSection);
+    setZoomFactor(rMapMode.GetScaleX(),m_aSplitter);
+    setZoomFactor(rMapMode.GetScaleX(),m_aEndMarker);
+
+    m_aSplitter.Show();
        m_aStartMarker.Show();
        m_aReportSection.Show();
        m_aEndMarker.Show();
@@ -135,7 +138,7 @@
         {
             m_pParent->getView()->SetUpdateMode(FALSE);
             Resize();
-               m_pParent->getView()->notifyHeightChanged();
+               m_pParent->getView()->notifySizeChanged();
                m_pParent->resize(*this);
             m_pParent->getView()->SetUpdateMode(TRUE);
                m_aStartMarker.Invalidate(INVALIDATE_NOERASE);
@@ -178,7 +181,7 @@
 void OSectionWindow::ImplInitSettings()
 {
        SetBackground( );
-    // SetBackground( Wallpaper( COL_RED ));
+    //SetBackground( Wallpaper( COL_RED ));
 }
 //-----------------------------------------------------------------------------
 void OSectionWindow::DataChanged( const DataChangedEvent& rDCEvt )
@@ -197,14 +200,12 @@
 {
        Window::Resize();       
        
-       //const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 
SECTION_OFFSET ), MAP_APPFONT );
-
     Size aOutputSize = GetOutputSizePixel();
     Fraction aEndWidth(long(REPORT_ENDMARKER_WIDTH));
     aEndWidth *= GetMapMode().GetScaleX();
 
-    const Point aOffset = m_pParent->getView()->getScrollOffset();
-    aOutputSize.Width() -= aOffset.X();
+    const Point aThumbPos = m_pParent->getView()->getThumbPos();
+    aOutputSize.Width() -= aThumbPos.X();
     aOutputSize.Height() -=  m_aSplitter.GetSizePixel().Height();
 
        if ( m_aStartMarker.isCollapsed() )
@@ -214,7 +215,7 @@
        }
     else
        {       
-        const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= 
(aOffset.X() +  aOutputSize.Width() );
+        const bool bShowEndMarker = m_pParent->getView()->GetTotalWidth() <= 
(aThumbPos.X() +  aOutputSize.Width() );
         
         Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
         aStartWidth *= GetMapMode().GetScaleX();
@@ -229,6 +230,7 @@
         aSectionSize.Width() = aOutputSize.Width() - (long)aStartWidth;
         if ( bShowEndMarker )
             aSectionSize.Width() -= (long)aEndWidth;
+
         m_aReportSection.SetPosSizePixel(aReportPos,aSectionSize);
 
         // set splitter
@@ -248,7 +250,7 @@
 void OSectionWindow::setCollapsed(sal_Bool _bCollapsed)
 {
     m_aReportSection.Show(_bCollapsed);
-       m_aEndMarker.Show/*setCollapsed*/(_bCollapsed);
+       m_aEndMarker.Show(_bCollapsed);
     m_aSplitter.Show(_bCollapsed);
 }
 //-----------------------------------------------------------------------------
@@ -278,14 +280,15 @@
        return 0L;
 }
 // 
-----------------------------------------------------------------------------
-void OSectionWindow::zoom(const sal_Int16 _nZoom)
+void OSectionWindow::zoom(const Fraction& _aZoom)
 {
-    setZoomFactor(_nZoom,*this);
-    m_aStartMarker.zoom(_nZoom);
-    setZoomFactor(_nZoom,m_aReportSection);
-    setZoomFactor(_nZoom,m_aSplitter);
-    setZoomFactor(_nZoom,m_aEndMarker);
-    Resize();
+    setZoomFactor(_aZoom,*this);
+    m_aStartMarker.zoom(_aZoom);
+
+    setZoomFactor(_aZoom,m_aReportSection);
+    setZoomFactor(_aZoom,m_aSplitter);
+    setZoomFactor(_aZoom,m_aEndMarker);
+    //Resize();
     Invalidate(/*INVALIDATE_UPDATE |*/ /* | INVALIDATE_TRANSPARENT 
*//*INVALIDATE_NOCHILDREN*/);
 }
 //-----------------------------------------------------------------------------
@@ -338,34 +341,41 @@
        return 0L;
 }
 // 
-----------------------------------------------------------------------------
-void lcl_scroll(Window& _rWindow,const Size& _aDelta)
+void lcl_scroll(Window& _rWindow,const Point& _aDelta)
 {
-    
_rWindow.Scroll(-_aDelta.Width(),-_aDelta.Height(),SCROLL_CHILDREN/*|SCROLL_CLIP*/);
+    
_rWindow.Scroll(-_aDelta.X(),-_aDelta.Y()/*,SCROLL_CHILDREN*//*|SCROLL_CLIP*/);
     _rWindow.Invalidate(INVALIDATE_TRANSPARENT);
 }
 // 
-----------------------------------------------------------------------------
-void lcl_setMapMode(Window& _rWindow,long _nDeltaX, long _nDeltaY)
+void lcl_setOrigin(Window& _rWindow,long _nX, long _nY)
 {
     MapMode aMap = _rWindow.GetMapMode();
-       Point aOrg = aMap.GetOrigin();
-       aMap.SetOrigin( Point(aOrg.X() - _nDeltaX, aOrg.Y() - _nDeltaY));
+       aMap.SetOrigin( Point(- _nX, - _nY));
        _rWindow.SetMapMode( aMap );
 }
 //----------------------------------------------------------------------------
-void OSectionWindow::scrollChildren(long _nDeltaX)
+void OSectionWindow::scrollChildren(long _nX)
 {
-    const Size aDelta( PixelToLogic(Size(_nDeltaX,0)) );
-    lcl_setMapMode(m_aReportSection,aDelta.Width(), 0);
+    const Point aDelta( _nX,0 );
+
+    MapMode aMapMode( m_aReportSection.GetMapMode() );
+    const Point aOld = aMapMode.GetOrigin();
+    lcl_setOrigin(m_aReportSection,aDelta.X(), 0);
+
+    aMapMode = m_aReportSection.GetMapMode();
+    const Point aNew = aMapMode.GetOrigin();
+    const Point aDiff = aOld - aNew;
     {
-        OWindowPositionCorrector aCorrector(&m_aReportSection,-_nDeltaX,0);
-        lcl_scroll(m_aReportSection,aDelta);
+        //OWindowPositionCorrector 
aCorrector(&m_aReportSection,-aDelta.Width(),0);
+        lcl_scroll(m_aReportSection,aDiff);
     }
+    DBG_TRACE("OJ: scrollChildren end\n");
     
-    // lcl_setMapMode(m_aEndMarker,_nDeltaX, 0);
-    lcl_scroll(m_aEndMarker,aDelta);
+    //lcl_setOrigin(m_aEndMarker,_nDeltaX, 0);
+    lcl_scroll(m_aEndMarker,m_aEndMarker.PixelToLogic(Point(_nX,0)));
 
-    lcl_setMapMode(m_aSplitter,_nDeltaX, 0);
-    lcl_scroll(m_aSplitter,aDelta);
+    lcl_setOrigin(m_aSplitter,_nX, 0);
+    lcl_scroll(m_aSplitter,aDiff);
 
     Resize();
 }

File [changed]: StartMarker.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/StartMarker.cxx?r1=1.8&r2=1.8.2.1
Delta lines:  +16 -19
---------------------
--- StartMarker.cxx     2008-08-19 10:18:24+0000        1.8
+++ StartMarker.cxx     2008-10-16 09:45:51+0000        1.8.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: StartMarker.cxx,v $
- * $Revision: 1.8 $
+ * $Revision: 1.8.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -45,7 +45,6 @@
 #include <svtools/smplhint.hxx>
 
 #define CORNER_SPACE    5
-#define TEXT_WIDTH             10
 
 //=====================================================================
 namespace rptui
@@ -64,7 +63,7 @@
 : OColorListener(_pParent,_sColorEntry)
 ,m_aVRuler(this,WB_VERT)
 ,m_aText(this,WB_HYPHENATION)
-,m_aImage(this,WB_LEFT|WB_TOP)
+,m_aImage(this,WB_LEFT|WB_TOP|WB_SCALE)
 ,m_pParent(_pParent)
 ,m_bShowRuler(sal_True)
 {
@@ -177,7 +176,7 @@
        const Size aOutputSize = GetOutputSizePixel();
        if( aPos.X() > aOutputSize.Width() || aPos.Y() > aOutputSize.Height() )
                return;
-    Rectangle aRect(m_aImage.GetPosPixel(),m_aImage.GetImage().GetSizePixel());
+    Rectangle aRect(m_aImage.GetPosPixel(),m_aImage.GetSizePixel());
        if ( rMEvt.GetClicks() == 2 || aRect.IsInside( aPos ) )
        {
                m_bCollapsed = !m_bCollapsed;
@@ -237,25 +236,25 @@
        const long nOutputWidth  = aOutputSize.Width();
        const long nOutputHeight = aOutputSize.Height();
 
+    const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
+    const Point aRulerPos(nOutputWidth - nVRulerWidth,0);
+    m_aVRuler.SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
+
     Size aImageSize = m_aImage.GetImage().GetSizePixel();
     const MapMode& rMapMode = GetMapMode();
     aImageSize.Width() = long(aImageSize.Width() * 
(double)rMapMode.GetScaleX());
     aImageSize.Height() = long(aImageSize.Height() * 
(double)rMapMode.GetScaleY());
-    const long nVRulerWidth = m_aVRuler.GetSizePixel().Width();
-    const Point aRulerPos(nOutputWidth - nVRulerWidth/* - 5*/,0);
+
     Fraction aExtraWidth(long(REPORT_EXTRA_SPACE));
     aExtraWidth *= rMapMode.GetScaleX();
 
     Point aPos(aImageSize.Width() + (long)(aExtraWidth + aExtraWidth), 
aExtraWidth);
-
-    m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - 
aPos.X(),::std::max<sal_Int32>(nOutputHeight - 
2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height())));
+    const long nHeight = ::std::max<sal_Int32>(nOutputHeight - 
2*aPos.Y(),LogicToPixel(Size(0,m_aText.GetTextHeight())).Height());
+    m_aText.SetPosSizePixel(aPos,Size(aRulerPos.X() - aPos.X(),nHeight));
 
     aPos.X() = aExtraWidth;
     aPos.Y() += 
static_cast<sal_Int32>((LogicToPixel(Size(0,m_aText.GetTextHeight())).Height() 
- aImageSize.Height()) * 0.5) ;
-    m_aImage.SetPosSizePixel(aPos,aImageSize);/*Size(aImageSize.Width() + 
(long)aExtraWidth,aImageSize.Height() + (long)aExtraWidth));*/
-    //m_aImage.SetPosPixel(aPos);
-
-    m_aVRuler.SetPosSizePixel(aRulerPos,Size(nVRulerWidth,nOutputHeight));
+    m_aImage.SetPosSizePixel(aPos,aImageSize);
 }
 // 
-----------------------------------------------------------------------------
 void OStartMarker::setTitle(const String& _sTitle)
@@ -314,13 +313,11 @@
     showRuler(_bCollapsed);
 }
 // -----------------------------------------------------------------------
-void OStartMarker::zoom(const sal_Int16 _nZoom)
+void OStartMarker::zoom(const Fraction& _aZoom)
 {
-    setZoomFactor(_nZoom,*this);
-    m_aVRuler.SetZoom(Fraction(_nZoom,100));
-    // setZoomFactor(_nZoom,m_aVRuler);
-    setZoomFactor(_nZoom,m_aText);
-    setZoomFactor(_nZoom,m_aImage);
+    setZoomFactor(_aZoom,*this);
+    m_aVRuler.SetZoom(_aZoom);
+    setZoomFactor(_aZoom,m_aText);
     Resize();
     Invalidate();
 }

File [changed]: ViewsWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ViewsWindow.cxx?r1=1.11&r2=1.11.2.1
Delta lines:  +49 -48
---------------------
--- ViewsWindow.cxx     2008-08-19 10:18:37+0000        1.11
+++ ViewsWindow.cxx     2008-10-16 09:45:51+0000        1.11.2.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ViewsWindow.cxx,v $
- * $Revision: 1.11 $
+ * $Revision: 1.11.2.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -189,7 +189,6 @@
     SetPaintTransparent(TRUE);
        SetUniqueId(UID_RPT_VIEWSWINDOW);
        SetMapMode( MapMode( MAP_100TH_MM ) );
-    EnableMapMode();
        StartListening(m_aColorConfig);
        ImplInitSettings();
 }
@@ -251,11 +250,12 @@
             pSectionWindow->getStartMarker().Invalidate(INVALIDATE_NOERASE | 
INVALIDATE_NOCHILDREN | INVALIDATE_TRANSPARENT );
         }
     } // for (;aIter != aEnd ; ++aIter,++nPos)
-    Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
-    aStartWith *= GetMapMode().GetScaleX();
+    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    aStartWidth *= GetMapMode().GetScaleX();
     Size aOut = GetOutputSizePixel();
-    aOut.Width() = aStartWith;
+    aOut.Width() = aStartWidth;
     aOut = PixelToLogic(aOut);
+    m_pParent->notifySizeChanged();
     
     Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
     Invalidate(aRect,INVALIDATE_NOERASE | INVALIDATE_NOCHILDREN | 
INVALIDATE_TRANSPARENT);
@@ -264,10 +264,9 @@
 void OViewsWindow::Resize()
 {
        Window::Resize();       
-       if ( m_aSections.empty() )
-               return;
-    
-    const Point aOffset = m_pParent->getScrollOffset();
+       if ( !m_aSections.empty() )
+    {
+        const Point aOffset(m_pParent->getThumbPos());
     Point aStartPoint(0,aOffset.Y());  
        TSectionsMap::iterator aIter = m_aSections.begin();
        TSectionsMap::iterator aEnd = m_aSections.end();
@@ -276,6 +275,7 @@
                const ::boost::shared_ptr<OSectionWindow> pSectionWindow = 
(*aIter);
         impl_resizeSectionWindow(*pSectionWindow.get(),aStartPoint,true);
        } // for (;aIter != aEnd ; ++aIter)
+    }
 }
 // 
-----------------------------------------------------------------------------
 void OViewsWindow::Paint( const Rectangle& rRect )
@@ -283,13 +283,13 @@
     Window::Paint( rRect );
     
     Size aOut = GetOutputSizePixel();
-    Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
-    aStartWith *= GetMapMode().GetScaleX();
+    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    aStartWidth *= GetMapMode().GetScaleX();
 
-    aOut.Width() -= (long)aStartWith;
+    aOut.Width() -= (long)aStartWidth;
     aOut = PixelToLogic(aOut);
     
-    Rectangle aRect(PixelToLogic(Point(aStartWith,0)),aOut);
+    Rectangle aRect(PixelToLogic(Point(aStartWidth,0)),aOut);
     Wallpaper aWall( 
m_aColorConfig.GetColorValue(::svtools::APPBACKGROUND).nColor );
     DrawWallpaper(aRect,aWall);
 }
@@ -317,7 +317,6 @@
 void OViewsWindow::addSection(const uno::Reference< report::XSection >& 
_xSection,const ::rtl::OUString& _sColorEntry,USHORT _nPosition)
 {
     ::boost::shared_ptr<OSectionWindow> pSectionWindow( new 
OSectionWindow(this,_xSection,_sColorEntry) );
-    
        m_aSections.insert(getIteratorAtPos(_nPosition) , 
TSectionsMap::value_type(pSectionWindow));
     
m_pParent->setMarked(&pSectionWindow->getReportSection().getSectionView(),m_aSections.size()
 == 1);
 
@@ -361,7 +360,6 @@
        {
                nHeight += (*aIter)->GetSizePixel().Height();
        }
-
        return nHeight;
 }
 //----------------------------------------------------------------------------
@@ -1735,53 +1733,56 @@
     }
 }
 // 
-----------------------------------------------------------------------------
-void OViewsWindow::zoom(const sal_Int16 _nZoom)
+void OViewsWindow::zoom(const Fraction& _aZoom)
 {
-    Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
-    aStartWith *= GetMapMode().GetScaleX();
+    const MapMode& aMapMode = GetMapMode();
 
-    setZoomFactor(_nZoom,*this);
+    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    if ( _aZoom < aMapMode.GetScaleX() )
+        aStartWidth *= aMapMode.GetScaleX();
+    else
+        aStartWidth *= _aZoom;
+
+    setZoomFactor(_aZoom,*this);
 
     TSectionsMap::iterator aIter = m_aSections.begin();
        TSectionsMap::iterator aEnd = m_aSections.end();
     for (;aIter != aEnd ; ++aIter)
        {
-        (*aIter)->zoom(_nZoom);
+        (*aIter)->zoom(_aZoom);
     } // for (;aIter != aEnd ; ++aIter)
 
     Resize();
     
     Size aOut = GetOutputSizePixel();
-    aOut.Width() = aStartWith;
+    aOut.Width() = aStartWidth;
     aOut = PixelToLogic(aOut);
     
     Rectangle aRect(PixelToLogic(Point(0,0)),aOut);
     Invalidate(aRect,/*INVALIDATE_NOERASE | */INVALIDATE_NOCHILDREN /*| 
INVALIDATE_TRANSPARENT*/);
 }
 //----------------------------------------------------------------------------
-void OViewsWindow::scrollChildren(long _nDeltaX, long _nDeltaY)
+void OViewsWindow::scrollChildren(const Point& _aThumbPos)
 {
-    const Size aDelta( PixelToLogic(Size(_nDeltaX,_nDeltaY)) );
-    if ( _nDeltaY )
+    const Point aPos(PixelToLogic(_aThumbPos));
     {
-        MapMode aMap = GetMapMode();
-           Point aOrg = aMap.GetOrigin();
-           aMap.SetOrigin( Point(aOrg.X() , aOrg.Y() - _nDeltaY));
-           SetMapMode( aMap );
-           OWindowPositionCorrector aCorrector(this,0,-_nDeltaY);
-           Scroll(0,-aDelta.Height(),SCROLL_CHILDREN);
+        const Point aPosY(m_pParent->PixelToLogic(_aThumbPos));
+        
+        MapMode aMapMode = GetMapMode();
+           const Point aOld = aMapMode.GetOrigin();
+           aMapMode.SetOrigin( Point(aOld.X() , - aPosY.Y()));
+           SetMapMode( aMapMode );
+           //OWindowPositionCorrector aCorrector(this,0,-( aOld.Y() + 
aPosY.Y()));
+           Scroll(0, -( aOld.Y() + aPosY.Y()),SCROLL_CHILDREN);
         Invalidate(INVALIDATE_NOCHILDREN|INVALIDATE_TRANSPARENT);
     }
 
-    if ( _nDeltaX )
-    {
         TSectionsMap::iterator aIter = m_aSections.begin();
            TSectionsMap::iterator aEnd = m_aSections.end();
         for (;aIter != aEnd ; ++aIter)
            {
-            (*aIter)->scrollChildren(_nDeltaX);
+        (*aIter)->scrollChildren(aPos.X());
         } // for (;aIter != aEnd ; ++aIter)
-    }
 }
 // 
-----------------------------------------------------------------------------
 void OViewsWindow::fillControlModelSelection(::std::vector< uno::Reference< 
uno::XInterface > >& _rSelection) const

File [changed]: dlgedfunc.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/dlgedfunc.cxx?r1=1.12.2.1&r2=1.12.2.2
Delta lines:  +6 -6
-------------------
--- dlgedfunc.cxx       2008-10-06 06:24:19+0000        1.12.2.1
+++ dlgedfunc.cxx       2008-10-16 09:45:51+0000        1.12.2.2
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: dlgedfunc.cxx,v $
- * $Revision: 1.12.2.1 $
+ * $Revision: 1.12.2.2 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -91,17 +91,17 @@
        OScrollWindowHelper* pScrollWindow = pReportWindow->getScrollWindow();
        
        Size aOut = pReportWindow->GetOutputSizePixel();
-    Fraction aStartWith(long(REPORT_STARTMARKER_WIDTH));
-    aStartWith *= m_pParent->GetMapMode().GetScaleX();
+    Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH));
+    aStartWidth *= m_pParent->GetMapMode().GetScaleX();
 
-       aOut.Width() -= (long)aStartWith;
+       aOut.Width() -= (long)aStartWidth;
        
-       Rectangle aOutRect( pScrollWindow->getScrollOffset(), aOut );
+       Rectangle aOutRect( pScrollWindow->getThumbPos(), aOut );
        aOutRect = m_pParent->PixelToLogic( aOutRect );
        //Rectangle aWorkArea = m_pParent->getView()->GetWorkArea();
     Point aGcc3WorkaroundTemporary;
     Rectangle 
aWorkArea(aGcc3WorkaroundTemporary,pScrollWindow->getTotalSize());
-    aWorkArea.Right() -= (long)aStartWith;
+    aWorkArea.Right() -= (long)aStartWidth;
        aWorkArea = pScrollWindow->PixelToLogic( aWorkArea );
        if( !aOutRect.IsInside( rPos ) && aWorkArea.IsInside( rPos ) )
        {




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

Reply via email to