Bug Hunting Session
Bug 105268 - Auto Fill: The Next Value for "001-001-001" is "001-001-002" Rather than "001-001000"
Summary: Auto Fill: The Next Value for "001-001-001" is "001-001-002" Rather than "001...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: low minor
Assignee: Daniel Silva
URL:
Whiteboard: target:6.1.0 target:6.0.0.1
Keywords: difficultyBeginner, easyHack, skillCpp
Depends on:
Blocks: AutoFill
  Show dependency treegraph
 
Reported: 2017-01-12 02:55 UTC by Kevin Suo
Modified: 2018-05-06 08:38 UTC (History)
5 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 Kevin Suo 2017-01-12 02:55:29 UTC
Steps to reproduce:
1. Type 001-001-001 in cell A1.
2. Fill down from A1 to A5.

Current Behaviour:
001-001-001
001-001000
001-001001
001-001002
001-001003


Expected Behaviour:
001-001-001
001-001-002
001-001-003
001-001-004
001-001-005

This bug is inherited from the old OpenOffice.org 3.3.0
Still reproducible in the most recent master.
Comment 1 Xisco Faulí 2017-01-12 09:14:45 UTC
Confirmed in

Version: 5.4.0.0.alpha0+
Build ID: 9a30cb2161506e003f14592d83075ab9d30516c1
CPU Threads: 4; OS Version: Linux 4.8; UI Render: default; VCL: gtk2; 
Locale: ca-ES (ca_ES.UTF-8); Calc: group

@Eike: I thought you might be interested in this one...
Comment 2 Gilward Kukel 2017-01-12 15:20:03 UTC
-001 is treated as -1 and incremented by 1.

compare:
a-01
a00
a01
a02
a03
a04
a05
a06
a07
a08
a09
a10
Comment 3 Eike Rathke 2017-11-01 13:48:15 UTC
Actually it should depend on the existing sequence that was selected, i.e.

Single cell:
a-01
=>
a-02
a-03

Two consecutive cells:
a-03
a-02
=>
a-01
a+00
a+01

Likewise:
a+03
a+02
=>
a+01
a+00
a-01

Starting without embedded sign:
a03
a02
=>
a01
a00
a-01
a-02
Comment 4 Eike Rathke 2017-11-01 13:53:19 UTC
Making this an EasyHack, code pointers:
sc/source/core/data/table4.cxx
ScTable::FillAnalyse()
ScTable::FillAutoSimple()
ScTable::GetAutoFillPreview()
Places that call lcl_DecompValueString() and act on / use its results.
Comment 5 Jim Raykowski 2017-11-26 06:15:03 UTC
Here is a link to a patch I think provides the requested behavior 

https://gerrit.libreoffice.org/#/c/45280/
Comment 6 Eike Rathke 2017-11-27 12:46:53 UTC
That unfortunately crosses https://gerrit.libreoffice.org/45262 for which Daniel probably forgot to assign this bug to himself to indicate he's working on it.
Comment 7 Jim Raykowski 2017-11-27 16:51:51 UTC
I am very sorry. In the future I will ask before taking a bug on.
Comment 8 Daniel Silva 2017-11-27 17:19:52 UTC
(In reply to Jim Raykowski from comment #7)
> I am very sorry. In the future I will ask before taking a bug on.

You don't have to be sorry. Actually, it was my mistake. I should had assigned myself to solve this bug, so you would know somebody else was working on it. I'm sorry. Next time I won`t forget to do it.
Comment 9 Commit Notification 2017-12-03 15:31:45 UTC
Daniel committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=76c1e7287e29a2a2739fce895fbded3c04764bca

tdf#105268 - Auto Fill: Fix The Next Value for 001-001-001

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2017-12-04 10:19:06 UTC
Daniel committed a patch related to this issue.
It has been pushed to "libreoffice-6-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=87efbdb1ae5a73d081667e10f1571f1e523c1b9c&h=libreoffice-6-0

tdf#105268 - Auto Fill: Fix The Next Value for 001-001-001

It will be available in 6.0.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Commit Notification 2018-05-06 08:38:10 UTC
Zdeněk Crhonek committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=2833a26a81adcf6a50106fd047423e229b35e79e

uitest for bug tdf#105268

It will be available in 6.1.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.