Tag: cws_dev300_dba31b
User: fs      
Date: 2008-08-06 11:25:17+0000
Modified:
   dba/dbaccess/source/core/dataaccess/ModelImpl.cxx

Log:
 getDocumentSubStorageNames: return all sub storages, not only 'forms' and 
'reports'

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.32&r2=1.32.18.1
Delta lines:  +18 -7
--------------------
--- ModelImpl.cxx       2008-06-30 15:10:05+0000        1.32
+++ ModelImpl.cxx       2008-08-06 11:25:15+0000        1.32.18.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ModelImpl.cxx,v $
- * $Revision: 1.32 $
+ * $Revision: 1.32.18.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -232,11 +232,22 @@
 //--------------------------------------------------------------------------
 Sequence< ::rtl::OUString > SAL_CALL 
DocumentStorageAccess::getDocumentSubStoragesNames(  ) throw (IOException, 
RuntimeException)
 {
-       Sequence< ::rtl::OUString > aRet(2);
-       sal_Int32 nPos = 0;
-    aRet[nPos++] = m_pModelImplementation->getObjectContainerStorageName( 
ODatabaseModelImpl::E_FORM );
-    aRet[nPos++] = m_pModelImplementation->getObjectContainerStorageName( 
ODatabaseModelImpl::E_REPORT );
-       return aRet;
+    Reference< XStorage > xRootStor( m_pModelImplementation->getRootStorage() 
);
+    if ( !xRootStor.is() )
+        return Sequence< ::rtl::OUString >();
+
+    ::std::vector< ::rtl::OUString > aNames;
+
+    Reference< XNameAccess > xNames( xRootStor, UNO_QUERY_THROW );
+    Sequence< ::rtl::OUString > aElementNames( xNames->getElementNames() );
+    for ( sal_Int32 i=0; i<aElementNames.getLength(); ++i )
+    {
+        if ( xRootStor->isStorageElement( aElementNames[i] ) )
+            aNames.push_back( aElementNames[i] );
+    }
+    return aNames.empty()
+        ?  Sequence< ::rtl::OUString >()
+        :  Sequence< ::rtl::OUString >( &aNames[0], aNames.size() );
 }
 
 //--------------------------------------------------------------------------




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

Reply via email to