[Libreoffice] [PATCH] removing mpNotes field from ScBaseCell

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Dec 17 11:43:14 PST 2011


Hello Noel,


> So I've been working on this patch to move mpNotes from ScBaseCell to
> ScTable, and I got it mostly working.
> But I was struggling with leaks and getting the lifecycle of the notes
> to exactly match the lifecycle of the ScBaseCell object.
>

I think that we should go another way. Firstly we should not use a
static variable here. Please make the NotesMap a member variable of
ScTable. I hope that this solves one part of your problem and then we
should no longer need to make the notes directly available to the
cells. Every information we need should already be available in
ScTable and the idea behind this rework is not only to save a bit
memory per cell but to prepare calc for ixion.

Personally I think we should use another datastructure like
std::map<Address2D, ScPostIt*> or bootst::ptr_map<Address2D, ScPostIt>
but that is something we can figure out later. I think for now it is
more important to move the container to ScTable and make it a member
variable.

> So then I had a weird idea - how about if I tied the lifecycles
> together implicitly?
> So I came up with this patch.
>
> It compiles, and passes a make check.
>
> I'll do a memcheck run on Monday when I can get access to my other
> machine with tons of memory.

Markus


More information about the LibreOffice mailing list