summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign/TableController.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/tabledesign/TableController.cxx')
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx15
1 files changed, 13 insertions, 2 deletions
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 542096508337..a848eb8de18c 100644
--- a/dbaccess/source/ui/tabledesign/TableController.cxx
+++ b/dbaccess/source/ui/tabledesign/TableController.cxx
@@ -108,6 +108,9 @@ using namespace ::dbtools;
using namespace ::dbaui;
using namespace ::comphelper;
+// Anzahl Spalten beim Neuanlegen
+#define NEWCOLS 128
+
namespace
{
void dropTable(const Reference<XNameAccess>& _rxTable,const ::rtl::OUString& _sTableName)
@@ -958,7 +961,7 @@ void OTableController::loadData()
OSL_ENSURE(aTypeIter != m_aTypeInfo.end(),"We have no type infomation!");
bool bReadRow = !isAddAllowed();
- for(sal_Int32 i=m_vRowList.size(); i<128; i++ )
+ for(sal_Int32 i=m_vRowList.size(); i < NEWCOLS; i++ )
{
pTabEdRow.reset(new OTableRow());
pTabEdRow->SetReadOnly(bReadRow);
@@ -1579,7 +1582,7 @@ void OTableController::reload()
static_cast<OTableDesignView*>(getView())->Invalidate();
}
// -----------------------------------------------------------------------------
-sal_Int32 OTableController::getFirstEmptyRowPosition() const
+sal_Int32 OTableController::getFirstEmptyRowPosition()
{
sal_Int32 nRet = -1;
::std::vector< ::boost::shared_ptr<OTableRow> >::const_iterator aIter = m_vRowList.begin();
@@ -1592,6 +1595,14 @@ sal_Int32 OTableController::getFirstEmptyRowPosition() const
break;
}
}
+ if ( nRet == -1 )
+ {
+ bool bReadRow = !isAddAllowed();
+ ::boost::shared_ptr<OTableRow> pTabEdRow(new OTableRow());
+ pTabEdRow->SetReadOnly(bReadRow);
+ nRet = m_vRowList.size();
+ m_vRowList.push_back( pTabEdRow);
+ }
return nRet;
}
// -----------------------------------------------------------------------------