Tag: cws_src680_dba26
User: oj      
Date: 05/03/08 02:25:45

Modified:
 /dba/dbaccess/source/filter/migration/
  cfgimport.cxx, cfgimport.hxx

Log:
 #i44420# #i44419# fix for migration

File Changes:

Directory: /dba/dbaccess/source/filter/migration/
=================================================

File [changed]: cfgimport.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/migration/cfgimport.cxx?r1=1.5&r2=1.5.14.1
Delta lines:  +50 -38
---------------------
--- cfgimport.cxx       17 Feb 2005 11:05:12 -0000      1.5
+++ cfgimport.cxx       8 Mar 2005 10:25:42 -0000       1.5.14.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: cfgimport.cxx,v $
  *
- *  $Revision: 1.5 $
+ *  $Revision: 1.5.14.1 $
  *
- *  last change: $Author: vg $ $Date: 2005/02/17 11:05:12 $
+ *  last change: $Author: oj $ $Date: 2005/03/08 10:25:42 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -653,30 +653,30 @@
        }
 }
 // 
-----------------------------------------------------------------------------
-void OCfgImport::setProperties()
+void OCfgImport::setProperties(sal_Int16 _eType)
 {
-       if ( m_aValues.getLength() )
+       if ( m_aValues[_eType].getLength() )
        {
-               OSL_ENSURE(m_aProperties.getLength() == 
m_aValues.getLength(),"Count is not equal!");
+               OSL_ENSURE(m_aProperties[_eType].getLength() == 
m_aValues[_eType].getLength(),"Count is not equal!");
                try
                {
                        Reference< XMultiPropertySet >  xFormMultiSet;
-                       if ( m_xCurrentColumn.is() )
+                       if ( _eType == COLUMN )
                                xFormMultiSet.set(m_xCurrentColumn,UNO_QUERY);
-                       else if ( m_xCurrentObject.is() )
+                       else if ( _eType == TABLE || _eType == QUERY )
                                xFormMultiSet.set(m_xCurrentObject,UNO_QUERY);
-                       else if ( m_xCurrentDS.is() )
+                       else if ( _eType == DATASOURCE )
                                xFormMultiSet.set(m_xCurrentDS,UNO_QUERY);
 
                        if ( xFormMultiSet.is() )
-                               xFormMultiSet->setPropertyValues(m_aProperties, 
m_aValues);                     
+                               
xFormMultiSet->setPropertyValues(m_aProperties[_eType], m_aValues[_eType]);
                }
                catch(const Exception& e)
                {
                        throw 
WrappedTargetException(::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("Property 
could not be set.")),*this,makeAny(e));
                }
-               m_aValues = Sequence< Any>();
-               m_aProperties = Sequence< ::rtl::OUString>();
+               m_aValues[_eType] = Sequence< Any>();
+               m_aProperties[_eType] = Sequence< ::rtl::OUString>();
        }
 }
 // 
-----------------------------------------------------------------------------
@@ -819,7 +819,7 @@
                {
                        case DATASOURCE:
                                {
-                                       setProperties();
+                                       setProperties(m_aStack.top().second);
                                        Reference<XStorable> 
xStr(m_xCurrentDS,UNO_QUERY);
                                        if ( xStr.is() )
                                        {
@@ -856,7 +856,7 @@
                                break;
                        case TABLE:
                                {
-                                       setProperties();
+                                       setProperties(m_aStack.top().second);
                                        Reference<XTablesSupplier> 
xSupplier(m_xCurrentDS,UNO_QUERY);
                                        Reference<XNameContainer> 
xTables(xSupplier->getTables(),UNO_QUERY);
                                        ::rtl::OUString sName;
@@ -867,7 +867,7 @@
                                break;
                        case QUERY:
                                {
-                                       setProperties();
+                                       setProperties(m_aStack.top().second);
                                        Reference<XQueryDefinitionsSupplier> 
xQueriesSupplier(m_xCurrentDS,UNO_QUERY);
                                        Reference<XNameContainer> 
xQueries(xQueriesSupplier->getQueryDefinitions(),UNO_QUERY);
                                        
xQueries->insertByName(m_aStack.top().first,makeAny(m_xCurrentObject));
@@ -934,7 +934,7 @@
                        case COLUMN:
                                if ( m_xCurrentColumn.is() )
                                {
-                                       setProperties();
+                                       setProperties(m_aStack.top().second);
                                        Reference<XColumnsSupplier> 
xSupplier(m_xCurrentObject,UNO_QUERY);
                                        Reference<XAppend> 
xAppend(xSupplier->getColumns(),UNO_QUERY);
                                        if ( xAppend.is() )
@@ -993,9 +993,11 @@
                                        
                                        if ( sProp.getLength() )
                                        {
-                                               sal_Int32 nPos = 
m_aProperties.getLength();
-                                               m_aProperties.realloc(nPos+1);
-                                               m_aProperties[nPos] = sProp;
+                        if ( m_aProperties.find(m_aStack.top().second) == 
m_aProperties.end() )
+                            m_aProperties.insert(::std::map< sal_Int16 
,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< 
::rtl::OUString>()));
+                                               sal_Int32 nPos = 
m_aProperties[m_aStack.top().second].getLength();
+                                               
m_aProperties[m_aStack.top().second].realloc(nPos+1);
+                                               
m_aProperties[m_aStack.top().second][nPos] = sProp;
                                        }
                                        else if ( aName == 
CONFIGKEY_DBLINK_LOGINTIMEOUT )
                                                
m_aStack.push(TElementStack::value_type(aName,LOGINTIMEOUT));
@@ -1022,9 +1024,11 @@
 
                                        if ( sProp.getLength() )
                                        {
-                                               sal_Int32 nPos = 
m_aProperties.getLength();
-                                               m_aProperties.realloc(nPos+1);
-                                               m_aProperties[nPos] = sProp;
+                        if ( m_aProperties.find(m_aStack.top().second) == 
m_aProperties.end() )
+                            m_aProperties.insert(::std::map< sal_Int16 
,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< 
::rtl::OUString>()));
+                                               sal_Int32 nPos = 
m_aProperties[m_aStack.top().second].getLength();
+                                               
m_aProperties[m_aStack.top().second].realloc(nPos+1);
+                                               
m_aProperties[m_aStack.top().second][nPos] = sProp;
                                        }
                                        else
                                                
m_aStack.push(TElementStack::value_type(aName,NO_PROP));
@@ -1062,9 +1066,11 @@
 
                                        if ( sProp.getLength() )
                                        {
-                                               sal_Int32 nPos = 
m_aProperties.getLength();
-                                               m_aProperties.realloc(nPos+1);
-                                               m_aProperties[nPos] = sProp;
+                        if ( m_aProperties.find(m_aStack.top().second) == 
m_aProperties.end() )
+                            m_aProperties.insert(::std::map< sal_Int16 
,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< 
::rtl::OUString>()));
+                                               sal_Int32 nPos = 
m_aProperties[m_aStack.top().second].getLength();
+                                               
m_aProperties[m_aStack.top().second].realloc(nPos+1);
+                                               
m_aProperties[m_aStack.top().second][nPos] = sProp;
                                        }
                                        else
                                                
m_aStack.push(TElementStack::value_type(aName,NO_PROP));
@@ -1085,9 +1091,11 @@
 
                                        if ( sProp.getLength() )
                                        {
-                                               sal_Int32 nPos = 
m_aProperties.getLength();
-                                               m_aProperties.realloc(nPos+1);
-                                               m_aProperties[nPos] = sProp;
+                        if ( m_aProperties.find(m_aStack.top().second) == 
m_aProperties.end() )
+                            m_aProperties.insert(::std::map< sal_Int16 
,Sequence< ::rtl::OUString> >::value_type(m_aStack.top().second,Sequence< 
::rtl::OUString>()));
+                                               sal_Int32 nPos = 
m_aProperties[m_aStack.top().second].getLength();
+                                               
m_aProperties[m_aStack.top().second].realloc(nPos+1);
+                                               
m_aProperties[m_aStack.top().second][nPos] = sProp;
                                        }
                                        else
                                                
m_aStack.push(TElementStack::value_type(aName,NO_PROP));
@@ -1134,20 +1142,22 @@
                                m_aStack.pop();
                                break;
                        default:
-                               
OSL_ENSURE(m_aProperties.getLength(),"Properties are zero!");
-                               if ( m_aProperties.getLength() )
+                               
OSL_ENSURE(m_aProperties[m_aStack.top().second].getLength(),"Properties are 
zero!");
+                               if ( 
m_aProperties[m_aStack.top().second].getLength() )
                                {
-                                       if ( 
m_aProperties[m_aProperties.getLength()-1] != PROPERTY_LAYOUTINFORMATION )
+                                       if ( 
m_aProperties[m_aStack.top().second][m_aProperties[m_aStack.top().second].getLength()-1]
 != PROPERTY_LAYOUTINFORMATION )
                                        {
                                                if ( !m_bPropertyMayBeVoid && 
!aValue.hasValue() )
                                                {
-                                                       
m_aProperties.realloc(m_aProperties.getLength()-1);
+                                                       
m_aProperties[m_aStack.top().second].realloc(m_aProperties[m_aStack.top().second].getLength()-1);
                                                }
                                                else
                                                {
-                                                       sal_Int32 nPos = 
m_aValues.getLength();
-                                                       
m_aValues.realloc(nPos+1);
-                                                       m_aValues[nPos] = 
aValue;
+                            if ( m_aValues.find(m_aStack.top().second) == 
m_aValues.end() )
+                                m_aValues.insert(::std::map< sal_Int16 
,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>()));
+                                                       sal_Int32 nPos = 
m_aValues[m_aStack.top().second].getLength();
+                                                       
m_aValues[m_aStack.top().second].realloc(nPos+1);
+                                                       
m_aValues[m_aStack.top().second][nPos] = aValue;
                                                }
                                        }
                                        else
@@ -1156,8 +1166,10 @@
                                                {
                                                        Sequence< sal_Int8 > 
aInputSequence;
                                                        aValue >>= 
aInputSequence;
-                                                       sal_Int32 nPos = 
m_aValues.getLength();
-                                                       
m_aValues.realloc(nPos+1);
+                            if ( m_aValues.find(m_aStack.top().second) == 
m_aValues.end() )
+                                m_aValues.insert(::std::map< sal_Int16 
,Sequence< Any> >::value_type(m_aStack.top().second,Sequence< Any>()));
+                                                       sal_Int32 nPos = 
m_aValues[m_aStack.top().second].getLength();
+                                                       
m_aValues[m_aStack.top().second].realloc(nPos+1);
                                                        Sequence< PropertyValue 
> aLayout;
                                                        if ( 
aInputSequence.getLength() )
                                                        {
@@ -1174,7 +1186,7 @@
                                                                else if ( QUERY 
== m_aStack.top().second )
                                                                        
LoadTableFields(xInStream,aLayout);
                                                        }
-                                                       m_aValues[nPos] <<= 
aLayout;
+                                                       
m_aValues[m_aStack.top().second][nPos] <<= aLayout;
                                                }
                                                catch(const Exception& e)
                                                {

File [changed]: cfgimport.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/dbaccess/source/filter/migration/cfgimport.hxx?r1=1.3&r2=1.3.60.1
Delta lines:  +6 -6
-------------------
--- cfgimport.hxx       15 Nov 2004 15:18:07 -0000      1.3
+++ cfgimport.hxx       8 Mar 2005 10:25:42 -0000       1.3.60.1
@@ -2,9 +2,9 @@
  *
  *  $RCSfile: cfgimport.hxx,v $
  *
- *  $Revision: 1.3 $
+ *  $Revision: 1.3.60.1 $
  *
- *  last change: $Author: obo $ $Date: 2004/11/15 15:18:07 $
+ *  last change: $Author: oj $ $Date: 2005/03/08 10:25:42 $
  *
  *  The Contents of this file are made available subject to the terms of
  *  either of the following licenses
@@ -126,8 +126,8 @@
        Reference<XPropertySet>                                                 
                                m_xCurrentDS;
        Reference<XPropertySet>                                                 
                                m_xCurrentObject; /// can either be a query or 
a table
        Reference<XPropertySet>                                                 
                                m_xCurrentColumn;
-       Sequence< ::rtl::OUString>                                              
                                m_aProperties;
-       Sequence< Any>                                                          
                                        m_aValues;
+    ::std::map< sal_Int16 ,Sequence< ::rtl::OUString> >                        
m_aProperties;
+       ::std::map< sal_Int16 ,Sequence< Any> >                      m_aValues;
        ::rtl::OUString                                                         
                                        m_sCurrentDataSourceName;
        ::rtl::OUString                                                         
                                        m_sBookmarkName;
        ::rtl::OUString                                                         
                                        m_sDocumentLocation;
@@ -141,7 +141,7 @@
        void convert();
        void createDataSource(const ::rtl::OUString& _sName);
        void createObject(sal_Bool _bQuery ,const ::rtl::OUString& _sName);
-       void setProperties();
+       void setProperties(sal_Int16 _eType);
 
 protected:
        virtual ~OCfgImport()  throw();




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

Reply via email to