summaryrefslogtreecommitdiff
path: root/dbaccess
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
commit2141676620130121da7590eda02a235199f527d8 (patch)
treed777091857a19a3fa16ddedde96eb0670210dd64 /dbaccess
parent59d725548db0075ebd230df6cfa09abd76ee1a57 (diff)
dba33g: #i111142# handle insertrow corrected
Diffstat (limited to 'dbaccess')
-rw-r--r--dbaccess/source/ui/inc/TableController.hxx2
-rw-r--r--dbaccess/source/ui/tabledesign/TEditControl.cxx3
-rw-r--r--dbaccess/source/ui/tabledesign/TableController.cxx15
3 files changed, 14 insertions, 6 deletions
diff --git a/dbaccess/source/ui/inc/TableController.hxx b/dbaccess/source/ui/inc/TableController.hxx
index f2e55a709671..3651c5632504 100644
--- a/dbaccess/source/ui/inc/TableController.hxx
+++ b/dbaccess/source/ui/inc/TableController.hxx
@@ -135,7 +135,7 @@ namespace dbaui
inline ::std::vector< ::boost::shared_ptr<OTableRow> >* getRows() { return &m_vRowList; }
/// returns the postion of the the first empty row
- sal_Int32 getFirstEmptyRowPosition() const;
+ sal_Int32 getFirstEmptyRowPosition();
inline const OTypeInfoMap* getTypeInfo() const { return &m_aTypeInfo; }
diff --git a/dbaccess/source/ui/tabledesign/TEditControl.cxx b/dbaccess/source/ui/tabledesign/TEditControl.cxx
index 2910380070c5..f64cabd58653 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 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;
}
// -----------------------------------------------------------------------------