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

List:       koffice-devel
Subject:    Re: Wish 36485: Select all in KSpread
From:       Inge Wallin <inge () lysator ! liu ! se>
Date:       2004-11-03 15:59:37
Message-ID: 200411031659.37486.inge () lysator ! liu ! se
[Download RAW message or body]

On Wednesday 03 November 2004 14.53, Tomas Mecir wrote:
> On Wed, 3 Nov 2004 13:48:59 +0200, Inge Wallin <inge@lysator.liu.se> wrote:
> > On Wednesday 03 November 2004 09.19, Tomas Mecir wrote:
> > I am pretty sure that this is not what makes KSpread crash for me after I
> > selected all.  When I type Ctrl-C (Copy) and Ctrl-V (paste), the crash is
> > instantaneous, without any thrashing, which would not be the case if
> > there was an out-of-memory problem.
> >
> > What I am wondering is how copy/paste works when you select an entire row
> > or column.  I don't see 64K cells getting allocated when that happens, or
> > am I just missing it because I have a too fast computer? I find this
> > unlikely.
>
> Well, KSpreadSheet::saveCellRect is what gets called. It will save
> entire columns/rows if they are selected, so if you did the select-all
> correctly (haven't seen toe code yet), things should work fine. I
> don't really know why it crashes, but gdb is your friend ;)

The code was attached to my original mail. I think that part is correct. The 
problem doesn't manifest itself until I try to do something with the 
selection such as copying it to the clipboard or cutting it.  Also, the 
graphics indicates that things are OK.

Basically, the selection is just 4 integers, the top left corner and the 
bottom right. For a row, this is (1, row) and (KS_maxCOL, row) if I don't 
remember wrong, and for a column it is (col, 1) and (col, KS_maxROW).  My 
selection is (1, 1) and (KS_maxCOL, KS_maxRow).  Note: Please allow for mixed 
up order between rows and columns here since I don't have the code handy 
where I sit now to check.

But I will try and run it in gdb and see what happens.  Btw, I have been doing 
my debugging by using "gdb .lib/kspread" since ./kspread is a shell script 
using libtool.  Is this the way I am supposed to work or is there a better 
way to invoke gdb?

> Also, I have this feeling that the problem could be that you either
> select a bunch of columns, or a bunch of rows. But here, you select it
> all! Both columns and rows. This could be the problem... Or maybe one
> of problems, who knows?

Well I certainly don't.  That is why I addressed you (plural), my enlightened 
seniors. :-)

> > I assumed that when an unlimited area, like an entire row or column, is
> > copied, then only the actual data was stored somewhere, not all the empty
> > cells.  Is that not so?  And if not, why?
>
> Hm, it probably is so, I'm just not sure whether this applies to your
> code. Have a look at kspread_util.cc, functions util_isRowSelected and
> util_isColumnSelected, and ensure that they will correctly report
> success for your selection.

Those functions are trivial (only simple tests against 1 and KS_maxRow or 
KS_maxCol respectively). No problem there.

> > > Maybe it's not that bad, if we manage to persuade
> > > util_isColumnSelected to work with the select-all (and maybe it does
> > > already, not sure), but still...
> >
> > I am not sure exactly what you mean here but it sounds right.  :-)
>
> Hehe :-)
>
> Hm, all in all, I'm not quite convinced whether trying to implement
> selecting of the whole sheet is a good idea at this point - the code
> still has many problems with it...
> I would recommend having a look at a thread called "KSpread tasks",
> and/or at DESIGN.html in the sources, picking some nice thing and
> implementing it.

I have looked at those files.  The problem with the things in there is that 
they all describe big tasks where you need intimate knowledge about the 
internals.  I don't have that.

There is also the issue of usability.  A big and featureful program with many 
small bugs is in many ways worse for the user than a smaller program that has 
few features but that actually works.  I am trying to make what is actually 
implemented already work as expected and to remove all the small unnecessary 
bugs that are reported into Bugzilla.  My main focus is not new features, but 
bug removal.

True, the select all feature might be viewed as new functionality, but it is 
so important that I think that it actually is a bug that it isn't there.

> Oh, and if possible, let us know what you've picked, I may have some
> comments over some of the things listed there, or some maybe
> advices/hints ;)

Ok, If I pick a task from the task list, I will let you know.

	-Inge


-- 
Inge Wallin               | Thus spake the master programmer:               |
                          |      "After three days without programming,     |
inge@lysator.liu.se       |       life becomes meaningless."                |
                          | Geoffrey James: The Tao of Programming.         |
_______________________________________________
koffice-devel mailing list
koffice-devel@kde.org
https://mail.kde.org/mailman/listinfo/koffice-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

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