Tag: cws_ooo300_dba30y
User: fs      
Date: 2008-09-30 07:17:22+0000
Modified:
   dba/dbaccess/source/core/dataaccess/ContentHelper.cxx

Log:
 #i94433# prevent disposals during rename

File Changes:

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

File [changed]: ContentHelper.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ContentHelper.cxx?r1=1.12&r2=1.12.96.1
Delta lines:  +34 -2
--------------------
--- ContentHelper.cxx   2008-04-10 12:38:00+0000        1.12
+++ ContentHelper.cxx   2008-09-30 07:17:19+0000        1.12.96.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ContentHelper.cxx,v $
- * $Revision: 1.12 $
+ * $Revision: 1.12.96.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -118,6 +118,7 @@
     ,m_aErrorHelper( m_aContext )
        ,m_pImpl(_pImpl)
        ,m_nCommandId(0)
+    ,m_bRenaming( false )
 {
 }
 //--------------------------------------------------------------------------
@@ -667,6 +668,35 @@
        ::osl::MutexGuard aGuard(m_aMutex);
        m_xParentContainer = _xParent;
 }
+
+// 
-----------------------------------------------------------------------------
+void SAL_CALL OContentHelper::dispose(  ) throw 
(::com::sun::star::uno::RuntimeException)
+{
+    if ( m_bRenaming )
+        return;
+    OContentHelper_COMPBASE::dispose();
+}
+
+// 
-----------------------------------------------------------------------------
+namespace
+{
+    class FlagGuard
+    {
+    public:
+        FlagGuard( bool& _rFlag )
+            :m_rFlag( _rFlag )
+        {
+            m_rFlag = true;
+        }
+        ~FlagGuard()
+        {
+            m_rFlag = false;
+        }
+    private:
+        bool&   m_rFlag;
+    };
+}
+
 // 
-----------------------------------------------------------------------------
 void SAL_CALL OContentHelper::rename( const ::rtl::OUString& newName ) throw 
(SQLException, ElementExistException, RuntimeException)
 {
@@ -682,6 +712,8 @@
 
                try
                {
+            FlagGuard aPreventDispose( m_bRenaming );
+
                        if ( xNameCont->hasByName(m_pImpl->m_aProps.aTitle) )
                                
xNameCont->removeByName(m_pImpl->m_aProps.aTitle);
 




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

Reply via email to