summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/tabledesign
diff options
context:
space:
mode:
authorOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-07-08 14:32:56 +0200
committerOcke Janssen [oj] <Ocke.Janssen@sun.com>2010-07-08 14:32:56 +0200
commit3299b5654699fc7bc460e6683c8598c1686f8d07 (patch)
tree69ad5cdfe1fdb012a7b81aed7b282275b0fd33e6 /dbaccess/source/ui/tabledesign
parentf14fd48792162934514527f60a7d0e8e55f9f3e2 (diff)
dba33g: #i111142# handle insertrow corrected
Diffstat (limited to 'dbaccess/source/ui/tabledesign')
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx15
2 files changed, 13 insertions, 5 deletions
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 9169bf643..69fe58bd4 100644
--- a/dbaccess/source/ui/tabledesign/TEditControl.cxx
+++ b/dbaccess/source/ui/tabledesign/TEditControl.cxx
@@ -134,9 +134,6 @@ DBG_NAME(OTableEditorCtrl)
#define HANDLE_ID 0
-// Anzahl Spalten beim Neuanlegen
-#define NEWCOLS 128
-
// default Spaltenbreiten
#define FIELDNAME_WIDTH 100
#define FIELDTYPE_WIDTH 150
diff --git a/dbaccess/source/ui/tabledesign/TableController.cxx b/dbaccess/source/ui/tabledesign/TableController.cxx
index 05b72dc89..180019a8e 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;
}
// -----------------------------------------------------------------------------