Bug 69170 - right aligned text in table cells
Summary: right aligned text in table cells
Status: RESOLVED FIXED
Alias: None
Product: kword
Classification: Miscellaneous
Component: tables (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR normal
Target Milestone: ---
Assignee: Thomas Zander
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-11-27 18:14 UTC by Thilo Bangert
Modified: 2004-01-16 11:51 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
Two tables with the bug (70.32 KB, image/png)
2003-11-30 12:55 UTC, Sven Langkamp
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thilo Bangert 2003-11-27 18:14:23 UTC
Version:           1.2.94 (using KDE KDE 3.1.4)
Installed from:    Gentoo Packages
Compiler:          gcc2.95.3 
OS:          Linux

how to reproduce

create a table (mine was not inline - 1x2). set alignment in left column to right.

move the cell separator  - making one cell smaller and the other one bigger.

the text in the right aligned cell is not where it should be...
this bug "works" in a variety of directions using different alignments.
Comment 1 Sven Langkamp 2003-11-30 12:32:42 UTC
I can confirm this. The bug appears also in inlined tables. It's not only a text problem, also the colours of table templates are displayed wrong.
Comment 2 Sven Langkamp 2003-11-30 12:55:58 UTC
Created attachment 3472 [details]
Two tables with the bug
Comment 3 David Faure 2004-01-16 11:51:01 UTC
Subject: koffice/kword

CVS commit by faure: 

Fix table row resizing (prevent negative heights), patch by Sven Langkamp.
He says it also fixes #69170.
CCMAIL: 69170-done@bugs.kde.org


  M +16 -1     kwtableframeset.cc   1.260


--- koffice/kword/kwtableframeset.cc  #1.259:1.260
@@ -327,4 +327,5 @@ void KWTableFrameSet::recalcCols(int _co
     }
     updateFrames();
+    layout();
     //kdDebug(32004) << "end KWTableFrameSet::recalcCols" << endl;
 }
@@ -728,5 +729,19 @@ void KWTableFrameSet::resizeRow( unsigne
 {
     kdDebug() << k_funcinfo << row << "," << y << endl;
+    double difference = m_rowPositions[row];
+    if ((row != 0) && (y - m_rowPositions[ row-1 ] < s_minFrameHeight))
+      m_rowPositions[ row ] = m_rowPositions[ row-1 ] + s_minFrameHeight;
+    else
+      if ((row != getRows()) && (m_rowPositions[ row + 1 ] - y < s_minFrameHeight))
+        m_rowPositions[row] = m_rowPositions[ row + 1 ] - s_minFrameHeight;
+      else
     m_rowPositions[ row ] = y;
+    difference = m_rowPositions[row] - difference;
+
+    //move all rows under 'row'
+    if (row != 0)
+       for (int i=row+1; i<= getRows(); i++)
+           m_rowPositions[i] = m_rowPositions[i] + difference;
+
     // move all cells under 'row'
     for (TableIter cell(this); cell; ++cell) {