Hi Yue,

On Thursday, 2008-06-26 16:56:14 +0800, Lvyue wrote:

> Really long time no see. :)
> Our network ultimately works today :-/, 
> and I was sorry that we can not talk on IRC.

No problem. We'll meet again next week. If you feel the need to discuss
things in between, we could arrange some day where I could be available
on the channel before I leave home.

> I have fixed the problem we mentioned on last IRC,
> and the work on i66930 is getting progress too.

Fine, good to hear.


> but, seeing the code, I found 2 problems:
> 1. in sc\source\core\tool\interpr5.cxx, void ScInterpreter::ScMatRef(),
> the branch of "if (ScMatrix::IsStringType( nMatValType))".
> I think we should do if (ScMatrix::IsEmptyPathType( nMatValType)) first,
> because of SC_MATVAL_EMPTYPATH = SC_MATVAL_EMPTY | 0x08,
> which means if value type is emptypath, 
> ScMatrix::IsEmptyType( nMatValType) will also return true.

Actually not, see scmatrix.hxx:

    /// Empty, but not empty path or any other type.
    inline static bool IsEmptyType( ScMatValType nType )
    {
        return (nType & SC_MATVAL_EMPTY) == SC_MATVAL_EMPTY;
    }

    /// Empty path, but not empty or any other type.
    inline static bool IsEmptyPathType( ScMatValType nType )
    {
        return (nType & SC_MATVAL_EMPTYPATH) == SC_MATVAL_EMPTYPATH;
    }


> 2. a question.
> also in ScMatRef().
> pDok->GetNumberFormatInfo( nCurFmtType, nCurFmtIndex, aAdr, pCell );
> nFuncFmtType = nCurFmtType;
> nFuncFmtIndex = nCurFmtIndex;
> my question is why we use that cell's type?
> if we need a value, but the cell's type is logical, the result would be wrong.

Note that, unlike Excel, you can format any nmeric value as boolean, it
displays FALSE for the value 0 and TRUE for any other value. Anyway, the
inheritance indeed looks questionable. It is in there since times when
we didn't have different value types in a matrix, probably for user
convenience so a format set at the upper left cell is inherited. Which
also isn't correct in all cases and would had to be overridden with
a different format if needed.

I'd suggest to remove that, but only for the matrix case, not the cell
value in the if(!pMat) case. I guess it could even be replaced by
setting a boolean number format type if ScMatrix::IsBooleanType(
nMatValType) says so. However, for now please keep it and file
a separate issue so we can properly track the change, as it would result
in different behavior for already existing documents.

> For i46681 and i66930, later I will submit patches,
> before that I will test them.
> 
> I know you are very busy now, 
> you can take your time to reply, I'm not in a hury. :)

Well, I'm taking my time today to do some administrative tasks waiting,
including writing some mails ;)

  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/GullFOSS
 Please don't send personal mail to the [EMAIL PROTECTED] account, which I use 
for
 mailing lists only and don't read from outside Sun. Use [EMAIL PROTECTED] 
Thanks.

Attachment: pgp2mf5LrAMDd.pgp
Description: PGP signature

Reply via email to