Bug 112243 - Quanta crashes sometimes directly after working with table-assistant.
Summary: Quanta crashes sometimes directly after working with table-assistant.
Status: RESOLVED FIXED
Alias: None
Product: quanta
Classification: Miscellaneous
Component: general (show other bugs)
Version: unspecified
Platform: OpenSUSE Linux
: NOR crash (vote)
Target Milestone: ---
Assignee: András Manţia
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-08 15:36 UTC by franbe
Modified: 2005-09-16 18:28 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description franbe 2005-09-08 15:36:19 UTC
Version:            (using KDE KDE 3.4.0)
Installed from:    SuSE RPMs
OS:                Linux

Problem with Table-Wizard.

Basically quanta crashes after clicking ok in Table-wizard sometimes.

I created a tablewith the wizard an melted/spanned (col/rowspan) some cells.
I click ok.
Everything as planned.
I start the wizard to edit the same table.
The wizard recognizes the table wrong.
Wrong row-/colspans sometimes the wizards shows too many columns or rows.
I change the table-width and cell-width.

Then I leave the wizard by clicking ok-button.

Sometimes it crashes sometimes it doesn't.
Comment 1 András Manţia 2005-09-14 13:50:13 UTC
Can you at list give me an example how to create a table - or send a 
html file with such a table - which is not recognized by the wizard? 
Best if that example can be used to reproduce the crash. 
 
Comment 2 András Manţia 2005-09-16 18:28:54 UTC
SVN commit 461153 by amantia:

Fix the rest of merging related table bugs found by Jens.
Should fix also 112243. Please test it, if you have a chance.

BUG: 112243

 M  +19 -6     tableeditor.cpp  


--- branches/KDE/3.5/kdewebdev/quanta/components/tableeditor/tableeditor.cpp #461152:461153
@@ -404,7 +404,7 @@
       {
         maxCol = (nCol > maxCol) ? nCol : maxCol;
         maxCol = (maxCol == 0) ? 1 : maxCol;
-        for (int col = 0; col < maxCol - nCol; col++)
+        for (int col = nCol; col < maxCol; col++)
         {
           if (mergeMatrix[nRow - 1][col].node != 0L) {
             if (m_colSpin->value() < col)
@@ -415,19 +415,17 @@
             m_dataTable->item(nRow-1, col)->setEnabled(false);
             tableNode.node = new Node(0L);
             tableNode.node->tag = new Tag(*(n->tag));
-      configureCell(nRow-1,  col, tableNode.node);
+            configureCell(nRow-1,  col, tableNode.node);
             newNum++;
             tableNode.merged = true;
             tableNode.mergedRow = tableN.mergedRow;
             tableNode.mergedCol = tableN.mergedCol;
             tableRowTags.append(tableNode);
-           // col++;
-            nCol++;
             if ((uint)nCol >= mergeMatrix[0].size())  // Check if there are enough cols
               for (uint i=0; i<mergeMatrix.size(); i++)
                 mergeMatrix[i].resize(2 * mergeMatrix[i].size());
   
-          } 
+          } else
           {
             tableNode.node = new Node(0L);
             newNum++;
@@ -502,7 +500,7 @@
               m_dataTable->item(nRow-1, lastCol + i)->setEnabled(false);
               tableNode.node = new Node(0L);
               tableNode.node->tag = new Tag(*(n->tag));
-	      configureCell(nRow-1,  col, tableNode.node);
+              configureCell(nRow-1,  col, tableNode.node);
               newNum++;
               tableNode.merged = true;
               tableNode.mergedRow = nRow - 1;
@@ -899,6 +897,21 @@
 {
   if (m_row == -1)
     m_row = m_dataTable->numRows() - 1;
+  int i = 0;
+  int j = 0;
+  for (QValueList<QValueList<TableNode> >::Iterator it = m_tableTags->begin(); it != m_tableTags->end(); ++it) {
+      j = 0;
+      for (QValueList<TableNode>::Iterator it2 = (*it).begin(); it2 != (*it).end(); ++it2) {
+        if ((*it2).merged && (*it2).mergedRow == m_row) {
+          (*it2).merged = false;
+          setCellText(m_dataTable, i, j, tagContent((*it2).node));
+          m_dataTable->item(i, j)->setEnabled(true);
+          (*it2).node->tag->deleteAttribute("colspan");
+        }
+        j++;
+      }
+      i++;
+  }
   QValueList<QValueList<TableNode> >::Iterator it2 = m_tableTags->at(m_row);
   for (QValueList<TableNode>::Iterator it3 = (*it2).begin(); it3 != (*it2).end(); ++it3) {
     if ((*it3).merged)