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

List:       koffice-devel
Subject:    Re: A bug in kspread's dependency tracking.
From:       Stefan Nikolaus <stefan.nikolaus () kdemail ! net>
Date:       2007-09-23 10:26:07
Message-ID: 200709231226.07461.stefan.nikolaus () kdemail ! net
[Download RAW message or body]

On Sunday 23 September 2007 10:02:13 Tadeusz Andrzej Kadlubowski wrote:
> Hello.
>
> For the past two or three days I've been working on a bug in trunk
> kspread. Here's how to reproduce it:
>
> Create an empty spreadsheet. Make a circular dependency A1=A1. Select
> A1 Cell and remove it's content. Select any other cell. The
> RecalcManager::Private::cellsToCalculate() will get into infinite
> recursion on RecalcManager.cpp:164.
>
> The reason it does so is because DependencyManager fails to do its
> job just a moment before. I have tracked this bug to
> DependencyManager::Private::removeDependencies() in
> DependencyManager.cpp:442.
>
> consumers[sheet]->remove( range, cell );
>
> fails silently because range is a QRect(QPoint(1,1), QPoint(1,1))
> whereas consumers[sheet] RTree has a key that is QRectF(QPointF(1,1),
> QPointF(1.8,1.8)).

The latter should actually be QRectF(QPointF(1,1), QPointF(1.9,1.9)) and here 
lies the error. See below.

> At this moment I ask for your advice, as I don't understand how RTree
> works.

The RTree is QRectF based, while QRect is used for cell ranges. As both have 
different semantics (QRectF(1,1,1,1) contains QPoint(2,2); QRect(1,1,1,1) 
does not), the cell ranges have to be adjusted. They are shrinked by 0.1 in 
width and height. This is done in RTree. Most of the affected methods are 
reimplemented and hence take a QRectF as parameter (using a QRect parameter 
would have avoided this issue). In DependencyManager the cell ranges were 
already shrinked by 0.1 and passed to the RTree methods, where they were 
shrinked a second time. That was wrong and is fixed with r715866. I've also 
added some assertions to prevent this in future. Thanks for your report.

Regards,
Stefan
_______________________________________________
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