[REVIEW 3-6] fix for fdo#56742 , ScRangeList::UpdateReference does not handle URM_COPY

Markus Mohrhard markus.mohrhard at googlemail.com
Sat Dec 15 18:10:07 PST 2012


Hey Eike,

>
>> [1] fixes [2] which is more or less a problem in
>> ScRangeList::UpdateReference but we can't safely change it as there
>> might be some users that rely on this behavior. So we just map
>> URM_COPY to URM_MOVE which does the right thing in our case too.
>
> Hmm.. sure it doesn't introduce unwanted side effects?
> When copying from one sheet to another, previously all relative
> references where then relative to the new position with same offsets.
> With the change relative references "moved" along with the range still
> do this, but references pointing outside that range now still point to
> the old position instead of the new relative position.
>
> Note: I didn't try, just making this up from what I know about
>       reference handling so far..
>

I'm only using URM_MOVE to update references inside a ScRangeList
which just contains a vector of ScRange entries. Since ScRange does
not contain a notion of relative or absolute references this is a safe
change,

Two lines later where I call UpdateReference for the entries which
might contain formulas I still use the original URM_* netry.

Regards,
Markus


More information about the LibreOffice mailing list