diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-10-10 15:53:35 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-10-10 18:14:35 +0100 |
commit | f5c8a636a644d4b74450de29f11399f3f69f55a7 (patch) | |
tree | 3c8bb37fbd19f0c1eb25cee710b85669b23a5b5a /connectivity/source | |
parent | 9b92b4239e8d8d9657a0ba22959c7b0a99306870 (diff) |
coverity#706302 Uncaught exception
Change-Id: I082b7682124053948733efc2dbe5df6196acaa5f
Diffstat (limited to 'connectivity/source')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 15 | ||||
-rw-r--r-- | connectivity/source/inc/resource/dbase_res.hrc | 1 | ||||
-rw-r--r-- | connectivity/source/resource/conn_shared_res.src | 6 |
3 files changed, 20 insertions, 2 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index 895f0de82e88..a98a54d0397b 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -2256,8 +2256,19 @@ void ODbaseTable::alterColumn(sal_Int32 index, // now drop the old one if( DropImpl() ) // we don't want to delete the memo columns too { - // rename the new one to the old one - pNewTable->renameImpl(m_Name); + try + { + // rename the new one to the old one + pNewTable->renameImpl(m_Name); + } + catch(const css::container::ElementExistException&) + { + const OUString sError( getConnection()->getResources().getResourceStringWithSubstitution( + STR_COULD_NOT_DELETE_FILE, + "$filename$", m_Name + ) ); + ::dbtools::throwGenericSQLException( sError, *this ); + } // release the temp file pNewTable = NULL; ::comphelper::disposeComponent(xHoldTable); diff --git a/connectivity/source/inc/resource/dbase_res.hrc b/connectivity/source/inc/resource/dbase_res.hrc index 54f0232825df..d32caaba33b2 100644 --- a/connectivity/source/inc/resource/dbase_res.hrc +++ b/connectivity/source/inc/resource/dbase_res.hrc @@ -46,6 +46,7 @@ #define STR_INVALID_COLUMN_VALUE ( STR_DBASE_BASE + 18 ) #define STR_TABLE_NOT_DROP ( STR_DBASE_BASE + 19 ) #define STR_COULD_NOT_CREATE_INDEX_KEYSIZE ( STR_DBASE_BASE + 20 ) +#define STR_COULD_NOT_RENAME_FILE ( STR_DBASE_BASE + 21 ) #endif // CONNECTIVITY_RESOURCE_DBASE_HRC diff --git a/connectivity/source/resource/conn_shared_res.src b/connectivity/source/resource/conn_shared_res.src index 1d39e10bdda5..ad5643654833 100644 --- a/connectivity/source/resource/conn_shared_res.src +++ b/connectivity/source/resource/conn_shared_res.src @@ -398,11 +398,17 @@ String STR_SQL_NAME_ERROR { Text [ en-US ] = "The name '$name$' doesn't match SQL naming constraints."; }; + String STR_COULD_NOT_DELETE_FILE { Text [ en-US ] = "The file $filename$ could not be deleted."; }; +String STR_COULD_NOT_RENAME_FILE +{ + Text [ en-US ] = "The file could not be renamed to $filename$."; +}; + String STR_INVALID_COLUMN_TYPE { Text [ en-US ] = "Invalid column type for column '$columnname$'."; |