List Info

Thread: Re: ScRange::Parse return values




Re: ScRange::Parse return values
user name
2007-10-23 05:32:47
Hi Noel,

On Tuesday, 2007-10-23 11:00:01 +0100, Noel Power wrote:

> Well, I also looked in the archives ( because I only
had the last 2
> messages in my mbox ) and I noticed Niklas's comment
about using
> ScRange::ParseAny in ScRangeList::Parse - this *seems*
to do exactly the
> right thing ( of course additionally the address =
address + ':' address
> has to be removed also ) and is a much better solution
than my 'hacky'
> patch.

You were faster than me.. I also wanted to suggest to use
ScRange::ParseAny. However, care must be taken of the
assignment of
USHORT nRes such that for a valid single address it must be
extended to
form a bitmask of a valid range that is to be compared with
nMask and
added with nResult &= nRes.

> Is is possible to make this change? are there any
risks?

I don't think so. It shouldn't matter there how a single
address is
converted to a range. If ScRange::ParseAny existed before
the code would
probably had used it..

  Eike

-- 
 OOo/SO Calc core developer. Number formatter stricken i18n
transpositionizer.
 SunSign   0x87F8D412 : 2F58 5236 DB02 F335 8304  7D6C 65C9
F9B5 87F8 D412
 OpenOffice.org Engineering at Sun: http://blogs.sun.com/Gu
llFOSS
 Please don't send personal mail to this erlsun.com
account, which I use for
 mailing lists only and don't read from outside Sun. Use
eracksun.com Thanks.
Re: ScRange::Parse return values
user name
2007-10-23 06:32:25
Hi Eike,
On Tue, 2007-10-23 at 12:32 +0200, Eike Rathke wrote:
> Hi Noel,
> You were faster than me..
well I would have been faster still if I had re-read fully
(and
understood) the content of original thread   
>  I also wanted to suggest to use
> ScRange::ParseAny. However, care must be taken of the
assignment of
> USHORT nRes such that for a valid single address it
must be extended to
> form a bitmask of a valid range that is to be compared
with nMask and
> added with nResult &= nRes.
yes you are right, I am just passing SCA_VALID as the nMask
so I didn't
see this. Given if we change this there is a possibility
that someone
somewhere depends on the full set of range flags being set
do you mean either
    a) the client of ScRangeList::Parse must take care of
this OR 
    b) ScRangeList::Parse should detect the single range was
parsed by
ScRange::ParseAny and it should apply the remaining flags (
SCA_VALID_COL2 | SCA_VALID_ROW2 | SCA_VALID_TAB2 ) OR
    c) ScRange::ParseAny should apply the extra flags it
successfully
parses the string

a) would mean finding every caller :-(
b) has some merit because it's an internal change
c) you could argue that if someone calls something called
ScRange::parseAny they would expect success to mean the full
set of
flags to be set regardless of whether the range was formed
from single
address or not

so, I am a little uncertain as to what/where extra changes
are needed  
what do you think?

Noel

------------------------------------------------------------
---------
To unsubscribe, e-mail: dev-unsubscribesc.openoffice.org
For additional commands, e-mail: dev-helpsc.openoffice.org


[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )