User: hr      
Date: 2007-08-03 10:03:55+0000
Modified:
   dba/reportdesign/source/ui/report/ReportSection.cxx

Log:
 INTEGRATION: CWS rpt23fix02 (1.2.4); FILE MERGED
 2007/07/25 14:07:02 oj 1.2.4.4: #i77721# #i79958# dnd and selection across 
sections impl
 2007/07/24 12:48:07 oj 1.2.4.3: merge from rpt23fix01
 2007/07/24 07:29:25 oj 1.2.4.2: #i79913# repaint failure
 2007/07/23 11:59:20 oj 1.2.4.1: #i79128# paint problem with sdrview solved

File Changes:

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

File [changed]: ReportSection.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportSection.cxx?r1=1.3&r2=1.4
Delta lines:  +53 -10
---------------------
--- ReportSection.cxx   2007-08-02 14:40:24+0000        1.3
+++ ReportSection.cxx   2007-08-03 10:03:52+0000        1.4
@@ -71,6 +71,7 @@
 #ifndef _SVX_ADJITEM_HXX
 #include <svx/adjitem.hxx>
 #endif
+#include <svx/sdrpaintwindow.hxx>
 #ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARD_HPP_
 #include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
 #endif
@@ -150,7 +151,6 @@
     EnableChildTransparentMode();
        SetHelpId(HID_REPORTSECTION);
        SetMapMode( MapMode( MAP_100TH_MM ) );
-       m_pFunc.reset(new DlgEdFuncSelect( this ));
        try
        {
                fill();
@@ -161,6 +161,9 @@
                OSL_ENSURE(0,"Exception catched!");
        }
     
+    m_pFunc.reset(new DlgEdFuncSelect( this ));
+    m_pFunc->setOverlappedControlColor(lcl_getOverlappedControlColor( /* 
m_pParent->getView()->getReportView()->getController()->getORB() */ ) );
+    
        Show();
 }
 
//------------------------------------------------------------------------------
@@ -189,6 +192,31 @@
 {
        if ( m_pView )
        {
+         // repaint, get PageView and prepare Region
+        SdrPageView* pPgView = m_pView->GetSdrPageView();
+        const Region aPaintRectRegion(rRect);
+
+        // #i74769#
+        SdrPaintWindow* pTargetPaintWindow = 0;
+
+        // mark repaint start
+        if(pPgView)
+        {
+            pTargetPaintWindow = pPgView->GetView().BeginDrawLayers(this, 
aPaintRectRegion);
+            OSL_ENSURE(pTargetPaintWindow, "BeginDrawLayers: Got no 
SdrPaintWindow (!)");
+            // draw background self using wallpaper
+            OutputDevice& rTargetOutDev = 
pTargetPaintWindow->GetTargetOutputDevice();
+            rTargetOutDev.DrawWallpaper(rRect, 
Wallpaper(Color(m_xSection->getBackColor())));
+        }
+
+        // do paint (unbuffered) and mark repaint end
+        if(pPgView)
+        {
+            pPgView->DrawLayer(0, this);
+            pPgView->GetView().EndDrawLayers(*pTargetPaintWindow);
+        }
+
+               
                const Region aReg(rRect);
                m_pView->CompleteRedraw(this,aReg);
        }
@@ -200,9 +228,8 @@
        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,2*m_xSection->getHeight())
 );
+               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()) ) );
@@ -373,9 +400,14 @@
         m_eMode = eNewMode;
        }       
 }
-//----------------------------------------------------------------------------
+// 
-----------------------------------------------------------------------------
 void OReportSection::Copy(uno::Sequence< beans::NamedValue >& 
_rAllreadyCopiedObjects)
 {      
+    Copy(_rAllreadyCopiedObjects,false);
+}
+//----------------------------------------------------------------------------
+void OReportSection::Copy(uno::Sequence< beans::NamedValue >& 
_rAllreadyCopiedObjects,bool _bEraseAnddNoClone)
+{      
     OSL_ENSURE(m_xSection.is(),"Why is the section here NULL!");
        if( !m_pView->AreObjectsMarked() || !m_xSection.is() )
                return;
@@ -390,15 +422,25 @@
     ::std::vector< uno::Reference<util::XCloneable> > aCopies;
     aCopies.reserve(nMark);
     
-       for( ULONG i = 0; i < nMark; i++ )
+    SdrUndoFactory& rUndo = m_pView->GetModel()->GetSdrUndoFactory();
+    
+       for( ULONG i = nMark; i > 0; )
        {
-        OObjectBase* pObj = 
dynamic_cast<OObjectBase*>(rMarkedList.GetMark(i)->GetMarkedSdrObj());
+        --i;
+        SdrObject* pSdrObject = rMarkedList.GetMark(i)->GetMarkedSdrObj();
+        OObjectBase* pObj = dynamic_cast<OObjectBase*>(pSdrObject);
                if ( pObj  )
                {
             try
             {
                 uno::Reference<report::XReportComponent> xComponent = 
pObj->getReportComponent();
                 aCopies.push_back(xComponent->createClone());
+                if ( _bEraseAnddNoClone )
+                {
+                    m_pView->AddUndo( rUndo.CreateUndoDeleteObject( 
*pSdrObject ) );
+                    m_pPage->RemoveObject(pSdrObject->GetOrdNum());
+                }
+
             }
             catch(uno::Exception&)
             {
@@ -409,6 +451,7 @@
 
     if ( !aCopies.empty() )
     {
+        ::std::reverse(aCopies.begin(),aCopies.end());
         const sal_Int32 nLength = _rAllreadyCopiedObjects.getLength();
         _rAllreadyCopiedObjects.realloc( nLength + 1);
         beans::NamedValue* pNewValue = _rAllreadyCopiedObjects.getArray() + 
nLength;
@@ -737,7 +780,7 @@
         OReportExchange::TSectionElements aCopies = 
OReportExchange::extractCopies(aDropped);
                Paste(aCopies,true);
         nDropOption = DND_ACTION_COPYMOVE;
-        m_pParent->breakAction();
+        m_pParent->BrkAction();
         m_pParent->unmarkAllObjects(m_pView);
         //m_pParent->getView()->setMarked(m_pView,sal_True);
     } // if ( OReportExchange::canExtract(rFlavors) )
@@ -775,11 +818,11 @@
        return nDropOption;
 }
 // 
-----------------------------------------------------------------------------
-void OReportSection::breakAction()
+void OReportSection::stopScrollTimer()
 {
-    if( m_pView && m_pView->IsAction() )
-        m_pView->BrkAction();
+    m_pFunc->stopScrollTimer();
 }
+// 
-----------------------------------------------------------------------------
 // 
=============================================================================
 }
 // 
=============================================================================




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

Reply via email to