You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openoffice.apache.org by Clarence GUO <cl...@gmail.com> on 2013/09/07 14:34:58 UTC

[Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Hi~
I'm working on https://issues.apache.org/ooo/show_bug.cgi?id=122927
I delivered patch to the issue, please help to review.

Root Cause:
In 121126, although in description it only mentioned format code issue,
actually the fix is not only for format code but also for output string for
logic formula cell. The second one introduced this issue.
I think the change for output string change for logic formulas is
reasonable because before 12666, from 12666's sample file, a cell with
formula "=2>1" will return 1.0. It is very strange. It should return "TRUE"
like that in MS Excel.
So my fix will based on 12666. The root cause is for logic formula cells,
fix code of 12666 forcibly set output string to true or false. But many AOO
users had manner already that set number format to logic formula cells.
That's different with Excel. In Excel, no matter what number format you set
to logic formula cells, the output strings are always true and false.
In the sample of this issue, users set number format to currency, because
of the forcibly setting, the string changed.

Solution
My solution is to add checking for logic formula cells, if their output
number formats are certain category like number, currency, date, time, etc,
we will not change the output string. but if no certain format categories
were applied, for logic formula cells, will change output string to true
and false.

Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Regina Henschel <rb...@t-online.de>.
Hi Jürgen,

Jürgen Schmidt schrieb:
> On 9/10/13 6:21 PM, Regina Henschel wrote:

[..]
>> Besides solving this concrete issue, I think, it might be worth to
>> re-think about using format code strings at all. The file format itself
>> knows no format codes, but they are resolved to styles and conditional
>> styles in ODF. Using such styles and conditional styles directly in core
>> and UI would give more flexibility than the current format codes and
>> eliminate conversion errors.
>
> this sounds interesting but I believe such a change is better made in
> 4.1 or what do you think?  The risk to introduce new regressions is high,
> isn't it.

That was only a thought. But I had not considered, that number format 
codes are used as parameter in function TEXT and therefore cannot be 
dropped totally. So forget this idea.

Kind regards
Regina




---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Jürgen Schmidt <jo...@gmail.com>.
On 9/10/13 6:21 PM, Regina Henschel wrote:
> Hi Oliver,
> 
> Oliver-Rainer Wittmann schrieb:
>> Hi,
>>
>> On 09.09.2013 15:10, Regina Henschel wrote:
>>> Hi Clarence,
>>>
>>> Clarence GUO schrieb:
>>>> Regina,
>>>> Sorry for my pen mistake, all statement of 12666 in my previous comment
>>>> should be 121126. I also corrected it in the issue.
>>>> About formula "=2>1", it is from the sample XLS in 121126. Once I
>>>> rolled
>>>> back fix code of 121126, I found it returned 1.0.
>>>> I tested formula with "=2>1" which applied currency number format, it
>>>> works.
>>>> Thanks for you reminder, I will add checking "if (&rFormatter==NULL)"
>>>
>>> My build is finished now. It still shows the error, that TRUE and FALSE
>>> cannot be formatted to show currency. The format dialog and the sidebar
>>> property say, that the cell format is "Currency", but the cell itself
>>> shows TRUE and FALSE.
>>>
>>> I have build the version r1520602 with your patch applied. I have used
>>> MSVC 2008 express.
>>>
>>
>> Please have a look at the issue.
>> I have provided my findings and an alternative solution.
> 
> I've started a new build and will report my results in the issue.
> 
> Besides solving this concrete issue, I think, it might be worth to
> re-think about using format code strings at all. The file format itself
> knows no format codes, but they are resolved to styles and conditional
> styles in ODF. Using such styles and conditional styles directly in core
> and UI would give more flexibility than the current format codes and
> eliminate conversion errors.

this sounds interesting but I believe such a change is better made in
4.1 or what do you think? The risk to introduce new regressions is high,
isn't it.

What is the impact for the user or is there an impact at all for our
users. Of course I am no expert in this area, so excuse potential stupid
questions.

Juergen


> 
> Kind regards
> Regina
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Regina Henschel <rb...@t-online.de>.
Hi Oliver,

Oliver-Rainer Wittmann schrieb:
> Hi,
>
> On 09.09.2013 15:10, Regina Henschel wrote:
>> Hi Clarence,
>>
>> Clarence GUO schrieb:
>>> Regina,
>>> Sorry for my pen mistake, all statement of 12666 in my previous comment
>>> should be 121126. I also corrected it in the issue.
>>> About formula "=2>1", it is from the sample XLS in 121126. Once I rolled
>>> back fix code of 121126, I found it returned 1.0.
>>> I tested formula with "=2>1" which applied currency number format, it
>>> works.
>>> Thanks for you reminder, I will add checking "if (&rFormatter==NULL)"
>>
>> My build is finished now. It still shows the error, that TRUE and FALSE
>> cannot be formatted to show currency. The format dialog and the sidebar
>> property say, that the cell format is "Currency", but the cell itself
>> shows TRUE and FALSE.
>>
>> I have build the version r1520602 with your patch applied. I have used
>> MSVC 2008 express.
>>
>
> Please have a look at the issue.
> I have provided my findings and an alternative solution.

I've started a new build and will report my results in the issue.

Besides solving this concrete issue, I think, it might be worth to 
re-think about using format code strings at all. The file format itself 
knows no format codes, but they are resolved to styles and conditional 
styles in ODF. Using such styles and conditional styles directly in core 
and UI would give more flexibility than the current format codes and 
eliminate conversion errors.

Kind regards
Regina


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Oliver-Rainer Wittmann <or...@googlemail.com>.
Hi,

On 09.09.2013 15:10, Regina Henschel wrote:
> Hi Clarence,
>
> Clarence GUO schrieb:
>> Regina,
>> Sorry for my pen mistake, all statement of 12666 in my previous comment
>> should be 121126. I also corrected it in the issue.
>> About formula "=2>1", it is from the sample XLS in 121126. Once I rolled
>> back fix code of 121126, I found it returned 1.0.
>> I tested formula with "=2>1" which applied currency number format, it
>> works.
>> Thanks for you reminder, I will add checking "if (&rFormatter==NULL)"
>
> My build is finished now. It still shows the error, that TRUE and FALSE
> cannot be formatted to show currency. The format dialog and the sidebar
> property say, that the cell format is "Currency", but the cell itself
> shows TRUE and FALSE.
>
> I have build the version r1520602 with your patch applied. I have used
> MSVC 2008 express.
>

Please have a look at the issue.
I have provided my findings and an alternative solution.

Best regards, Oliver.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Oliver-Rainer Wittmann <or...@googlemail.com>.
Hi,

sorry for top-posting.

I propose to have further discussion of this issue in Bugzilla.
Then we have only one place to look where the information/data/... about 
this issue can be found.

Best regards, Oliver.

On 09.09.2013 15:10, Regina Henschel wrote:
> Hi Clarence,
>
> Clarence GUO schrieb:
>> Regina,
>> Sorry for my pen mistake, all statement of 12666 in my previous comment
>> should be 121126. I also corrected it in the issue.
>> About formula "=2>1", it is from the sample XLS in 121126. Once I rolled
>> back fix code of 121126, I found it returned 1.0.
>> I tested formula with "=2>1" which applied currency number format, it
>> works.
>> Thanks for you reminder, I will add checking "if (&rFormatter==NULL)"
>
> My build is finished now. It still shows the error, that TRUE and FALSE
> cannot be formatted to show currency. The format dialog and the sidebar
> property say, that the cell format is "Currency", but the cell itself
> shows TRUE and FALSE.
>
> I have build the version r1520602 with your patch applied. I have used
> MSVC 2008 express.
>
> Kind regards
> Regina
>
>
>
>
>>
>> 2013/9/9 Regina Henschel <rb...@t-online.de>
>>
>>> Hi Clarence,
>>>
>>> I do not understand some part of the description. Questions inline.
>>>
>>> Clarence GUO schrieb:
>>>
>>>   Hi~
>>>> I'm working on
>>>> https://issues.apache.org/ooo/**show_bug.cgi?id=122927<https://issues.apache.org/ooo/show_bug.cgi?id=122927>
>>>>
>>>> I delivered patch to the issue, please help to review.
>>>>
>>>> Root Cause:
>>>> In 121126, although in description it only mentioned format code issue,
>>>> actually the fix is not only for format code but also for output string
>>>> for
>>>> logic formula cell. The second one introduced this issue.
>>>> I think the change for output string change for logic formulas is
>>>> reasonable because before 12666
>>>>
>>>
>>> 12666 ?
>>>
>>>
>>> , from 12666's sample file, a cell with
>>>
>>>> formula "=2>1" will return 1.0.It is very strange. It should return
>>>> "TRUE"
>>>>
>>>> like that in MS Excel.
>>>>
>>>
>>> In all my OOo versions (from 1.1.5 over 2.4.3 to 3.41 and AOO4.0) =2>1
>>> returns TRUE. In which version do you see result 1.0 ?
>>>
>>>
>>>   So my fix will based on 12666. The root cause is for logic formula
>>> cells,
>>>> fix code of 12666 forcibly set output string to true or false. But many
>>>> AOO
>>>> users had manner already that set number format to logic formula cells.
>>>> That's different with Excel. In Excel, no matter what number format you
>>>> set
>>>> to logic formula cells, the output strings are always true and false.
>>>> In the sample of this issue, users set number format to currency,
>>>> because
>>>> of the forcibly setting, the string changed.
>>>>
>>>> Solution
>>>> My solution is to add checking for logic formula cells, if their output
>>>> number formats are certain category like number, currency, date, time,
>>>> etc,
>>>> we will not change the output string. but if no certain format
>>>> categories
>>>> were applied, for logic formula cells, will change output string to
>>>> true
>>>> and false.
>>>>
>>>>
>>> I have applied your patch and build the source. The resulting AOO still
>>> shows the error, that FALSE and TRUE cannot be formatted to currency.
>>> The
>>> formatting to other number formats works. The error happens with IF
>>> with 1
>>> or 2 parameters and with simple comparisons as well.
>>>
>>> But it was not a clean build. I will try it with a clean build, but that
>>> needs half a day on my PC.
>>>
>>> Your patch comes with DOS line ends to me. That might be a problem
>>> with my
>>> browser. But it would be nice, if you verify, that your patch has
>>> UNIX line
>>> ends.
>>>
>>> Kind regards
>>> Regina
>>>
>>>
>>>
>>>
>>>
>>>
>>> ------------------------------**------------------------------**---------
>>>
>>> To unsubscribe, e-mail:
>>> dev-unsubscribe@openoffice.**apache.org<de...@openoffice.apache.org>
>>>
>>> For additional commands, e-mail: dev-help@openoffice.apache.org
>>>
>>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Regina Henschel <rb...@t-online.de>.
Hi Clarence,

Clarence GUO schrieb:
> Regina,
> Sorry for my pen mistake, all statement of 12666 in my previous comment
> should be 121126. I also corrected it in the issue.
> About formula "=2>1", it is from the sample XLS in 121126. Once I rolled
> back fix code of 121126, I found it returned 1.0.
> I tested formula with "=2>1" which applied currency number format, it works.
> Thanks for you reminder, I will add checking "if (&rFormatter==NULL)"

My build is finished now. It still shows the error, that TRUE and FALSE 
cannot be formatted to show currency. The format dialog and the sidebar 
property say, that the cell format is "Currency", but the cell itself 
shows TRUE and FALSE.

I have build the version r1520602 with your patch applied. I have used 
MSVC 2008 express.

Kind regards
Regina




>
> 2013/9/9 Regina Henschel <rb...@t-online.de>
>
>> Hi Clarence,
>>
>> I do not understand some part of the description. Questions inline.
>>
>> Clarence GUO schrieb:
>>
>>   Hi~
>>> I'm working on https://issues.apache.org/ooo/**show_bug.cgi?id=122927<https://issues.apache.org/ooo/show_bug.cgi?id=122927>
>>> I delivered patch to the issue, please help to review.
>>>
>>> Root Cause:
>>> In 121126, although in description it only mentioned format code issue,
>>> actually the fix is not only for format code but also for output string
>>> for
>>> logic formula cell. The second one introduced this issue.
>>> I think the change for output string change for logic formulas is
>>> reasonable because before 12666
>>>
>>
>> 12666 ?
>>
>>
>> , from 12666's sample file, a cell with
>>
>>> formula "=2>1" will return 1.0.It is very strange. It should return
>>> "TRUE"
>>>
>>> like that in MS Excel.
>>>
>>
>> In all my OOo versions (from 1.1.5 over 2.4.3 to 3.41 and AOO4.0) =2>1
>> returns TRUE. In which version do you see result 1.0 ?
>>
>>
>>   So my fix will based on 12666. The root cause is for logic formula cells,
>>> fix code of 12666 forcibly set output string to true or false. But many
>>> AOO
>>> users had manner already that set number format to logic formula cells.
>>> That's different with Excel. In Excel, no matter what number format you
>>> set
>>> to logic formula cells, the output strings are always true and false.
>>> In the sample of this issue, users set number format to currency, because
>>> of the forcibly setting, the string changed.
>>>
>>> Solution
>>> My solution is to add checking for logic formula cells, if their output
>>> number formats are certain category like number, currency, date, time,
>>> etc,
>>> we will not change the output string. but if no certain format categories
>>> were applied, for logic formula cells, will change output string to true
>>> and false.
>>>
>>>
>> I have applied your patch and build the source. The resulting AOO still
>> shows the error, that FALSE and TRUE cannot be formatted to currency. The
>> formatting to other number formats works. The error happens with IF with 1
>> or 2 parameters and with simple comparisons as well.
>>
>> But it was not a clean build. I will try it with a clean build, but that
>> needs half a day on my PC.
>>
>> Your patch comes with DOS line ends to me. That might be a problem with my
>> browser. But it would be nice, if you verify, that your patch has UNIX line
>> ends.
>>
>> Kind regards
>> Regina
>>
>>
>>
>>
>>
>>
>> ------------------------------**------------------------------**---------
>> To unsubscribe, e-mail: dev-unsubscribe@openoffice.**apache.org<de...@openoffice.apache.org>
>> For additional commands, e-mail: dev-help@openoffice.apache.org
>>
>>
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Clarence GUO <cl...@gmail.com>.
Regina,
Sorry for my pen mistake, all statement of 12666 in my previous comment
should be 121126. I also corrected it in the issue.
About formula "=2>1", it is from the sample XLS in 121126. Once I rolled
back fix code of 121126, I found it returned 1.0.
I tested formula with "=2>1" which applied currency number format, it works.
Thanks for you reminder, I will add checking "if (&rFormatter==NULL)"

Clarence




2013/9/9 Regina Henschel <rb...@t-online.de>

> Hi Clarence,
>
> I do not understand some part of the description. Questions inline.
>
> Clarence GUO schrieb:
>
>  Hi~
>> I'm working on https://issues.apache.org/ooo/**show_bug.cgi?id=122927<https://issues.apache.org/ooo/show_bug.cgi?id=122927>
>> I delivered patch to the issue, please help to review.
>>
>> Root Cause:
>> In 121126, although in description it only mentioned format code issue,
>> actually the fix is not only for format code but also for output string
>> for
>> logic formula cell. The second one introduced this issue.
>> I think the change for output string change for logic formulas is
>> reasonable because before 12666
>>
>
> 12666 ?
>
>
> , from 12666's sample file, a cell with
>
>> formula "=2>1" will return 1.0.It is very strange. It should return
>> "TRUE"
>>
>> like that in MS Excel.
>>
>
> In all my OOo versions (from 1.1.5 over 2.4.3 to 3.41 and AOO4.0) =2>1
> returns TRUE. In which version do you see result 1.0 ?
>
>
>  So my fix will based on 12666. The root cause is for logic formula cells,
>> fix code of 12666 forcibly set output string to true or false. But many
>> AOO
>> users had manner already that set number format to logic formula cells.
>> That's different with Excel. In Excel, no matter what number format you
>> set
>> to logic formula cells, the output strings are always true and false.
>> In the sample of this issue, users set number format to currency, because
>> of the forcibly setting, the string changed.
>>
>> Solution
>> My solution is to add checking for logic formula cells, if their output
>> number formats are certain category like number, currency, date, time,
>> etc,
>> we will not change the output string. but if no certain format categories
>> were applied, for logic formula cells, will change output string to true
>> and false.
>>
>>
> I have applied your patch and build the source. The resulting AOO still
> shows the error, that FALSE and TRUE cannot be formatted to currency. The
> formatting to other number formats works. The error happens with IF with 1
> or 2 parameters and with simple comparisons as well.
>
> But it was not a clean build. I will try it with a clean build, but that
> needs half a day on my PC.
>
> Your patch comes with DOS line ends to me. That might be a problem with my
> browser. But it would be nice, if you verify, that your patch has UNIX line
> ends.
>
> Kind regards
> Regina
>
>
>
>
>
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.**apache.org<de...@openoffice.apache.org>
> For additional commands, e-mail: dev-help@openoffice.apache.org
>
>

Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Regina Henschel <rb...@t-online.de>.
Hi Clarence,

I do not understand some part of the description. Questions inline.

Clarence GUO schrieb:
> Hi~
> I'm working on https://issues.apache.org/ooo/show_bug.cgi?id=122927
> I delivered patch to the issue, please help to review.
>
> Root Cause:
> In 121126, although in description it only mentioned format code issue,
> actually the fix is not only for format code but also for output string for
> logic formula cell. The second one introduced this issue.
> I think the change for output string change for logic formulas is
> reasonable because before 12666

12666 ?

, from 12666's sample file, a cell with
> formula "=2>1" will return 1.0.It is very strange. It should return "TRUE"
> like that in MS Excel.

In all my OOo versions (from 1.1.5 over 2.4.3 to 3.41 and AOO4.0) =2>1 
returns TRUE. In which version do you see result 1.0 ?

> So my fix will based on 12666. The root cause is for logic formula cells,
> fix code of 12666 forcibly set output string to true or false. But many AOO
> users had manner already that set number format to logic formula cells.
> That's different with Excel. In Excel, no matter what number format you set
> to logic formula cells, the output strings are always true and false.
> In the sample of this issue, users set number format to currency, because
> of the forcibly setting, the string changed.
>
> Solution
> My solution is to add checking for logic formula cells, if their output
> number formats are certain category like number, currency, date, time, etc,
> we will not change the output string. but if no certain format categories
> were applied, for logic formula cells, will change output string to true
> and false.
>

I have applied your patch and build the source. The resulting AOO still 
shows the error, that FALSE and TRUE cannot be formatted to currency. 
The formatting to other number formats works. The error happens with IF 
with 1 or 2 parameters and with simple comparisons as well.

But it was not a clean build. I will try it with a clean build, but that 
needs half a day on my PC.

Your patch comes with DOS line ends to me. That might be a problem with 
my browser. But it would be nice, if you verify, that your patch has 
UNIX line ends.

Kind regards
Regina






---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Oliver-Rainer Wittmann <or...@googlemail.com>.
Hi,

On 09.09.2013 19:12, Regina Henschel wrote:
> Oliver-Rainer Wittmann schrieb:
>> Hi,
>>
>> On 08.09.2013 20:45, Regina Henschel wrote:
>>> Hi Clarence,
>>>
>>> an additional remark: You should not use rFormatter before you are sure
>>> it exists. Keep "if (&rFormatter==NULL)" at the beginning.
>>>
>>
>> I think testing '&rFormatter' on 'NULL' is non-sense as the pointer to a
>> reference can never be NULL as far as I know. Please correct me, if I am
>> wrong.
>
> Yes, you are right. (&rFormatter==NULL) is strange.
>

I have learned from Herbert that in this case it could be that 
'&rFormatter==NULL'. 'rFormatter' is a parameter passed to the method 
and it could that method is called like <ScCellFormat::GetString(..., 
*pFormatter, ...)> while 'pFormatter==NULL'

Best regards, Oliver.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Regina Henschel <rb...@t-online.de>.
Oliver-Rainer Wittmann schrieb:
> Hi,
>
> On 08.09.2013 20:45, Regina Henschel wrote:
>> Hi Clarence,
>>
>> an additional remark: You should not use rFormatter before you are sure
>> it exists. Keep "if (&rFormatter==NULL)" at the beginning.
>>
>
> I think testing '&rFormatter' on 'NULL' is non-sense as the pointer to a
> reference can never be NULL as far as I know. Please correct me, if I am
> wrong.

Yes, you are right. (&rFormatter==NULL) is strange.

Kind regards
Regina


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Oliver-Rainer Wittmann <or...@googlemail.com>.
Hi,

On 08.09.2013 20:45, Regina Henschel wrote:
> Hi Clarence,
>
> an additional remark: You should not use rFormatter before you are sure
> it exists. Keep "if (&rFormatter==NULL)" at the beginning.
>

I think testing '&rFormatter' on 'NULL' is non-sense as the pointer to a 
reference can never be NULL as far as I know. Please correct me, if I am 
wrong.

I assume that the existence of this check is an overseen from a former 
refactoring which had changed pointer parameter "SvNumberFormatter* 
pFormatter" into reference parameter "SvNumberFormatter& rFormatter".

Best regards, Oliver.

> Kind regards
> Regina
>
> Clarence GUO schrieb:
>> Hi~
>> I'm working on https://issues.apache.org/ooo/show_bug.cgi?id=122927
>> I delivered patch to the issue, please help to review.
>>
>> Root Cause:
>> In 121126, although in description it only mentioned format code issue,
>> actually the fix is not only for format code but also for output
>> string for
>> logic formula cell. The second one introduced this issue.
>> I think the change for output string change for logic formulas is
>> reasonable because before 12666, from 12666's sample file, a cell with
>> formula "=2>1" will return 1.0. It is very strange. It should return
>> "TRUE"
>> like that in MS Excel.
>> So my fix will based on 12666. The root cause is for logic formula cells,
>> fix code of 12666 forcibly set output string to true or false. But
>> many AOO
>> users had manner already that set number format to logic formula cells.
>> That's different with Excel. In Excel, no matter what number format
>> you set
>> to logic formula cells, the output strings are always true and false.
>> In the sample of this issue, users set number format to currency, because
>> of the forcibly setting, the string changed.
>>
>> Solution
>> My solution is to add checking for logic formula cells, if their output
>> number formats are certain category like number, currency, date, time,
>> etc,
>> we will not change the output string. but if no certain format categories
>> were applied, for logic formula cells, will change output string to true
>> and false.
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
> For additional commands, e-mail: dev-help@openoffice.apache.org
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org


Re: [Request for review] - Solution for 122927 - =IF(AK3=" ";0;IF(AK3="Y";195;IF(AK3="N";125))) produces FALSE instead of $0.00

Posted by Regina Henschel <rb...@t-online.de>.
Hi Clarence,

an additional remark: You should not use rFormatter before you are sure 
it exists. Keep "if (&rFormatter==NULL)" at the beginning.

Kind regards
Regina

Clarence GUO schrieb:
> Hi~
> I'm working on https://issues.apache.org/ooo/show_bug.cgi?id=122927
> I delivered patch to the issue, please help to review.
>
> Root Cause:
> In 121126, although in description it only mentioned format code issue,
> actually the fix is not only for format code but also for output string for
> logic formula cell. The second one introduced this issue.
> I think the change for output string change for logic formulas is
> reasonable because before 12666, from 12666's sample file, a cell with
> formula "=2>1" will return 1.0. It is very strange. It should return "TRUE"
> like that in MS Excel.
> So my fix will based on 12666. The root cause is for logic formula cells,
> fix code of 12666 forcibly set output string to true or false. But many AOO
> users had manner already that set number format to logic formula cells.
> That's different with Excel. In Excel, no matter what number format you set
> to logic formula cells, the output strings are always true and false.
> In the sample of this issue, users set number format to currency, because
> of the forcibly setting, the string changed.
>
> Solution
> My solution is to add checking for logic formula cells, if their output
> number formats are certain category like number, currency, date, time, etc,
> we will not change the output string. but if no certain format categories
> were applied, for logic formula cells, will change output string to true
> and false.
>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@openoffice.apache.org
For additional commands, e-mail: dev-help@openoffice.apache.org