Tag: cws_src680_dba202e User: oj Date: 06/01/03 01:43:35 Modified: /dba/dbaccess/source/ui/misc/ DExport.cxx, HtmlReader.cxx, RtfReader.cxx, TableCopyHelper.cxx, WColumnSelect.cxx, WCopyTable.cxx, WTypeSelect.cxx
Log: #i59833# exception caught File Changes: Directory: /dba/dbaccess/source/ui/misc/ ======================================== File [changed]: DExport.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/DExport.cxx?r1=1.26&r2=1.26.56.1 Delta lines: +33 -15 --------------------- --- DExport.cxx 23 Sep 2005 12:36:23 -0000 1.26 +++ DExport.cxx 3 Jan 2006 09:43:26 -0000 1.26.56.1 @@ -4,9 +4,9 @@ * * $RCSfile: DExport.cxx,v $ * - * $Revision: 1.26 $ + * $Revision: 1.26.56.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:36:23 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:26 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -138,6 +138,12 @@ #ifndef _COM_SUN_STAR_SDB_SQLCONTEXT_HPP_ #include <com/sun/star/sdb/SQLContext.hpp> #endif +#ifndef _DBAUI_SQLMESSAGE_HXX_ +#include "sqlmessage.hxx" +#endif +#ifndef _SV_MSGBOX_HXX +#include <vcl/msgbox.hxx> +#endif #define CONTAINER_ENTRY_NOTFOUND ((ULONG)0xFFFFFFFF) @@ -165,7 +171,9 @@ const Reference< ::com::sun::star::lang::XMultiServiceFactory >& _rM, const TColumnVector* pList, const OTypeInfoMap* _pInfoMap) - :m_nColumnPos(0) + :m_pColumnList(pList) + ,m_pInfoMap(_pInfoMap) + ,m_nColumnPos(0) ,m_nRows(1) ,m_nRowCount(0) ,m_bError(FALSE) @@ -205,11 +213,6 @@ { SvtSysLocale aSysLocale; m_nLocale = aSysLocale.GetLocaleData().getLocale(); -// Any aValue = ConfigManager::GetDirectConfigProperty(ConfigManager::LOCALE); -// m_nLocale.Language = ::comphelper::getString(aValue); -// String sLanguage, sCountry; -// ConvertLanguageToIsoNames(Window::GetSettings().GetLanguage(), sLanguage, sCountry); -// m_nLocale = Locale(sLanguage, sCountry, ::rtl::OUString()); } catch(Exception&) { @@ -224,6 +227,8 @@ const TColumnVector* pList, const OTypeInfoMap* _pInfoMap) :m_xConnection(_rxConnection) + ,m_pColumnList(NULL) + ,m_pInfoMap(NULL) ,m_nColumnPos(0) ,m_nRows(1) ,m_nRowCount(0) @@ -233,7 +238,7 @@ ,m_bHead(TRUE) ,m_bDontAskAgain(sal_False) ,m_bIsAutoIncrement(sal_False) - ,m_aDestColumns(_rxConnection->getMetaData().is() && _rxConnection->getMetaData()->storesMixedCaseQuotedIdentifiers() == sal_True) + ,m_aDestColumns(_rxConnection->getMetaData().is() && _rxConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers() == sal_True) ,m_xFactory(_rM) ,m_pTypeInfo() ,m_bFoundTable(sal_False) @@ -244,11 +249,6 @@ { SvtSysLocale aSysLocale; m_nLocale = aSysLocale.GetLocaleData().getLocale(); -// Any aValue = ConfigManager::GetDirectConfigProperty(ConfigManager::LOCALE); -// m_nLocale.Language = ::comphelper::getString(aValue); -// String sLanguage, sCountry; -// ConvertLanguageToIsoNames(Window::GetSettings().GetLanguage(), sLanguage, sCountry); -// m_nLocale = Locale(sLanguage, sCountry, ::rtl::OUString()); } catch(Exception&) { @@ -399,6 +399,7 @@ { OSL_ENSURE((m_nColumnPos) < static_cast<sal_Int32>(m_vColumns.size()),"Illegal index for vector"); + OSL_ENSURE(m_vColumns[m_nColumnPos].first < static_cast<sal_Int32>(m_vFormatKey.size()),"Illegal index for vector"); m_vFormatKey[m_vColumns[m_nColumnPos].first] = nFormat; // wird sp"ater f"ur die Column gebraucht switch(nType) { @@ -722,6 +723,23 @@ } return bError; +} +//--------------------------------------------------------------------------------- +void ODatabaseExport::showErrorDialog(const ::com::sun::star::sdbc::SQLException& e) +{ + if(!m_bDontAskAgain) + { + String aMsg(e.Message); + aMsg += '\n'; + aMsg += String(ModuleRes(STR_QRY_CONTINUE)); + OSQLMessageBox aBox(NULL, String(ModuleRes(STR_STAT_WARNING)), + aMsg, WB_YES_NO | WB_DEF_NO, OSQLMessageBox::Warning); + + if (aBox.Execute() == RET_YES) + m_bDontAskAgain = TRUE; + else + m_bError = TRUE; + } // if(!m_bDontAskAgain) } // ----------------------------------------------------------------------------- File [changed]: HtmlReader.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/HtmlReader.cxx?r1=1.20&r2=1.20.56.1 Delta lines: +25 -24 --------------------- --- HtmlReader.cxx 23 Sep 2005 12:36:45 -0000 1.20 +++ HtmlReader.cxx 3 Jan 2006 09:43:27 -0000 1.20.56.1 @@ -4,9 +4,9 @@ * * $RCSfile: HtmlReader.cxx,v $ * - * $Revision: 1.20 $ + * $Revision: 1.20.56.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:36:45 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -98,12 +98,6 @@ #ifndef _HTMLKYWD_HXX #include <svtools/htmlkywd.hxx> #endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ -#include "sqlmessage.hxx" -#endif -#ifndef _SV_MSGBOX_HXX -#include <vcl/msgbox.hxx> -#endif #ifndef _TOOLS_COLOR_HXX #include <tools/color.hxx> #endif @@ -246,6 +240,7 @@ rInput.Seek(STREAM_SEEK_TO_BEGIN); rInput.ResetError(); SvParserState eParseState = HTMLParser::CallParser(); + SetColumnTypes(m_pColumnList,m_pInfoMap); return m_bFoundTable ? eParseState : SVPAR_ERROR; } // ----------------------------------------------------------------------------- @@ -313,7 +308,17 @@ break; case HTML_TABLEROW_ON: if ( m_xResultSetUpdate.is() ) + { + try + { m_xResultSetUpdate->moveToInsertRow(); // sonst neue Zeile anh"angen + } + catch(SQLException& e) + // UpdateFehlerbehandlung + { + showErrorDialog(e); + } + } else m_bError = sal_True; break; @@ -350,7 +355,15 @@ break; case HTML_TABLEDATA_OFF: { + try + { insertValueIntoColumn(); + } + catch(SQLException& e) + // UpdateFehlerbehandlung + { + showErrorDialog(e); + } m_nColumnPos++; m_sTextToken.Erase(); m_bSDNum = m_bInTbl = sal_False; @@ -373,19 +386,7 @@ ////////////////////////////////////////////////////////////////////// // UpdateFehlerbehandlung { - if(!m_bDontAskAgain) - { - String aMsg(e.Message); - aMsg += '\n'; - aMsg += String(ModuleRes(STR_QRY_CONTINUE)); - OSQLMessageBox aBox(NULL, String(ModuleRes(STR_STAT_WARNING)), - aMsg, WB_YES_NO | WB_DEF_NO, OSQLMessageBox::Warning); - - if (aBox.Execute() == RET_YES) - m_bDontAskAgain = TRUE; - else - m_bError = TRUE; - } + showErrorDialog(e); } m_nColumnPos = 0; break; File [changed]: RtfReader.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/RtfReader.cxx?r1=1.16&r2=1.16.56.1 Delta lines: +25 -21 --------------------- --- RtfReader.cxx 23 Sep 2005 12:37:18 -0000 1.16 +++ RtfReader.cxx 3 Jan 2006 09:43:27 -0000 1.16.56.1 @@ -4,9 +4,9 @@ * * $RCSfile: RtfReader.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.16.56.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:37:18 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -77,9 +77,6 @@ #ifndef _COM_SUN_STAR_UTIL_XNUMBERFORMATTYPES_HPP_ #include <com/sun/star/util/XNumberFormatTypes.hpp> #endif -#ifndef _DBAUI_SQLMESSAGE_HXX_ -#include "sqlmessage.hxx" -#endif #ifndef DBACCESS_SHARED_DBUSTRINGS_HRC #include "dbustrings.hrc" #endif @@ -169,6 +166,7 @@ rInput.Seek(STREAM_SEEK_TO_BEGIN); rInput.ResetError(); SvParserState eParseState = SvRTFParser::CallParser(); + SetColumnTypes(m_pColumnList,m_pInfoMap); return m_bFoundTable ? eParseState : SVPAR_ERROR; } // --------------------------------------------------------------------------- @@ -219,7 +217,17 @@ if(!m_xTable.is()) // erste Zeile als Header verwenden m_bError = !CreateTable(nToken); else + { + try + { m_xResultSetUpdate->moveToInsertRow(); // sonst neue Zeile anh"angen + } + catch(SQLException& e) + // UpdateFehlerbehandlung + { + showErrorDialog(e); + } + } break; case RTF_INTBL: if(m_bInTbl) @@ -233,7 +241,15 @@ break; case RTF_CELL: { + try + { insertValueIntoColumn(); + } + catch(SQLException& e) + // UpdateFehlerbehandlung + { + showErrorDialog(e); + } m_nColumnPos++; m_sTextToken.Erase(); } @@ -252,19 +268,7 @@ ////////////////////////////////////////////////////////////////////// // UpdateFehlerbehandlung { - if(!m_bDontAskAgain) - { - String aMsg(e.Message); - aMsg += '\n'; - aMsg += String(ModuleRes(STR_QRY_CONTINUE)); - OSQLMessageBox aBox(NULL, String(ModuleRes(STR_STAT_WARNING)), - aMsg, WB_YES_NO | WB_DEF_NO, OSQLMessageBox::Warning); - - if (aBox.Execute() == RET_YES) - m_bDontAskAgain = TRUE; - else - m_bError = TRUE; - } + showErrorDialog(e); } m_nColumnPos = 0; break; File [changed]: TableCopyHelper.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/TableCopyHelper.cxx?r1=1.4&r2=1.4.56.1 Delta lines: +5 -5 ------------------- --- TableCopyHelper.cxx 23 Sep 2005 12:37:33 -0000 1.4 +++ TableCopyHelper.cxx 3 Jan 2006 09:43:27 -0000 1.4.56.1 @@ -4,9 +4,9 @@ * * $RCSfile: TableCopyHelper.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.4.56.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:37:33 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -311,10 +311,10 @@ case DataType::CHAR: case DataType::VARCHAR: case DataType::LONGVARCHAR: - FILL_PARAM( ::rtl::OUString, etString) - break; case DataType::DECIMAL: case DataType::NUMERIC: + FILL_PARAM( ::rtl::OUString, etString) + break; case DataType::DOUBLE: case DataType::REAL: FILL_PARAM( double, etDouble) File [changed]: WColumnSelect.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WColumnSelect.cxx?r1=1.16&r2=1.16.64.1 Delta lines: +5 -5 ------------------- --- WColumnSelect.cxx 8 Sep 2005 16:09:40 -0000 1.16 +++ WColumnSelect.cxx 3 Jan 2006 09:43:27 -0000 1.16.64.1 @@ -4,9 +4,9 @@ * * $RCSfile: WColumnSelect.cxx,v $ * - * $Revision: 1.16 $ + * $Revision: 1.16.64.1 $ * - * last change: $Author: rt $ $Date: 2005/09/08 16:09:40 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:27 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -244,7 +244,7 @@ ::rtl::OUString sExtraChars = xMetaData->getExtraNameCharacters(); sal_Int32 nMaxNameLen = m_pParent->getMaxColumnNameLength(); - ::comphelper::TStringMixEqualFunctor aCase(xMetaData->storesMixedCaseQuotedIdentifiers()); + ::comphelper::TStringMixEqualFunctor aCase(xMetaData->supportsMixedCaseQuotedIdentifiers()); ::std::vector< ::rtl::OUString> aRightColumns; fillColumns(pRight,aRightColumns); @@ -294,7 +294,7 @@ ::rtl::OUString sExtraChars = xMetaData->getExtraNameCharacters(); sal_Int32 nMaxNameLen = m_pParent->getMaxColumnNameLength(); - ::comphelper::TStringMixEqualFunctor aCase(xMetaData->storesMixedCaseQuotedIdentifiers()); + ::comphelper::TStringMixEqualFunctor aCase(xMetaData->supportsMixedCaseQuotedIdentifiers()); ::std::vector< ::rtl::OUString> aRightColumns; fillColumns(pRight,aRightColumns); File [changed]: WCopyTable.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WCopyTable.cxx?r1=1.41&r2=1.41.56.1 Delta lines: +16 -11 --------------------- --- WCopyTable.cxx 23 Sep 2005 12:38:55 -0000 1.41 +++ WCopyTable.cxx 3 Jan 2006 09:43:28 -0000 1.41.56.1 @@ -4,9 +4,9 @@ * * $RCSfile: WCopyTable.cxx,v $ * - * $Revision: 1.41 $ + * $Revision: 1.41.56.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:38:55 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:28 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -157,7 +157,7 @@ ,m_xSourceObject(_xSourceObject) ,m_bCreatePrimaryColumn(sal_False) ,m_eCreateStyle(WIZARD_DEF_DATA) - ,m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->storesMixedCaseQuotedIdentifiers()) + ,m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) ,m_xFormatter(_xFormatter) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) ,m_xFactory(_rM) @@ -204,7 +204,7 @@ ,m_xConnection(_xConnection) ,m_bCreatePrimaryColumn(sal_False) ,m_eCreateStyle(WIZARD_DEF_DATA) - ,m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->storesMixedCaseQuotedIdentifiers()) + ,m_mNameMapping(_xConnection->getMetaData().is() && _xConnection->getMetaData()->supportsMixedCaseQuotedIdentifiers()) ,m_vSourceColumns(_rSourceColumns) ,m_xFormatter(_xFormatter) ,m_sTypeNames(ModuleRes(STR_TABLEDESIGN_DBFIELDTYPES)) @@ -249,6 +249,7 @@ m_pTypeInfo = TOTypeInfoSP(new OTypeInfo()); m_pTypeInfo->aUIName = m_sTypeNames.GetToken(TYPE_OTHER); + m_bAddPKFirstTime = sal_True; } //------------------------------------------------------------------------ OCopyTableWizard::~OCopyTableWizard() @@ -335,13 +336,17 @@ TOTypeInfoSP pTypeInfo = queryPrimaryKeyType(m_aDestTypeInfo); if ( pTypeInfo.get() ) { + if ( m_bAddPKFirstTime ) + { OFieldDescription* pField = new OFieldDescription(); pField->SetName(m_aKeyName); pField->FillFromTypeInfo(pTypeInfo,sal_True,sal_True); pField->SetPrimaryKey(sal_True); + m_bAddPKFirstTime = sal_False; insertColumn(0,pField); + } m_vColumnPos.push_back(ODatabaseExport::TPositions::value_type(1,1)); - m_vColumnTypes.push_back(pField->GetType()); + m_vColumnTypes.push_back(pTypeInfo->nType); } } File [changed]: WTypeSelect.cxx Url: http://dba.openoffice.org/source/browse/dba/dbaccess/source/ui/misc/WTypeSelect.cxx?r1=1.22&r2=1.22.56.1 Delta lines: +8 -4 ------------------- --- WTypeSelect.cxx 23 Sep 2005 12:39:11 -0000 1.22 +++ WTypeSelect.cxx 3 Jan 2006 09:43:29 -0000 1.22.56.1 @@ -4,9 +4,9 @@ * * $RCSfile: WTypeSelect.cxx,v $ * - * $Revision: 1.22 $ + * $Revision: 1.22.56.1 $ * - * last change: $Author: hr $ $Date: 2005/09/23 12:39:11 $ + * last change: $Author: oj $ $Date: 2006/01/03 09:43:29 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -114,6 +114,7 @@ case tpFormat: case tpDefault: case tpAutoIncrement: + case tpAutoIncrementValue: break; default: OFieldDescControl::ActivateAggregate( eType ); @@ -127,6 +128,7 @@ case tpFormat: case tpDefault: case tpAutoIncrement: + case tpAutoIncrementValue: break; default: OFieldDescControl::DeactivateAggregate( eType ); @@ -159,7 +161,7 @@ // first we have to check if this name already exists sal_Bool bDoubleName = sal_False; sal_Bool bCase = sal_True; - if ( getMetaData().is() && !getMetaData()->storesMixedCaseQuotedIdentifiers() ) + if ( getMetaData().is() && !getMetaData()->supportsMixedCaseQuotedIdentifiers() ) { bCase = sal_False; USHORT nCount = aListBox.GetEntryCount(); @@ -346,6 +348,8 @@ while(m_lbColumnNames.GetEntryCount()) m_lbColumnNames.RemoveEntry(0); m_lbColumnNames.Clear(); + sal_Int32 nBreakPos; + m_pParent->CheckColumns(nBreakPos); const ODatabaseExport::TColumnVector* pDestColumns = m_pParent->getDestVector(); ODatabaseExport::TColumnVector::const_iterator aIter = pDestColumns->begin(); --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
