summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/misc
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/misc')
-rw-r--r--dbaccess/source/ui/misc/DExport.cxx18
-rw-r--r--dbaccess/source/ui/misc/UITools.cxx11
-rw-r--r--dbaccess/source/ui/misc/WCPage.cxx3
-rw-r--r--dbaccess/source/ui/misc/WColumnSelect.cxx2
-rw-r--r--dbaccess/source/ui/misc/WCopyTable.cxx2
-rw-r--r--dbaccess/source/ui/misc/WNameMatch.cxx2
6 files changed, 21 insertions, 17 deletions
diff --git a/dbaccess/source/ui/misc/DExport.cxx b/dbaccess/source/ui/misc/DExport.cxx
index dc71f6588828..880bb91b3727 100644
--- a/dbaccess/source/ui/misc/DExport.cxx
+++ b/dbaccess/source/ui/misc/DExport.cxx
@@ -234,7 +234,7 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
sal_Int32 nType = aValue;
++nPos;
- if( nType == DataType::VARCHAR)
+ if( nType == DataType::VARCHAR )
{
m_pTypeInfo = TOTypeInfoSP(new OTypeInfo());
@@ -291,7 +291,9 @@ ODatabaseExport::ODatabaseExport(const SharedConnection& _rxConnection,
break;
}
}
- }
+ } // if(xSet.is())
+ if ( !m_pTypeInfo )
+ m_pTypeInfo = TOTypeInfoSP(new OTypeInfo());
SetColumnTypes(pList,_pInfoMap);
}
//---------------------------------------------------------------------------
@@ -432,10 +434,11 @@ sal_Int16 ODatabaseExport::CheckString(const String& aCheckToken, sal_Int16 _nOl
if ( m_pFormatter && m_sNumToken.Len() )
{
LanguageType eNumLang;
- sal_uInt32 nNumberFormat2;
- fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nNumberFormat2,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter);
+ sal_uInt32 nFormatKey;
+ fOutNumber = SfxHTMLParser::GetTableDataOptionsValNum(nFormatKey,eNumLang,m_sTextToken,m_sNumToken,*m_pFormatter);
//double fOutNumber2 = SfxHTMLParser::GetTableDataOptionsValNum(nNumberFormat2,eNumLang,m_sValToken,m_sNumToken,*m_pFormatter);
- nNumberFormat = static_cast<sal_Int16>(nNumberFormat2);
+ Reference<XPropertySet> xProp = xFormats->getByKey(nFormatKey);
+ xProp->getPropertyValue(PROPERTY_TYPE) >>= nNumberFormat;
}
else
{
@@ -559,16 +562,15 @@ void ODatabaseExport::SetColumnTypes(const TColumnVector* _pList,const OTypeInfo
DBG_CHKTHIS(ODatabaseExport,NULL);
if(_pList && _pInfoMap)
{
+ OSL_ENSURE(m_vNumberFormat.size() == m_vColumnSize.size() && m_vColumnSize.size() == _pList->size(),"Illegal columns in list");
Reference< XNumberFormatsSupplier > xSupplier = m_xFormatter->getNumberFormatsSupplier();
Reference< XNumberFormats > xFormats = xSupplier->getNumberFormats();
TColumnVector::const_iterator aIter = _pList->begin();
TColumnVector::const_iterator aEnd = _pList->end();
- for(sal_Int32 i= 0;aIter != aEnd;++aIter,++i)
+ for(sal_Int32 i= 0;aIter != aEnd && (i) < static_cast<sal_Int32>(m_vNumberFormat.size()) && (i) < static_cast<sal_Int32>(m_vColumnSize.size()) ;++aIter,++i)
{
sal_Int32 nDataType;
sal_Int32 nLength(0),nScale(0);
- OSL_ENSURE((i) < static_cast<sal_Int32>(m_vNumberFormat.size()),"m_vFormatKey: Illegal index for vector");
- OSL_ENSURE((i) < static_cast<sal_Int32>(m_vColumnSize.size()),"m_vColumnSize: Illegal index for vector");
sal_Int16 nType = m_vNumberFormat[i];
switch ( nType )
diff --git a/dbaccess/source/ui/misc/UITools.cxx b/dbaccess/source/ui/misc/UITools.cxx
index e38da91c606c..809f9c407e51 100644
--- a/dbaccess/source/ui/misc/UITools.cxx
+++ b/dbaccess/source/ui/misc/UITools.cxx
@@ -590,11 +590,11 @@ TOTypeInfoSP getTypeInfoFromType(const OTypeInfoMap& _rTypeInfo,
// -> drop the precision and the scale restriction, accept any type with the property
// type id (nType)
- OSL_ENSURE(sal_False,
- ( ::rtl::OString("getTypeInfoFromType: did not find a matching type")
- += ::rtl::OString(" (expected type name: ")
- += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding())
- += ::rtl::OString(")! Defaulting to the first matching type.")).getStr());
+ //OSL_ENSURE(sal_False,
+ // ( ::rtl::OString("getTypeInfoFromType: did not find a matching type")
+ // += ::rtl::OString(" (expected type name: ")
+ // += ::rtl::OString(_sTypeName.getStr(), _sTypeName.getLength(), gsl_getSystemTextEncoding())
+ // += ::rtl::OString(")! Defaulting to the first matching type.")).getStr());
for(aIter = aPair.first; aIter != aPair.second; ++aIter)
{
// search the best matching type (now comparing the local names)
@@ -700,6 +700,7 @@ void fillTypeInfo( const Reference< ::com::sun::star::sdbc::XConnection>& _rxCo
nCount = 18;
aTypes.reserve(nCount+1);
aTypes.push_back(-1);
+ aNullable.push_back(sal_False);
for (sal_Int32 j = 1; j <= nCount ; ++j)
{
aTypes.push_back(xResultSetMetaData->getColumnType(j));
diff --git a/dbaccess/source/ui/misc/WCPage.cxx b/dbaccess/source/ui/misc/WCPage.cxx
index 2b4cd971ffa1..a6788ac1926f 100644
--- a/dbaccess/source/ui/misc/WCPage.cxx
+++ b/dbaccess/source/ui/misc/WCPage.cxx
@@ -216,6 +216,7 @@ sal_Bool OCopyTable::LeavePage()
// first check if the table already exists in the database
if( m_pParent->getOperation() != CopyTableOperation::AppendData )
{
+ m_pParent->clearDestColumns();
DynamicTableOrQueryNameCheck aNameCheck( m_pParent->m_xDestConnection, CommandType::TABLE );
SQLExceptionInfo aErrorInfo;
if ( !aNameCheck.isNameValid( m_edTableName.GetText(), aErrorInfo ) )
@@ -342,7 +343,7 @@ sal_Bool OCopyTable::checkAppendData()
{
bNotConvert = sal_True;
m_pParent->m_vColumnPos[i] = ODatabaseExport::TPositions::value_type(nPos,nPos);
- TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getTypeInfo(),bNotConvert);
+ TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getSpecialTypeInfo(),bNotConvert);
if ( !bNotConvert )
{
m_pParent->showColumnTypeNotSupported((*aDestIter)->first);
diff --git a/dbaccess/source/ui/misc/WColumnSelect.cxx b/dbaccess/source/ui/misc/WColumnSelect.cxx
index 0f3f036102d5..9b4ad13d8dc7 100644
--- a/dbaccess/source/ui/misc/WColumnSelect.cxx
+++ b/dbaccess/source/ui/misc/WColumnSelect.cxx
@@ -336,7 +336,7 @@ void OWizColumnSelect::createNewColumn( ListBox* _pListbox,
OFieldDescription* pNewField = new OFieldDescription(*_pSrcField);
pNewField->SetName(sConvertedName);
sal_Bool bNotConvert = sal_True;
- pNewField->SetType(m_pParent->convertType(_pSrcField->getTypeInfo(),bNotConvert));
+ pNewField->SetType(m_pParent->convertType(_pSrcField->getSpecialTypeInfo(),bNotConvert));
if ( !m_pParent->supportsPrimaryKey() )
pNewField->SetPrimaryKey(sal_False);
diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx
index 0cd8ae2dbeb4..ca9aeacf73e4 100644
--- a/dbaccess/source/ui/misc/WCopyTable.cxx
+++ b/dbaccess/source/ui/misc/WCopyTable.cxx
@@ -860,7 +860,7 @@ sal_Bool OCopyTableWizard::CheckColumns(sal_Int32& _rnBreakPos)
{
OFieldDescription* pField = new OFieldDescription(*(*aSrcIter)->second);
pField->SetName(convertColumnName(TExportColumnFindFunctor(&m_vDestColumns),(*aSrcIter)->first,sExtraChars,nMaxNameLen));
- TOTypeInfoSP pType = convertType((*aSrcIter)->second->getTypeInfo(),bRet);
+ TOTypeInfoSP pType = convertType((*aSrcIter)->second->getSpecialTypeInfo(),bRet);
pField->SetType(pType);
if ( !bPKeyAllowed )
pField->SetPrimaryKey(sal_False);
diff --git a/dbaccess/source/ui/misc/WNameMatch.cxx b/dbaccess/source/ui/misc/WNameMatch.cxx
index 93feb3aa49b1..5325f0388cfc 100644
--- a/dbaccess/source/ui/misc/WNameMatch.cxx
+++ b/dbaccess/source/ui/misc/WNameMatch.cxx
@@ -206,7 +206,7 @@ sal_Bool OWizNameMatching::LeavePage()
m_pParent->m_vColumnPos[nPos].first = ++nParamPos;
m_pParent->m_vColumnPos[nPos].second = ::std::distance(pDestColumns->begin(),aDestIter) + 1;
sal_Bool bNotConvert = sal_True;
- TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getTypeInfo(),bNotConvert);
+ TOTypeInfoSP pTypeInfo = m_pParent->convertType((*aDestIter)->second->getSpecialTypeInfo(),bNotConvert);
sal_Int32 nType = ::com::sun::star::sdbc::DataType::VARCHAR;
if ( pTypeInfo.get() )
nType = pTypeInfo->nType;