Tag: cws_src680_dba30
User: fs      
Date: 06/03/21 10:24:40

Modified:
 /dba/dbaccess/source/core/dataaccess/
  documentcontainer.cxx

Log:
 RESYNC: (1.15-1.17); FILE MERGED

File Changes:

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

File [changed]: documentcontainer.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/core/dataaccess/documentcontainer.cxx?r1=1.12.2.3&r2=1.12.2.4
Delta lines:  +18 -9
--------------------
--- documentcontainer.cxx       13 Oct 2005 14:53:04 -0000      1.12.2.3
+++ documentcontainer.cxx       21 Mar 2006 18:24:37 -0000      1.12.2.4
@@ -203,8 +203,8 @@
 
                ODefinitionContainer_Impl* pItem = 
static_cast<ODefinitionContainer_Impl*>(m_pImpl.get());
 
-               sal_Bool bNew;
-               if ( bNew = (0 == sPersistentName.getLength()) )
+               sal_Bool bNew = ( 0 == sPersistentName.getLength() );
+               if ( bNew )
                {
                        const static ::rtl::OUString 
sBaseName(RTL_CONSTASCII_USTRINGPARAM("Obj"));
                        // 
-----------------------------------------------------------------------------
@@ -213,6 +213,7 @@
                        Reference<XNameAccess> 
xElements(getStorage(),UNO_QUERY);
                        if ( xElements.is() )
                                sPersistentName = 
::dbtools::createUniqueName(xElements,sPersistentName);
+
                        if ( xCopyFrom.is() )
                        {
                                Sequence<Any> aIni(2);
@@ -227,6 +228,11 @@
                 if ( xProp.is() && xProp->getPropertySetInfo().is() && 
xProp->getPropertySetInfo()->hasPropertyByName(PROPERTY_AS_TEMPLATE) )
                     xProp->getPropertyValue(PROPERTY_AS_TEMPLATE) >>= 
bAsTemplate;
                        }
+
+            if ( ( aClassID.getLength() == 0 ) && ( 0 == sURL.getLength() ) )
+                // default the class id, if none is given
+                // #i57097# / 2005-11-01 / [EMAIL PROTECTED]
+                aClassID = 
ODocumentDefinition::getDefaultDocumentTypeClassId();
                }
 
                ODefinitionContainer_Impl::Documents::iterator aFind = 
pItem->m_aDocumentMap.find(sName);
@@ -284,14 +290,17 @@
                OSL_ENSURE(sName.getLength(),"Invalid name for a document 
container!");
                ODefinitionContainer_Impl* pItem = 
static_cast<ODefinitionContainer_Impl*>(m_pImpl.get());
                ODefinitionContainer_Impl::Documents::iterator aFind = 
pItem->m_aDocumentMap.find(sName);
+               TContentPtr pElementImpl;
                if ( aFind == pItem->m_aDocumentMap.end() )
                {
-                       aFind = 
pItem->m_aDocumentMap.insert(ODefinitionContainer_Impl::Documents::value_type(sName,ODefinitionContainer_Impl::Documents::mapped_type(new
 ODefinitionContainer_Impl))).first;
-                       aFind->second->m_aProps.aTitle = sName;
-                       aFind->second->m_pDataSource = m_pImpl->m_pDataSource;
-               }
-               OSL_ENSURE( aFind != pItem->m_aDocumentMap.end() ," Invalid 
entry in map!");
-               xContent = new 
ODocumentContainer(m_xORB,*this,aFind->second,ServiceSpecifier == 
SERVICE_NAME_FORM_COLLECTION);
+                       pElementImpl.reset(new ODefinitionContainer_Impl);
+                       pElementImpl->m_aProps.aTitle = sName;
+                       pElementImpl->m_pDataSource = m_pImpl->m_pDataSource;
+               } // if ( aFind == pItem->m_aDocumentMap.end() )
+               else
+                       pElementImpl = aFind->second;
+               OSL_ENSURE( pElementImpl ," Invalid entry in map!");
+               xContent = new 
ODocumentContainer(m_xORB,*this,pElementImpl,ServiceSpecifier == 
SERVICE_NAME_FORM_COLLECTION);
                
                // copy children
                if ( xCopyFrom.is() )




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

Reply via email to