Hello Eike,<br><br><div class="gmail_quote">2011/8/16 Eike Rathke <span dir="ltr"><<a href="mailto:ooo@erack.de">ooo@erack.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hi Markus,<br>
<div class="im"><br>
On Tuesday, 2011-08-16 16:25:22 +0200, Markus Mohrhard wrote:<br>
<br>
> > First thing that caught my eye: using toAsciiUpperCase() (or any other<br>
> > ASCII method) on anything that the user inputs as names is a no-no as it<br>
> > doesn't handle Unicode. Use ScGlobal::pCharClass->upper() instead.<br>
><br>
> I think I inherite it from some other places that use range names. So then<br>
> we need to check for all other places too and adjust them accordingly.<br>
<br>
</div>Yes please.<br>
<div class="im"><br>
<br>
> > The change to the ScFormulaCell ctor apparently unconditionally tries to<br>
> > adjust name tokens, this is completely unnecessary in most situations<br>
> > and should be triggered only if the sheets of new and old position<br>
> > differ.<br>
><br>
> No it's not that easy. If we have the same sheet and two different<br>
> documents, we need to adjust too. And we can't simply check that the<br>
> ScDocument instances are different because they will always be. Either we<br>
> have a pointer to the original ScDocument instance in the copy document or<br>
> we must always adjust our range names. I used the second approach because I<br>
> didn't like the other approach.<br>
<br>
</div>So at least compare document instances and sheets and if both are<br>
identical don't do the adjustment, which I think is the most used<br>
scenario when copying cells. Sounds plausible?<br></blockquote><div><br>So just to understand you correctly: You suggest to introduce a new variable ScDocument* pOriginalDoc; in ScDocument and check if this pointer and the address of rNewDoc are the same? I didn't like this very much but I have no strong opinion here. If you think that this would be the better version i will change this.<br>
<br></div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<br>
Btw, how well does this all cope with undo/redo?<br></blockquote><div><br>I don't see any problems with undo/redo. Local range names are copied either way and if global range names are not copied then my check that a global ScRangeName exists will fail and don't adjust anything. But I think we can simply add a check for IsUndo. Then we don't have to think about it anymore.<br>
</div></div><br>Markus<br>