[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    koffice/kexi/plugins/tables
From:       Jaroslaw Staniek <js () iidea ! pl>
Date:       2005-04-23 21:01:12
Message-ID: 20050423210112.BD0E1492 () office ! kde ! org
[Download RAW message or body]

CVS commit by staniek: 

Table Designer
- on switching to design mode, row buffers are initialized after old buffers 
  are cleared, not before (this fixes bug with disappearing propery buffer)


  M +4 -1      kexialtertable_dataview.cpp   1.8
  M +18 -7     kexialtertabledialog.cpp   1.87


--- koffice/kexi/plugins/tables/kexialtertable_dataview.cpp  #1.7:1.8
@@ -34,7 +34,10 @@ KexiAlterTable_DataView::KexiAlterTable_
 KexiAlterTable_DataView::~KexiAlterTable_DataView()
 {
-        if (dynamic_cast<KexiDataTableView*>(tableView())->cursor())
+        if (dynamic_cast<KexiDataTableView*>(tableView()) 
+                && dynamic_cast<KexiDataTableView*>(tableView())->cursor())
+        {
                 mainWin()->project()->dbConnection()->deleteCursor( 
                         dynamic_cast<KexiDataTableView*>(tableView())->cursor() );
+        }
 }
 

--- koffice/kexi/plugins/tables/kexialtertabledialog.cpp  #1.86:1.87
@@ -168,8 +169,8 @@ void KexiAlterTableDialog::initData()
         if (tempData()->table) {
                 tableFieldCount = tempData()->table->fieldCount();
-                d->buffers->clear(tableFieldCount);
+//not needed            d->buffers->clear(tableFieldCount);
 
-                for(int i=0; i < tableFieldCount; i++)
-                {
+                //recreate table data rows
+                for(int i=0; i < tableFieldCount; i++) {
                         KexiDB::Field *field = tempData()->table->field(i);
                         KexiTableItem *item = new KexiTableItem(0);
@@ -182,10 +183,11 @@ void KexiAlterTableDialog::initData()
                         d->data->append(item);
         
-                        createPropertyBuffer( i, field );
-                }
+//later!                        createPropertyBuffer( i, field );
         }
-        else {
-                d->buffers->clear();//default size
         }
+//      else {
+//              d->buffers->clear();//default size
+//      }
+
         //add empty space
         const int columnsCount = d->data->columnsCount();
@@ -195,6 +197,15 @@ void KexiAlterTableDialog::initData()
         }
 
+        //set data for our spreadsheet: this will clear our buffers
         m_view->setData(d->data);
 
+        //now recreate property buffers
+        if (tempData()->table) {
+                for(int i=0; i < tableFieldCount; i++) {
+                        KexiDB::Field *field = tempData()->table->field(i);
+                        createPropertyBuffer( i, field );
+                }
+        }
+
         //column widths
         m_view->setColumnWidth(COLUMN_ID_PK, IconSize( KIcon::Small ) + 10);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic