<div>Hello,<br></div><div><br></div><div>so there is the next try. I&#39;ve just followed Koheis&#39; suggestions and made the anonymous db a part of ScTable.</div><div><br></div><div>Patch is of course under LGPLv3+/MPL.</div>
<div><br></div><div>Markus</div><div><br></div><div>P.S. Sry that patch is not created with git format-patch but I don&#39;t know how to create a patch against a specific point</div><div><br></div><div class="gmail_quote">
2011/3/22 Kohei Yoshida <span dir="ltr">&lt;<a href="mailto:kyoshida@novell.com">kyoshida@novell.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Tue, 2011-03-22 at 19:59 +0100, Markus Mohrhard wrote:<br>
&gt; This time with the patch. Sry.<br>
&gt;<br>
&gt; 2011/3/22 Markus Mohrhard &lt;<a href="mailto:markus.mohrhard@googlemail.com">markus.mohrhard@googlemail.com</a>&gt;<br>
&gt;         Hello,<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;         so I have reworked it. I haven&#39;t reworked the import and<br>
&gt;         export as these affect some areas I don&#39;t fully understand.<br>
<br>
</div>Hi Markus,<br>
<br>
So, I&#39;ve tested your patch, and it works as long as the sheets are not<br>
moved around, but once you start moving sheets around it starts to act a<br>
bit weird.<br>
<br>
Here is an example.  Let&#39;s say you start with an empty document.  You<br>
put some data into Sheet1, and set autofilter there.  Now, move Sheet1<br>
to the right of Sheet3 so that the sheets are in this order (from left<br>
to right): Sheet2, Sheet3 and Sheet1.  Now, put some data into Sheet2<br>
and set autofilter.  The autofilter on Sheet1 now vanishes.<br>
<br>
This was what I was concerned about earlier.  Because we are using the<br>
sheet index as part of the name, and use it to look up the sheet-local<br>
anonymous DB data in ScDocShell::GetDBData(), it becomes susceptible to<br>
sheet relocation.  Note that sheet index (nTab in ScTable) is always<br>
numbered 0, 1, 2, from left to right.  So when you move a sheet, Calc<br>
updates its index to reflect its new position.<br>
<br>
Thinking about this a bit, I think the best solution is *not* to store<br>
the sheet-local anonymous DB&#39;s in the global ScDBCollection instace, but<br>
store them directly in the respective ScTable instance, and adjust the<br>
lookup code accordingly.  I think this is a much better solution given<br>
the constraint, and one that I would feel more comfortable with.  Sorry<br>
I didn&#39;t think of this sooner.... :-/<br>
<br>
Regarding the import export, let&#39;s not worry about that at this stage.<br>
We should first focus on getting the core functionality working first,<br>
before worrying about file import / export.<br>
<br>
Regards,<br>
<font color="#888888"><br>
Kohei<br>
<br>
<br>
</font></blockquote></div><br>