[Libreoffice] [REVIEW] fix for fdo#39850 and fdo#39820: update range names and database ranges in formula cells

Eike Rathke ooo at erack.de
Tue Aug 16 06:33:54 PDT 2011


Hi Markus,

On Tuesday, 2011-08-16 08:07:20 +0200, Markus Mohrhard wrote:

> this patch might be a bit to big for 3-4, but who knows:
> http://cgit.freedesktop.org/libreoffice/core/commit/?id=04d2e6469529b6187900659517d6f6dd5ea2cca5

First thing that caught my eye: using toAsciiUpperCase() (or any other
ASCII method) on anything that the user inputs as names is a no-no as it
doesn't handle Unicode. Use ScGlobal::pCharClass->upper() instead.

The change to the ScFormulaCell ctor apparently unconditionally tries to
adjust name tokens, this is completely unnecessary in most situations
and should be triggered only if the sheets of new and old position
differ.

Before looping with pCode->GetNext...() it needs a pCode->Reset() first.

In ScTable::CopyToClip() all local range names are copied if none exist
yet on the target. Best would be if only names used by the formulas to
be copied would be copied if not already there, which adjustRangeName
attempts to do. So in CopyToClip initialize
pTable->mpRangeName = new ScRangeName;

Btw, please use 'r' prefix for parameters passed as reference, so
rNewDoc instead of aNewDoc, and please "const as const can", for example
it should be const ScDocument* pOldDoc

Apart from that, I'm currently somewhat handicapped with equipment and
can't check if the change really does what it is supposed to do.

  Eike

-- 
 PGP/OpenPGP/GnuPG encrypted mail preferred in all private communication.
 Key ID: 0x293C05FD - 997A 4C60 CE41 0149 0DB3  9E96 2F1A D073 293C 05FD
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110816/4a8d9634/attachment.pgp>


More information about the LibreOffice mailing list