Tag: odbmacros_2_5
User: fs      
Date: 2008-02-26 14:14:31+0000
Modified:
   dba/dbaccess/source/core/dataaccess/ModelImpl.cxx

Log:
 #i49133# don't rebase the script storages if the new root storage would be NULL

File Changes:

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

File [changed]: ModelImpl.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/ModelImpl.cxx?r1=1.21.2.11.2.1&r2=1.21.2.11.2.2
Delta lines:  +20 -6
--------------------
--- ModelImpl.cxx       2008-02-14 12:18:07+0000        1.21.2.11.2.1
+++ ModelImpl.cxx       2008-02-26 14:14:28+0000        1.21.2.11.2.2
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ModelImpl.cxx,v $
  *
- *  $Revision: 1.21.2.11.2.1 $
+ *  $Revision: 1.21.2.11.2.2 $
  *
- *  last change: $Author: fs $ $Date: 2008/02/14 12:18:07 $
+ *  last change: $Author: fs $ $Date: 2008/02/26 14:14:28 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -1167,6 +1167,22 @@
 }
 
 // 
-----------------------------------------------------------------------------
+namespace
+{
+    static void lcl_rebaseScriptStorage_throw( const Reference< 
XStorageBasedLibraryContainer >& _rxContainer,
+        const Reference< XStorage >& _rxNewRootStorage )
+    {
+        if ( _rxContainer.is() )
+        {
+            if ( _rxNewRootStorage.is() )
+                _rxContainer->setRootStorage( _rxNewRootStorage );
+            else
+                ;   // TODO: what to do here? dispose the container?
+        }
+    }
+}
+
+// 
-----------------------------------------------------------------------------
 Reference< XStorage > ODatabaseModelImpl::impl_switchToStorage_throw( const 
Reference< XStorage >& _rxNewRootStorage )
 {
     // stop listening for modifications at the old storage
@@ -1179,10 +1195,8 @@
     lcl_modifyListening( m_xMutex->getMutex(), *this, 
m_xDocumentStorage.getTyped(), m_pStorageModifyListener, true );
 
     // forward new storage to Basic and Dialog library containers
-    if ( m_xBasicLibraries.is() )
-        m_xBasicLibraries->setRootStorage( m_xDocumentStorage.getTyped() );
-    if ( m_xDialogLibraries.is() )
-        m_xDialogLibraries->setRootStorage( m_xDocumentStorage.getTyped() );
+    lcl_rebaseScriptStorage_throw( m_xBasicLibraries, 
m_xDocumentStorage.getTyped() );
+    lcl_rebaseScriptStorage_throw( m_xDialogLibraries, 
m_xDocumentStorage.getTyped() );
 
     m_bReadOnly = !lcl_storageIsWritable_nothrow( 
m_xDocumentStorage.getTyped() );
     // TODO: our data source, if it exists, must broadcast the change of its 
ReadOnly property




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

Reply via email to