Tag: cws_src680_dba24d
User: oj      
Date: 2007-11-23 12:52:15+0000
Modified:
   dba/dbaccess/source/core/api/viewcontainer.cxx
   dba/dbaccess/source/core/inc/viewcontainer.hxx

Log:
 #i81644# elementRemoved impl

File Changes:

Directory: /dba/dbaccess/source/core/api/
=========================================

File [changed]: viewcontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/api/viewcontainer.cxx?r1=1.25&r2=1.25.170.1
Delta lines:  +56 -36
---------------------
--- viewcontainer.cxx   2006-09-17 06:37:09+0000        1.25
+++ viewcontainer.cxx   2007-11-23 12:52:12+0000        1.25.170.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: viewcontainer.cxx,v $
  *
- *  $Revision: 1.25 $
+ *  $Revision: 1.25.170.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/09/17 06:37:09 $
+ *  last change: $Author: oj $ $Date: 2007/11/23 12:52:12 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -129,6 +129,7 @@
                                                                 
IRefreshListener*      _pRefreshListener,
                                                                 
IWarningsContainer* _pWarningsContainer)
        
:OFilteredContainer(_rParent,_rMutex,_xCon,_bCase,_pRefreshListener,_pWarningsContainer)
+    ,m_bInElementRemoved(false)
 {
     DBG_CTOR(OViewContainer, NULL);
 }
@@ -231,6 +232,8 @@
 // XDrop
 void OViewContainer::dropObject(sal_Int32 _nPos,const ::rtl::OUString 
_sElementName)
 {
+    if ( !m_bInElementRemoved )
+    {
        Reference< XDrop > xDrop(m_xMasterContainer,UNO_QUERY);
        if(xDrop.is())
                xDrop->dropByName(_sElementName);
@@ -263,6 +266,7 @@
                        ::comphelper::disposeComponent(xStmt);
                }
        }
+    }
 }
 // 
-----------------------------------------------------------------------------
 void SAL_CALL OViewContainer::elementInserted( const ContainerEvent& Event ) 
throw (RuntimeException)
@@ -279,8 +283,24 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-void SAL_CALL OViewContainer::elementRemoved( const ContainerEvent& /*Event*/ 
) throw (RuntimeException)
+void SAL_CALL OViewContainer::elementRemoved( const ContainerEvent& Event ) 
throw (RuntimeException)
 {
+    ::osl::MutexGuard aGuard(m_rMutex);
+       ::rtl::OUString sName;
+       if ( (Event.Accessor >>= sName) && hasByName(sName) )
+       {
+        m_bInElementRemoved = true;
+        try
+        {
+            dropByName(sName);
+        }
+           catch(Exception&)
+           {
+                   m_bInElementRemoved = sal_False;
+                   throw;
+           }
+        m_bInElementRemoved = false;
+       }
 }
 // 
-----------------------------------------------------------------------------
 void SAL_CALL OViewContainer::disposing( const 
::com::sun::star::lang::EventObject& /*Source*/ ) throw (RuntimeException)

Directory: /dba/dbaccess/source/core/inc/
=========================================

File [changed]: viewcontainer.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/inc/viewcontainer.hxx?r1=1.15&r2=1.15.212.1
Delta lines:  +4 -3
-------------------
--- viewcontainer.hxx   2006-07-10 15:15:39+0000        1.15
+++ viewcontainer.hxx   2007-11-23 12:52:12+0000        1.15.212.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: viewcontainer.hxx,v $
  *
- *  $Revision: 1.15 $
+ *  $Revision: 1.15.212.1 $
  *
- *  last change: $Author: obo $ $Date: 2006/07/10 15:15:39 $
+ *  last change: $Author: oj $ $Date: 2007/11/23 12:52:12 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -93,6 +93,7 @@
        class OViewContainer :  public OFilteredContainer,
                                                        public 
OViewContainer_Base
        {
+        bool m_bInElementRemoved;
        protected:
                virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > 
getTableTypeFilter(const ::com::sun::star::uno::Sequence< ::rtl::OUString >& 
_rTableTypeFilter) const;
                // ::connectivity::sdbcx::OCollection




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

Reply via email to