diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2003-04-01 13:13:14 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2003-04-01 13:13:14 +0000 |
commit | f3426f57a4956e61321d148945db561f35340f2a (patch) | |
tree | 7c6b4542f3de41d4ce93b5726986cb43865d3889 /extensions/source | |
parent | 3fecd3ca8611e8b3f14cec452db42a5bd7161ac2 (diff) |
INTEGRATION: CWS dba03 (1.9.62); FILE MERGED
2003/03/14 12:23:16 fs 1.9.62.2: RESYNC: (1.9-1.9.22.1); FILE MERGED
2003/02/28 13:41:28 oj 1.9.62.1: #107842# remember type info
Diffstat (limited to 'extensions/source')
-rw-r--r-- | extensions/source/dbpilots/controlwizard.cxx | 28 |
1 files changed, 24 insertions, 4 deletions
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index f6b52575858d..a6419a87ba92 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -2,9 +2,9 @@ * * $RCSfile: controlwizard.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: hr $ $Date: 2003-03-25 16:03:26 $ + * last change: $Author: vg $ $Date: 2003-04-01 14:13:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -128,6 +128,9 @@ #ifndef _CONNECTIVITY_CONNCLEANUP_HXX_ #include <connectivity/conncleanup.hxx> #endif +#ifndef _COM_SUN_STAR_SDBC_DATATYPE_HPP_ +#include <com/sun/star/sdbc/DataType.hpp> +#endif //......................................................................... namespace dbp @@ -594,7 +597,7 @@ namespace dbp m_aContext.aFieldNames.realloc(0); m_aContext.xObjectContainer.clear(); - m_aContext.xFields.clear(); + m_aContext.aTypes.clear(); Any aSQLException; Reference< XPreparedStatement > xStatement; @@ -676,7 +679,24 @@ namespace dbp if (xColumns.is()) { m_aContext.aFieldNames = xColumns->getElementNames(); - m_aContext.xFields = xColumns; + static const ::rtl::OUString s_sFieldTypeProperty = ::rtl::OUString::createFromAscii("Type"); + const ::rtl::OUString* pBegin = m_aContext.aFieldNames.getConstArray(); + const ::rtl::OUString* pEnd = pBegin + m_aContext.aFieldNames.getLength(); + for(;pBegin != pEnd;++pBegin) + { + sal_Int32 nFieldType = DataType::OTHER; + try + { + Reference< XPropertySet > xColumn; + xColumns->getByName(*pBegin) >>= xColumn; + xColumn->getPropertyValue(s_sFieldTypeProperty) >>= nFieldType; + } + catch(Exception&) + { + DBG_ERROR("OControlWizard::initContext: unexpected exception while gathering column information!"); + } + m_aContext.aTypes.insert(OControlWizardContext::TNameTypeMap::value_type(*pBegin,nFieldType)); + } } } catch(SQLContext& e) { aSQLException <<= e; } |