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

List:       koffice
Subject:    Re: [PATCH] Fix table column resizing
From:       Sven Langkamp <longamp () reallygood ! de>
Date:       2003-12-06 0:18:49
[Download RAW message or body]

Am Freitag, 5. Dezember 2003 23:05 schrieben Sie:
> The concept of the patch looks correct to me, making the fix in kwcanvas
> also fixes the preview; but this will do.
>
> A little thing I noticed; you use m_colPositions.count(), why not getCols()
OK, getCols() would be better

> I'm just wondering if a simple QMAX would not suffice?
>
> --- kwtableframeset.cc  1 Dec 2003 16:01:53 -0000       1.258
> +++ kwtableframeset.cc  5 Dec 2003 21:52:26 -0000
> @@ -708,6 +708,8 @@ void KWTableFrameSet::resizeColumn( unsi
>  {
>      kdDebug() << k_funcinfo << col << "," << x << endl;
>      m_colPositions[ col ] = x;
> +    if(col > 0) // make sure col - 1 does not get too small
> +        m_colPositions[col] = QMAX(m_colPositions[col],
> m_colPositions[col-1] + s_minFrameWidth);
>
>      // move all cells right of 'col'
>      for (TableIter cell(this); cell; ++cell) {
>
>
> And if it does not (because you can still make the col right of the moving
> one too small) is it not needed to move all columns right of this one?
>
> --- kwtableframeset.cc  1 Dec 2003 16:01:53 -0000       1.258
> +++ kwtableframeset.cc  5 Dec 2003 22:04:40 -0000
> @@ -708,6 +708,14 @@ void KWTableFrameSet::resizeColumn( unsi
>  {
>      kdDebug() << k_funcinfo << col << "," << x << endl;
>      m_colPositions[ col ] = x;
> +    if(col > 0) // make sure col - 1 does not get too small
> +        m_colPositions[col] = QMAX(x, m_colPositions[col-1] +
> s_minFrameWidth); +    if(col <= getRows()) {
> +        double distance = x - m_colPositions[col+1] - s_minFrameWidth;
> +        if(distance > 0.0) {
> +            // loop over cols 'col' to getCols() and move them 'distance'
> +        }
> +    }
>
>      // move all cells right of 'col'
>      for (TableIter cell(this); cell; ++cell) {
>
>
> Sorry that I can't test this; I don't have a compilable KWord here..
> What do you think?
I think the columns should not be moved. If you move the following columns you 
will have to change the size of the table or the width of the following 
columns. This could disturb the layout of the page/table. If you don't move 
them, only two colums are affected.

By the way OpenOffice doesn't move the colums.

Sven Langkamp

____________________________________
koffice mailing list
koffice@mail.kde.org
To unsubscribe please visit:
https://mail.kde.org/mailman/listinfo/koffice
[prev in list] [next in list] [prev in thread] [next in thread] 

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