Bug 94676 - Calc autofill confused, hyphen vs. minus
Summary: Calc autofill confused, hyphen vs. minus
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
5.0.1.2 release
Hardware: Other All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsUXEval
Depends on:
Blocks:
 
Reported: 2015-10-01 18:42 UTC by OfficeUser
Modified: 2016-10-11 08:34 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description OfficeUser 2015-10-01 18:42:36 UTC
Hi,

please...

- Paste or enter the following string into any cell: Aaa-bbb-ccc-01

- Then apply autofill ("pull-down" over some cells)


Result:
Aaa-bbb-ccc-01
Aaa-bbb-ccc00
Aaa-bbb-ccc01
Aaa-bbb-ccc02
Aaa-bbb-ccc03

You can see that "-" is removed and that incrmenting is not as expected. It looks like the "-" leads to a negative calculation.




The problem does NOT exist for example for the following string: Aaa-bbb-ccc+01

Here the result is:
Aaa-bbb-ccc+01
Aaa-bbb-ccc+02
Aaa-bbb-ccc+03
Aaa-bbb-ccc+04
Aaa-bbb-ccc+05
Comment 1 Terrence Enger 2015-10-01 22:49:02 UTC
Thank you for helping us to improve LibreOffice.

> You can see that "-" is removed and that incrmenting is not as
> expected. It looks like the "-" leads to a negative calculation.

Wording it a bit differently, the hyphen plus the trailing digits are
taken as a negative starting value.  Thus, with a starting value 2
less than OfficeUser supplied and an increment value 1 I get ...

    Aaa-bbb-ccc-03
    Aaa-bbb-ccc-02
    Aaa-bbb-ccc-01
    Aaa-bbb-ccc00
    Aaa-bbb-ccc01
    Aaa-bbb-ccc02
    Aaa-bbb-ccc03
    Aaa-bbb-ccc04

The reported behaviour seems correct to me.  I am leaving the bug
status UNCONFIRMED in order to encourage others to add their opinions.

As a workaround, you can
(1) Enter your initial value in Writer, using a non-breaking hyphen
    instead of that last hyphen
(2) Copy the initial value into Calc.

Perhaps Calc offers a way that I do not know about to enter a
non-breaking hyphen.  Otherwise, that may be worthwhile enhancement.


I did my expriments on Linux both dbgutil daily bibisect version
2015-10-01 and 3.5.4.2 as delivered with debian-wheezy.

HTH,
Terry.
Comment 2 OfficeUser 2015-10-04 09:59:23 UTC
I just have tested Excel. It correctly autofills as expected by the user:

aaa-bbb-ccc-01
aaa-bbb-ccc-02
aaa-bbb-ccc-03
aaa-bbb-ccc-04
aaa-bbb-ccc-05


In my opinion Excel really does here what the user expects. Since autofill pulldown is an automatism without options that has to guess what the user wants, Excel's behavior is optimal.

I cannot imagine any scenario where the user wants to autofill the way Calc does. So I really suggest to handle this issue as bug and patch Calc to do like Excel.
Comment 3 Terrence Enger 2015-10-05 02:26:13 UTC
Well, the behaviour of Excel is one consideration, but we do not
always find it determinative.

I can imagine a user, perhaps a statistical or engineering or
scientific user, who would use negative numbers quite routinely.  Do
we actually have such a user?  I do not know.

It is tempting to suggest that Calc should use some heuristic to guess
at the distinction between a hyphen and a minus sign.  I fear that
that might just turn a somewhat subtle gotcha into an even more subtle
one.  Not necessarily an improvement.

Meanwhile, I am changing the component in this report to ux-advise in
order to get the attention of those who think about these subtleties.
Meanwhile, I am moving "Calc" into the summary.

Terry.
Comment 4 Robinson Tryon (qubit) 2016-08-25 05:39:10 UTC Comment hidden (obsolete)
Comment 5 Heiko Tietze 2016-10-05 09:48:31 UTC
Excel autofill:
aaa-bbb-ccc-03	aaa-bbb-ccc+01	1	-3
aaa-bbb-ccc-04	aaa-bbb-ccc+02	2	-2
aaa-bbb-ccc-05	aaa-bbb-ccc+03	3	-1
aaa-bbb-ccc-06	aaa-bbb-ccc+04	4	0
aaa-bbb-ccc-07	aaa-bbb-ccc+05	5	1
aaa-bbb-ccc-08	aaa-bbb-ccc+06	6	2

LibO 5.3 autofill:
Aaa-bbb-ccc-03	Aaa-bbb-ccc+01	1	-3
Aaa-bbb-ccc-02	Aaa-bbb-ccc+02	2	-2
Aaa-bbb-ccc-01	Aaa-bbb-ccc+03	3	-1
Aaa-bbb-ccc00	Aaa-bbb-ccc+04	4	0
Aaa-bbb-ccc01	Aaa-bbb-ccc+05	5	1
Aaa-bbb-ccc02	Aaa-bbb-ccc+06	6	2

LibO counts more reliable as the combined cells are treated like the numbers. And if you pull up instead of pull down, starting for instance in row 10 with Aaa-bbb-ccc05, you end up at row 1 with Aaa-bbb-ccc-04. Excel, however, goes from 05 down to 00 and then up again to 04. Better file a bug report at Microsofts bugtracker... :-)
Comment 6 OfficeUser 2016-10-09 16:06:33 UTC
@Heiko:

What Excel does is exactly what the user expects. Excel seems to recognize that there are more than one "-" characters in the content thus they are not treated as algebraic sign.
Comment 7 Heiko Tietze 2016-10-10 07:31:13 UTC
(In reply to OfficeUser from comment #6)
> What Excel does is exactly what the user expects.

Hard to believe. Let's ask: https://plus.google.com/107566594492891737454/posts/52LsPq7GZ7U
Comment 8 OfficeUser 2016-10-10 07:38:16 UTC
I want to note that this issue has been filed after bad user experience with autofilling something like:

REQUIREMENT-NO-1
REQUIREMENT-NO-2
...

I just used letters like a and b for simplification in my initial bug description. However I do not talk about formula-like strings.
Comment 9 Heiko Tietze 2016-10-10 14:52:40 UTC
Report from G+ user: Selecting only one cell counts up but when you select a1 and a2 it works as requested ignoring the minus before the number. Sounds like the most flexible solution.
Comment 10 Heiko Tietze 2016-10-11 08:17:04 UTC
(In reply to Heiko Tietze from comment #9)
> Report from G+ user: Selecting only one cell counts up but when you select
> a1 and a2 it works as requested ignoring the minus before the number. Sounds
> like the most flexible solution.

While 50% agree with you and want to count regardless of the minus, I would close this ticket as WFM. The flexibility argument is striking.
Comment 11 OfficeUser 2016-10-11 08:34:31 UTC
(In reply to Heiko Tietze from comment #9)
> Report from G+ user: Selecting only one cell counts up but when you select
> a1 and a2 it works as requested ignoring the minus before the number. Sounds
> like the most flexible solution.

@Heiko:
Thanks for this information. I did not know that selecting a1 and a2 leads to the requested behavior. So I agree to close this issue as WORKSFORME.