diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2015-06-13 10:16:56 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2015-06-15 14:06:31 +0200 |
commit | dcf6abfcdf3f4b7aec5796c9f6c806889328135f (patch) | |
tree | f0d7081b5454bbe58318ec87dcc6b5465ed16965 /connectivity | |
parent | 8f60697cf8e5227d503738e3c186433ac5dacfc8 (diff) |
cppcheck:unreadVariable
Change-Id: I03981ceba67280e8ed98a9add7f24b3bd958d522
Diffstat (limited to 'connectivity')
-rw-r--r-- | connectivity/source/drivers/dbase/DTable.cxx | 37 |
1 files changed, 12 insertions, 25 deletions
diff --git a/connectivity/source/drivers/dbase/DTable.cxx b/connectivity/source/drivers/dbase/DTable.cxx index c937eae71faa..ced7ca53127f 100644 --- a/connectivity/source/drivers/dbase/DTable.cxx +++ b/connectivity/source/drivers/dbase/DTable.cxx @@ -2423,34 +2423,21 @@ void ODbaseTable::addColumn(const Reference< XPropertySet >& _xNewColumn) ::dbtools::throwGenericSQLException( sError, *this ); } - bool bAlreadyDroped = false; - try + pNewTable->construct(); + // copy the data + copyData(pNewTable,pNewTable->m_pColumns->getCount()); + // drop the old table + if(DropImpl()) { - pNewTable->construct(); - // copy the data - copyData(pNewTable,pNewTable->m_pColumns->getCount()); - // drop the old table - if(DropImpl()) - { - bAlreadyDroped = true; - pNewTable->renameImpl(m_Name); - // release the temp file - } - xHold = pNewTable = NULL; - - FileClose(); - construct(); - if(m_pColumns) - m_pColumns->refresh(); + pNewTable->renameImpl(m_Name); + // release the temp file } - catch(const SQLException&) - { - // here we know that the old table wasn't dropped before - if(!bAlreadyDroped) - xHold = pNewTable = NULL; + xHold = pNewTable = NULL; - throw; - } + FileClose(); + construct(); + if(m_pColumns) + m_pColumns->refresh(); } void ODbaseTable::dropColumn(sal_Int32 _nPos) |