From dcf6abfcdf3f4b7aec5796c9f6c806889328135f Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Sat, 13 Jun 2015 10:16:56 +0200 Subject: cppcheck:unreadVariable Change-Id: I03981ceba67280e8ed98a9add7f24b3bd958d522 --- connectivity/source/drivers/dbase/DTable.cxx | 37 +++++++++------------------- 1 file changed, 12 insertions(+), 25 deletions(-) (limited to 'connectivity') 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) -- cgit