Tag: cws_src680_oj14
User: oj      
Date: 2007-06-05 11:45:48+0000
Modified:
   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/SectionView.cxx
   dba/reportdesign/source/ui/report/ViewsWindow.cxx

Log:
 #i78101# #i78098# change order of rpt and page header/footer

File Changes:

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.1.2.8&r2=1.1.2.9
Delta lines:  +7 -2
-------------------
--- DesignView.cxx      2007-05-30 16:24:46+0000        1.1.2.8
+++ DesignView.cxx      2007-06-05 11:45:43+0000        1.1.2.9
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: DesignView.cxx,v $
  *
- *  $Revision: 1.1.2.8 $
+ *  $Revision: 1.1.2.9 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/30 16:24:46 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -730,6 +730,11 @@
 {
     return m_pPropWin && m_pPropWin->HasChildPathFocus();
 }
+// 
-----------------------------------------------------------------------------
+sal_uInt32 ODesignView::getMarkedObjectCount() const
+{
+    return m_pScrollWindow ? m_pScrollWindow->getMarkedObjectCount() : 0;
+}
 //============================================================================
 } // rptui
 //============================================================================

File [changed]: ReportController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportController.cxx?r1=1.1.2.20&r2=1.1.2.21
Delta lines:  +33 -33
---------------------
--- ReportController.cxx        2007-05-30 16:24:46+0000        1.1.2.20
+++ ReportController.cxx        2007-06-05 11:45:43+0000        1.1.2.21
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ReportController.cxx,v $
  *
- *  $Revision: 1.1.2.20 $
+ *  $Revision: 1.1.2.21 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/30 16:24:46 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -510,10 +510,7 @@
         case SID_OBJECT_GREATESTHEIGHT:
             aReturn.bEnabled = isEditable() && m_pMyOwnView->HasSelection() && 
m_pMyOwnView->isAlignPossible();
             if ( aReturn.bEnabled )
-            {
-                OSectionView* pSectionView = getCurrentSectionView();
-                aReturn.bEnabled = pSectionView && 
pSectionView->GetMarkedObjectCount() > 1;
-            }
+                aReturn.bEnabled = m_pMyOwnView->getMarkedObjectCount() > 1;
                        break;
 
         case SID_DISTRIBUTION:
@@ -2194,35 +2191,35 @@
                {                       
                        if ( evt.PropertyName.equals( PROPERTY_REPORTHEADERON ) 
)
                        {
+                const USHORT nPosition = 
m_xReportDefinition->getPageHeaderOn() ? 1 : 0;
                                if ( bShow )
-                                       
m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,0);
+                                       
m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER,nPosition);
                                else
-                                       m_pMyOwnView->removeSection(USHORT(0)); 
                        
+                                       m_pMyOwnView->removeSection(nPosition);
                        } 
                        else if ( evt.PropertyName.equals( 
PROPERTY_REPORTFOOTERON ) )
                        {
+                USHORT nPosition = m_pMyOwnView->getSectionCount();
+                               if ( m_xReportDefinition->getPageFooterOn() )
+                                       --nPosition;
                                if ( bShow )
-                                       
m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER);
+                                       
m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER,nPosition);
                                else
-                                       
m_pMyOwnView->removeSection(m_pMyOwnView->getSectionCount() - 1);
+                                       m_pMyOwnView->removeSection(nPosition - 
1);
                        }
                        else if ( evt.PropertyName.equals( 
PROPERTY_PAGEHEADERON ) )
                        {
-                               const USHORT nPosition = 
m_xReportDefinition->getReportHeaderOn() ? 1 : 0;
                                if ( bShow )
-                                       
m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER,nPosition);
+                                       
m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER,0);
                                else
-                                       m_pMyOwnView->removeSection(nPosition);
+                                       m_pMyOwnView->removeSection(USHORT(0));
                        }
                        else if ( evt.PropertyName.equals( 
PROPERTY_PAGEFOOTERON ) )
                        {
-                               USHORT nPosition = 
m_pMyOwnView->getSectionCount();
-                               if ( m_xReportDefinition->getReportFooterOn() )
-                                       --nPosition;
                                if ( bShow )
-                                       
m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER,nPosition);
+                                       
m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
                                else
-                                       m_pMyOwnView->removeSection(nPosition - 
1);
+                                       
m_pMyOwnView->removeSection(m_pMyOwnView->getSectionCount() - 1);
                        }
             else if ( evt.PropertyName.equals( PROPERTY_COMMAND ) || 
evt.PropertyName.equals( PROPERTY_COMMANDTYPE ))
                        {
@@ -2276,7 +2273,7 @@
        bool bHandle = false;
        if ( _sPropName.equals( PROPERTY_HEADERON ) )
        {
-               nPosition = m_xReportDefinition->getReportHeaderOn() ? 
(m_xReportDefinition->getPageHeaderOn() ? 2 : 1) : 
(m_xReportDefinition->getPageHeaderOn() ? 1 : 0);
+               nPosition = m_xReportDefinition->getPageHeaderOn() ? 
(m_xReportDefinition->getReportHeaderOn() ? 2 : 1) : 
(m_xReportDefinition->getReportHeaderOn() ? 1 : 0);
                nPosition += (static_cast<USHORT>(_nGroupPos) - 
lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun));
                bHandle = true;
        }
@@ -2285,10 +2282,11 @@
                pMemFun = ::std::mem_fun(&OGroupHelper::getFooterOn);
                pMemFunSection = ::std::mem_fun(&OGroupHelper::getFooter);
                nPosition = m_pMyOwnView->getSectionCount();
-               if ( m_xReportDefinition->getReportFooterOn() )
-                       --nPosition;
+
                if ( m_xReportDefinition->getPageFooterOn() )
                        --nPosition;
+               if ( m_xReportDefinition->getReportFooterOn() )
+                       --nPosition;            
                sColor = DBGROUPFOOTER;
                nPosition -= (static_cast<USHORT>(_nGroupPos) - 
lcl_getNonVisbleGroupsBefore(m_xReportDefinition->getGroups(),_nGroupPos,pMemFun));
                if ( !_bShow )
@@ -3520,10 +3518,10 @@
 
     _bAdd ? rUndoEnv.AddElement(m_xReportDefinition->getFunctions()) : 
rUndoEnv.RemoveElement(m_xReportDefinition->getFunctions());
         
-       if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
-               
m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER);
        if ( m_xReportDefinition->getPageHeaderOn() && _bAdd )
                
m_pMyOwnView->addSection(m_xReportDefinition->getPageHeader(),DBPAGEHEADER);
+       if ( m_xReportDefinition->getReportHeaderOn() && _bAdd )
+               
m_pMyOwnView->addSection(m_xReportDefinition->getReportHeader(),DBREPORTHEADER);
        
 
        uno::Reference< report::XGroups > xGroups = 
m_xReportDefinition->getGroups();
        const sal_Int32 nCount = xGroups->getCount();
@@ -3554,10 +3552,10 @@
             m_pMyOwnView->addSection(xGroup->getFooter(),DBGROUPFOOTER);
        } // for (sal_Int32 i=0;i<nCount ; ++i)
 
-       if ( m_xReportDefinition->getPageFooterOn() && _bAdd )
-               
m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);
        if ( m_xReportDefinition->getReportFooterOn() && _bAdd )
                
m_pMyOwnView->addSection(m_xReportDefinition->getReportFooter(),DBREPORTFOOTER);
+       if ( m_xReportDefinition->getPageFooterOn() && _bAdd )
+               
m_pMyOwnView->addSection(m_xReportDefinition->getPageFooter(),DBPAGEFOOTER);    
 
        _bAdd ? 
xGroups->addContainerListener(static_cast<XContainerListener*>(this))
         : 
xGroups->removeContainerListener(static_cast<XContainerListener*>(this));
@@ -3593,7 +3591,6 @@
                                                                                
                                        ,bSwitchOn ? Inserted : Removed
                                                                                
                                        ,0
                                                                                
                                        ));
-                       getUndoMgr()->LeaveListAction();
                }
 
                switch( _nId )
@@ -3610,6 +3607,8 @@
                                break;
                }
                
+        if ( SID_REPORTHEADERFOOTER == _nId )
+            getUndoMgr()->LeaveListAction();
                getView()->Resize();
        }
 }
@@ -3641,7 +3640,6 @@
                                                                                
                                        ,bSwitchOn ? Inserted : Removed
                                                                                
                                        ,0
                                                                                
                                        ));
-                       getUndoMgr()->LeaveListAction();
                } // if ( SID_PAGEHEADERFOOTER == _nId )
                switch( _nId )
                {
@@ -3656,6 +3654,8 @@
                                m_xReportDefinition->setPageFooterOn( bSwitchOn 
);
                                break;
                }
+        if ( SID_PAGEHEADERFOOTER == _nId )
+            getUndoMgr()->LeaveListAction();
                getView()->Resize();
        }
 }

File [changed]: ReportSection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportSection.cxx?r1=1.1.2.6&r2=1.1.2.7
Delta lines:  +10 -18
---------------------
--- ReportSection.cxx   2007-05-31 05:40:32+0000        1.1.2.6
+++ ReportSection.cxx   2007-06-05 11:45:43+0000        1.1.2.7
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ReportSection.cxx,v $
  *
- *  $Revision: 1.1.2.6 $
+ *  $Revision: 1.1.2.7 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/31 05:40:32 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -123,7 +123,6 @@
 : Window(_pParent,WB_DIALOGCONTROL)
 , ::comphelper::OPropertyChangeListener(m_aMutex)
 , DropTargetHelper(this)
-, DragSourceHelper(this)
 ,m_pPage(NULL)
 ,m_pView(NULL)
 ,m_pParent(_pParent)
@@ -694,7 +693,7 @@
         if ( ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, 
CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) )
             return _rEvt.mnAction;
         
-        const sal_Int8 nDropOption = ( m_pView && !m_pView->IsAction() && 
OReportExchange::canExtract(rFlavors) ) ? DND_ACTION_COPYMOVE : DND_ACTION_NONE;
+        const sal_Int8 nDropOption = ( OReportExchange::canExtract(rFlavors) ) 
? DND_ACTION_COPYMOVE : DND_ACTION_NONE;
 
         return nDropOption;
     }
@@ -713,11 +712,14 @@
     sal_Int8 nDropOption = DND_ACTION_NONE;
     TransferableDataHelper aDropped(_rEvt.maDropEvent.Transferable);
     DataFlavorExVector& rFlavors = aDropped.GetDataFlavorExVector();
-    if ( m_pView && !m_pView->IsAction() && 
OReportExchange::canExtract(rFlavors) )
+    if ( OReportExchange::canExtract(rFlavors) )
     {
         OReportExchange::TSectionElements aCopies = 
OReportExchange::extractCopies(aDropped);
                Paste(aCopies,true);
         nDropOption = DND_ACTION_COPYMOVE;
+        m_pParent->breakAction();
+        m_pParent->unmarkAllObjects(m_pView);
+        //m_pParent->getView()->setMarked(m_pView,sal_True);
     } // if ( OReportExchange::canExtract(rFlavors) )
     else if ( ::svx::OColumnTransferable::canExtractColumnDescriptor(rFlavors, 
CTF_FIELD_DESCRIPTOR | CTF_CONTROL_EXCHANGE | CTF_COLUMN_DESCRIPTOR) )
     {
@@ -753,21 +755,11 @@
        return nDropOption;
 }
 // 
-----------------------------------------------------------------------------
-void OReportSection::StartDrag( sal_Int8 /*_nAction*/, const Point& _rPosPixel 
)
+void OReportSection::breakAction()
 {
-       if( m_pView && m_pView->AreObjectsMarked() && m_xSection.is() && 
m_pView->IsAction() && (_rPosPixel.X() < 0 || _rPosPixel.Y() < 0) )
-       {
-               /*SdrHdl* pHdl = m_pView->HitHandle(_rPosPixel, *this);
-               USHORT nDrgLog = USHORT ( PixelToLogic(Size(3,0)).Width() );
-               m_pView->BegDragObj(_rPosPixel, this, pHdl, nDrgLog);*/
-               uno::Sequence< beans::NamedValue > aAllreadyCopiedObjects;
-               Copy(aAllreadyCopiedObjects);
-               OReportExchange* pCopy = new 
OReportExchange(aAllreadyCopiedObjects);
-               uno::Reference< datatransfer::XTransferable> aEnsureDelete = 
pCopy;
-               pCopy->StartDrag(this,DND_ACTION_COPYMOVE);
-       }
+    if( m_pView && m_pView->IsAction() )
+        m_pView->BrkAction();
 }
-// 
-----------------------------------------------------------------------------
 // 
=============================================================================
 }
 // 
=============================================================================

File [changed]: ReportWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportWindow.cxx?r1=1.1.2.5&r2=1.1.2.6
Delta lines:  +7 -2
-------------------
--- ReportWindow.cxx    2007-05-30 16:24:46+0000        1.1.2.5
+++ ReportWindow.cxx    2007-06-05 11:45:43+0000        1.1.2.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ReportWindow.cxx,v $
  *
- *  $Revision: 1.1.2.5 $
+ *  $Revision: 1.1.2.6 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/30 16:24:46 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -524,6 +524,11 @@
     return m_pViews ? m_pViews->isDragStripes() : FALSE;
 }
 // 
-----------------------------------------------------------------------------
+sal_uInt32 OReportWindow::getMarkedObjectCount() const
+{
+    return m_pViews ? m_pViews->getMarkedObjectCount() : 0;
+}
+
 //==================================================================
 }      //rptui
 //==================================================================

File [changed]: ScrollHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ScrollHelper.cxx?r1=1.1.2.5&r2=1.1.2.6
Delta lines:  +7 -2
-------------------
--- ScrollHelper.cxx    2007-06-04 10:50:40+0000        1.1.2.5
+++ ScrollHelper.cxx    2007-06-05 11:45:43+0000        1.1.2.6
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ScrollHelper.cxx,v $
  *
- *  $Revision: 1.1.2.5 $
+ *  $Revision: 1.1.2.6 $
  *
- *  last change: $Author: fs $ $Date: 2007/06/04 10:50:40 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:43 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -578,6 +578,11 @@
     return m_pChild ? m_pChild->isDragStripes() : FALSE;
 }
 // 
-----------------------------------------------------------------------------
+sal_uInt32 OScrollWindowHelper::getMarkedObjectCount() const
+{
+    return m_pChild ? m_pChild->getMarkedObjectCount() : 0;
+}
+// 
-----------------------------------------------------------------------------
 
//==============================================================================
 } // rptui
 
//==============================================================================

File [changed]: SectionView.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/SectionView.cxx?r1=1.1.2.2&r2=1.1.2.3
Delta lines:  +2 -3
-------------------
--- SectionView.cxx     2007-05-16 17:45:49+0000        1.1.2.2
+++ SectionView.cxx     2007-06-05 11:45:44+0000        1.1.2.3
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: SectionView.cxx,v $
  *
- *  $Revision: 1.1.2.2 $
+ *  $Revision: 1.1.2.3 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/16 17:45:49 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:44 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -194,7 +194,6 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-
 //============================================================================
 } // rptui
 //============================================================================

File [changed]: ViewsWindow.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ViewsWindow.cxx?r1=1.1.2.8&r2=1.1.2.9
Delta lines:  +44 -2
--------------------
--- ViewsWindow.cxx     2007-05-31 12:04:59+0000        1.1.2.8
+++ ViewsWindow.cxx     2007-06-05 11:45:44+0000        1.1.2.9
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ViewsWindow.cxx,v $
  *
- *  $Revision: 1.1.2.8 $
+ *  $Revision: 1.1.2.9 $
  *
- *  last change: $Author: oj $ $Date: 2007/05/31 12:04:59 $
+ *  last change: $Author: oj $ $Date: 2007/06/05 11:45:44 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1157,6 +1157,48 @@
     return aReturn;
 }
 // 
-----------------------------------------------------------------------------
+void OViewsWindow::breakAction()
+{
+    ::std::for_each(m_aSections.begin(),m_aSections.end(),
+               
::std::compose1(::boost::bind(&OReportSection::breakAction,_1),TReportPairHelper()));
+}
+// 
-----------------------------------------------------------------------------
+void OViewsWindow::BegDragObj(const Point& _aPnt, SdrHdl* _pHdl)
+{
+    const short nDrgLog = static_cast<short>(PixelToLogic(Size(3,0)).Width());
+    TSectionsMap::iterator aIter = m_aSections.begin();
+    TSectionsMap::iterator aEnd = m_aSections.end();
+    for (; aIter != aEnd; ++aIter)
+        aIter->first.first->getView()->BegDragObj(_aPnt, (OutputDevice*)NULL, 
_pHdl, nDrgLog,NULL);
+}
+// 
-----------------------------------------------------------------------------
+void OViewsWindow::EndDragObj(BOOL _bCopy)
+{
+    ::std::for_each(m_aSections.begin(),m_aSections.end(),
+               
::std::compose1(::boost::bind(&OSectionView::EndDragObj,_1,_bCopy),TViewPairHelper()));
+}
+// 
-----------------------------------------------------------------------------
+void OViewsWindow::EndAction()
+{
+    ::std::for_each(m_aSections.begin(),m_aSections.end(),
+               
::std::compose1(::boost::bind(&OSectionView::EndAction,_1),TViewPairHelper()));
+}
+// 
-----------------------------------------------------------------------------
+void OViewsWindow::MovAction(const Point& rPnt)
+{
+    ::std::for_each(m_aSections.begin(),m_aSections.end(),
+               
::std::compose1(::boost::bind(&OSectionView::MovAction,_1,rPnt),TViewPairHelper()));
+}
+// 
-----------------------------------------------------------------------------
+sal_uInt32 OViewsWindow::getMarkedObjectCount() const
+{
+    sal_uInt32 nCount = 0;
+    TSectionsMap::const_iterator aIter = m_aSections.begin();
+    TSectionsMap::const_iterator aEnd = m_aSections.end();
+    for (; aIter != aEnd; ++aIter)
+        nCount += aIter->first.first->getView()->GetMarkedObjectCount();
+    return nCount;
+}
 
//==============================================================================
 } // rptui
 
//==============================================================================




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

Reply via email to