User: rt      
Date: 2008-01-29 13:44:50+0000
Modified:
   dba/reportdesign/source/core/sdr/RptPage.cxx

Log:
 INTEGRATION: CWS reportdesign02 (1.3.36); FILE MERGED
 2007/11/26 06:24:43 lla 1.3.36.1: #i80260# drag n drop, lines over all 
sections, no ctrl key need to move obj in different section

File Changes:

Directory: /dba/reportdesign/source/core/sdr/
=============================================

File [changed]: RptPage.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/core/sdr/RptPage.cxx?r1=1.3&r2=1.4
Delta lines:  +43 -1
--------------------
--- RptPage.cxx 2007-08-03 09:55:28+0000        1.3
+++ RptPage.cxx 2008-01-29 13:44:48+0000        1.4
@@ -68,6 +68,7 @@
        :SdrPage( _rModel, bMasterPage )
        ,rModel(_rModel)
     ,m_xSection(_xSection)
+     ,m_bSpecialInsertMode(false)
 {
        DBG_CTOR( rpt_OReportPage,NULL);        
 }
@@ -134,6 +135,11 @@
 SdrObject* OReportPage::RemoveObject(ULONG nObjNum)
 {
     SdrObject* pObj = SdrPage::RemoveObject(nObjNum);
+    if (getSpecialMode())
+    {
+               return pObj;
+       }
+
     // this code is evil, but what else shall I do
     reportdesign::OSection* pSection = 
reportdesign::OSection::getImplementation(m_xSection);
     uno::Reference< drawing::XShape> 
xShape(pObj->getUnoShape(),uno::UNO_QUERY);
@@ -190,11 +196,47 @@
     return static_cast<cppu::OWeakObject*>( new 
reportdesign::OReportDrawPage(this,m_xSection) );
 }
 // 
-----------------------------------------------------------------------------
+void OReportPage::removeTempObject(SdrObject *_pToRemoveObj)
+{
+       if (_pToRemoveObj)
+       {
+               for (ULONG i=0;i<GetObjCount();i++)
+               {
+                       SdrObject *aObj = GetObj(i);
+                       if (aObj && aObj == _pToRemoveObj)
+                       {
+                               SdrObject* pObject = RemoveObject(i);
+                               (void)pObject;
+                               // delete pObject;
+                       }
+               }
+       }
+}
+
+void OReportPage::resetSpecialMode()
+{
+    vector<SdrObject*>::iterator aIter = m_aTemporaryObjectList.begin();
+    vector<SdrObject*>::iterator aEnd = m_aTemporaryObjectList.end();
+     
+    for (; aIter != aEnd; ++aIter)
+    {
+         removeTempObject(*aIter);
+    }
+    
+    m_bSpecialInsertMode = false;
+}
+// 
-----------------------------------------------------------------------------
 void OReportPage::NbcInsertObject(SdrObject* pObj, ULONG nPos, const 
SdrInsertReason* pReason)
 {
     SdrPage::NbcInsertObject(pObj, nPos, pReason);
 
     OUnoObject* pUnoObj = dynamic_cast< OUnoObject* >( pObj );
+    if (getSpecialMode())
+    {
+        m_aTemporaryObjectList.push_back(pObj);
+        return;
+    }
+    
     if ( pUnoObj )
     {
         pUnoObj->CreateMediator();




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

Reply via email to