Tag: cws_dev300_dba30c
User: oj      
Date: 2008-05-05 11:10:28+0000
Modified:
   dba/dbaccess/source/core/inc/PropertyForward.hxx
   dba/dbaccess/source/core/misc/ContainerMediator.cxx

Log:
 #i87131# rename impl

File Changes:

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

File [changed]: PropertyForward.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/inc/PropertyForward.hxx?r1=1.4&r2=1.4.8.1
Delta lines:  +3 -2
-------------------
--- PropertyForward.hxx 2008-04-10 12:50:59+0000        1.4
+++ PropertyForward.hxx 2008-05-05 11:10:25+0000        1.4.8.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: PropertyForward.hxx,v $
- * $Revision: 1.4 $
+ * $Revision: 1.4.8.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -80,6 +80,7 @@
                // ::com::sun::star::lang::XEventListener
         virtual void SAL_CALL disposing( const 
::com::sun::star::lang::EventObject& _rSource ) throw 
(::com::sun::star::uno::RuntimeException);
 
+        inline void setName(const ::rtl::OUString& _sName) { m_sName = _sName; 
}
                void setDefinition(const ::com::sun::star::uno::Reference< 
::com::sun::star::beans::XPropertySet>& _xDest);
        };
 //........................................................................

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

File [changed]: ContainerMediator.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/misc/ContainerMediator.cxx?r1=1.10&r2=1.10.8.1
Delta lines:  +36 -10
---------------------
--- ContainerMediator.cxx       2008-04-10 13:00:05+0000        1.10
+++ ContainerMediator.cxx       2008-05-05 11:10:25+0000        1.10.8.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ContainerMediator.cxx,v $
- * $Revision: 1.10 $
+ * $Revision: 1.10.8.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -49,7 +49,7 @@
 #ifndef _COM_SUN_STAR_SDBCX_XTABLESSUPPLIER_HPP_
 #include <com/sun/star/sdbcx/XTablesSupplier.hpp>
 #endif
-
+#include <com/sun/star/sdbcx/XRename.hpp>
 #ifndef _CONNECTIVITY_DBTOOLS_HXX_
 #include <connectivity/dbtools.hxx>
 #endif
@@ -177,10 +177,36 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-void SAL_CALL OContainerMediator::elementReplaced( const ContainerEvent& 
/*_rEvent*/ ) throw(RuntimeException)
+void SAL_CALL OContainerMediator::elementReplaced( const ContainerEvent& 
_rEvent ) throw(RuntimeException)
 {
-    OSL_ENSURE( false, "OContainerMediator::elementReplaced: not yet 
implemented!" );
-    // we would need to update our PropertyForwarder with the new elements, 
and initially synchronize them
+    Reference< XContainer > xContainer = m_xContainer;
+    if ( _rEvent.Source == xContainer && xContainer.is() )
+       {
+        ::rtl::OUString sElementName;
+               _rEvent.ReplacedElement >>= sElementName;
+        
+        PropertyForwardList::iterator aFind = 
m_aForwardList.find(sElementName);
+               if ( aFind != m_aForwardList.end() )
+        {
+            ::rtl::OUString sNewName;
+            _rEvent.Accessor >>= sNewName;
+            try
+            {
+                       Reference<XNameContainer> xNameContainer( m_xSettings, 
UNO_QUERY_THROW );
+                       if ( xNameContainer.is() && m_xSettings->hasByName( 
sElementName ) )
+                {
+                    Reference<XRename> 
xSource(m_xSettings->getByName(sElementName),UNO_QUERY_THROW);
+                    xSource->rename(sNewName);
+                }
+            }
+            catch( const Exception& )
+            {
+                   DBG_UNHANDLED_EXCEPTION();
+            }
+
+            aFind->second->setName(sNewName);
+        }
+    }
 }
 
 // 
-----------------------------------------------------------------------------




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

Reply via email to