[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2019-02-26 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

--- Comment #12 from Eike Rathke  ---
Just for explanation of the original description case:
=A1+STYLE(IF(OR(CURRENT() > 4, CURRENT() <3),"green","red"))
The first CURRENT() is the value of A1 pushed last onto the evaluation stack,
the second CURRENT() is the result of the comparison CURRENT() > 4 hence A1 > 4
which yields either 1 or 0 and as such is always <3 therefore the "green" style
is always applied.

As a general advice, do not use the STYLE() function but conditional formatting
instead.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2019-02-26 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Eike Rathke  changed:

   What|Removed |Added

 Status|RESOLVED|CLOSED

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2019-02-26 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Eike Rathke  changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |NOTABUG

--- Comment #11 from Eike Rathke  ---
(In reply to Jiří Boháč from comment #9)
> yes, this is the bug. There cannot be any sane explanation for this:
> 
> =5+OR(0;CURRENT()) = 5
> =5+OR(CURRENT(),0) = 6
That is completely logical.
In the first case, CURRENT() evaluates to 0 because the 0 was pushed last onto
the evaluation stack and OR(0,0) yields 0.
In the second case, CURRENT() evaluates to 5 because the 5 was pushed last onto
the evaluation stack and OR(5,0) yields 1.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2019-02-24 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Roman Kuznetsov <79045_79...@mail.ru> changed:

   What|Removed |Added

 Blocks||108827


Referenced Bugs:

https://bugs.documentfoundation.org/show_bug.cgi?id=108827
[Bug 108827] [META] Calc functions bugs and enhancements
-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs

[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-05 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Xisco Faulí  changed:

   What|Removed |Added

 Status|REOPENED|UNCONFIRMED
 CC||xiscofa...@libreoffice.org
 Ever confirmed|1   |0

--- Comment #10 from Xisco Faulí  ---
You can't confirm your own bugs. Moving it back to UNCONFIRMED until someone
else confirms it.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Jiří Boháč  changed:

   What|Removed |Added

 Resolution|NOTABUG |---
 Status|RESOLVED|REOPENED

--- Comment #9 from Jiří Boháč  ---
(In reply to m.a.riosv from comment #8)
> =5+OR(3;CURRENT())=6
> =5+OR(1;1)=5+1=6

this is correct

> =5+OR(0;CURRENT())=5
> =5+OR(0;0)=5+0=5

yes, this is the bug. There cannot be any sane explanation for this:

=5+OR(0;CURRENT()) = 5
=5+OR(CURRENT(),0) = 6

> CURRENT() takes the value inside the function, what looks fine at that step,
> until the calculation of the function is finished.

Seem CURRENT() in fact returns the value of the first function argument:

=5+POWER(3,CURRENT()) = 5+3^3 = 5+27 = 32
=5+POWER(CURRENT(), 3) = 5 + 5^3  = 130

Parentheses also totally screw it up:

=5+POWER((CURRENT()+1), 3) = 5+(5+1)^3 = 221 (correct)
=5+POWER((1+CURRENT()), 3) = 5+(1+1)^3 = 13 (WTF!)

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

m.a.riosv  changed:

   What|Removed |Added

 Resolution|--- |NOTABUG
 Status|REOPENED|RESOLVED

--- Comment #8 from m.a.riosv  ---
=5+OR(3;CURRENT())=6
=5+OR(1;1)=5+1=6

=5+OR(0;CURRENT())=5
=5+OR(0;0)=5+0=5

=5+OR(CURRENT()<3)+CURRENT()=10
=5+   0   +   5 =10

=5+OR(CURRENT()>3)+CURRENT()=12
=5+   1´  +   6 =12

CURRENT() takes the value inside the function, what looks fine at that step,
until the calculation of the function is finished.

At this time change their behavior it's not an option.

VLOOKUP with an inner array I think can do it.
=A1+STYLE(VLOOKUP(CURRENT();{0|"green";3|"red";4|"green"};2;1))
Change ; and | for your array row and column separator in
Menu/Tools/Options/LibreOffice calc/Formula

Please, if you are not agree reopen it again.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-02 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Jiří Boháč  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|NOTABUG |---

--- Comment #7 from Jiří Boháč  ---
I'm sorry, but it clearly *is* a bug.

See Comment #4.

If "CURRENT() < 3" gives a different result than OR(FALSE(); CURRENT() < "3")
it clearly is a bug.

I think the truly minimal reproducer is in fact this single formula:
=5+OR(FALSE(), CURRENT()<3)
It returns 6 and should return 5.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-01 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

himajin100...@gmail.com changed:

   What|Removed |Added

 Resolution|--- |NOTABUG
 Status|NEEDINFO|RESOLVED

--- Comment #6 from himajin100...@gmail.com ---
I believe m.a.riosv's explanation on comment 5 is correct. This is not a bug.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-01 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

m.a.riosv  changed:

   What|Removed |Added

 Status|UNCONFIRMED |NEEDINFO
 CC||miguelangelrv@libreoffice.o
   ||rg
 Ever confirmed|0   |1

--- Comment #5 from m.a.riosv  ---
What seems a in issue I think it's not, in
=A1+STYLE(IF(OR(CURRENT() > 4, CURRENT() <3),"green","red"))
the second CURRENT() receive their value from the first CURRENT() comparison.

A formula like
=A1+STYLE(IF(O(CURRENT() > 4; CURRENT());"green";"red"))
gives red except for 5.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-01 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

--- Comment #4 from Jiří Boháč  ---
(In reply to Xavier Van Wijmeersch from comment #3)
> try these one

Thanks for the tip, but my actual use case was something much more complicated,
the above formulas are just minimalist reproducers created to help get the bug
fixed.

I actually worked around the problem by replacing IF(OR(a,b),x,y) with this
nested IF(a,x,IF(b,x,y)). Both conditions, a and b, use CURRENT() and it works.
So it seems it's really the combination of OR() and CURRENT() that is broken.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-01 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

--- Comment #3 from Xavier Van Wijmeersch  ---
=A1+STYLE(IF(CURRENT()<>3,"green","red"))

try these one

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 121105] the current() function is confused if used inside or()

2018-11-01 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=121105

Jiří Boháč  changed:

   What|Removed |Added

Summary|the current() function is   |the current() function is
   |confused if used twice in a |confused if used inside
   |formula |or()

--- Comment #2 from Jiří Boháč  ---
hmm, the bug description was wrong; I reproduced the bug with a modified
formula:
=A1+STYLE(IF(OR(FALSE(), CURRENT() <3),"green","red"))

It seems to be the CURRENT() inside OR() which is broken.
The above formula should make 1 and 2 "green" and the rest "red"
Everything is green.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs