Bug 127113 - Allow to fill any two numeric fields in Fill Series dialog
Summary: Allow to fill any two numeric fields in Fill Series dialog
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
unspecified
Hardware: All All
: medium enhancement
Assignee: Sarper Akdemir (allotropia)
URL:
Whiteboard: target:7.0.0 target:7.4.0
Keywords: difficultyMedium, easyHack, skillCpp, topicDebug
Depends on:
Blocks:
 
Reported: 2019-08-23 10:48 UTC by Mike Kaganski
Modified: 2022-02-16 17:35 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 Mike Kaganski 2019-08-23 10:48:11 UTC
Sheet▸Fill Cells▸Fill Series (at least in linear mode) allows to specify Start value and Increment (leaving End value empty), and have the thing do its job. However, if any other combination of filling only two fields is used, it fails:

* if only End value and Increment are filled, it just does nothing for previously empty selection (the selected cells stay empty);
* if only Start value and End value are filled, it gives an error "Invalid value" and select the Increment field.

The proposal is to allow filling any two boxes there, since it's possible to derive the third value from the filled two. E.g., if 5 empty cells in a column are selected, and in the dialog, Start value is set to 5, and End value to 12, the result would be 5, 6.75, 8.5, 10.25, 12.

See https://ask.libreoffice.org/en/question/205810/how-to-fill-cells-with-numbers-in-between-the-numbers/

A code pointer is sc/source/ui/miscdlgs/filldlg.cxx, OKHdl handler of ScFillSeriesDlg.

One needs to make sure that the dialog remains useful in cases where selection already contained numbers (and so that data would be used for Start value if omitted).
Comment 1 Xisco Faulí 2019-11-15 12:00:00 UTC
Moving to NEW
Comment 2 Sarper Akdemir (allotropia) 2020-02-02 14:33:14 UTC
Hi, I've been looking in this bug and I have a few questions before assigning it to myself.

* It appears that in the implementation of the Fill Series dialog, "End Value" represents actually a "Max Value". That is, while incrementing Start Value it should stop going further (even if there's still selected cells) before passing "End Value".

To see it in action, open an empty document in calc; Select B1:B10; Sheet▸Fill Cells▸Fill Series; Set "Start Value" as 1, "End Value" as 5, "Increment" as 1 and Click OK.

* Should I implement this feature as when all values are set in the dialog, "End Value" acts like "Max Value". Otherwise, it acts like the "End Value" in the proposal.
Or, should I neglect "Max Value" behaviour totally?

* Fill Series dialog has the capability of starting with multiple "Start Value"s (when selection is 2 dimensional), should this capability extended to having multiple corresponding "Start Value"s and "End Value"s?

Thank you for your attention :)
Comment 3 Mike Kaganski 2020-02-02 15:07:42 UTC
(In reply to Sarper Akdemir from comment #2)

The idea is that when all values are explicitly set, they all should be taken into account, of course; i.e., when there's an end value, it limits the sequence (and no element of resulting sequence is not greater than end value, as already correctly implemented). But when any value is missing, it may be easily calculated from the other two plus selection size.
Comment 4 Saksham Thakur 2020-03-19 18:05:48 UTC
Hi,
I am working on this right now. It seems that the functionality of displaying the "invalid value" message box is quite unintuitive. It only shows up when we don't provide a value for increment. Shouldn't we be showing the "invalid value" popup whenever we fill less than two values among start, end, and increment?
Comment 5 Muhammet Kara 2020-03-19 18:59:51 UTC
(In reply to Saksham Thakur from comment #4)
> Hi,
> I am working on this right now. It seems that the functionality of
> displaying the "invalid value" message box is quite unintuitive. It only
> shows up when we don't provide a value for increment. Shouldn't we be
> showing the "invalid value" popup whenever we fill less than two values
> among start, end, and increment?

Please be aware that his bug has the ASSIGNED status, which means there is already someone working on it.
Comment 6 Buovjaga 2020-03-19 21:31:57 UTC
(In reply to Muhammet Kara from comment #5)
> (In reply to Saksham Thakur from comment #4)
> > Hi,
> > I am working on this right now. It seems that the functionality of
> > displaying the "invalid value" message box is quite unintuitive. It only
> > shows up when we don't provide a value for increment. Shouldn't we be
> > showing the "invalid value" popup whenever we fill less than two values
> > among start, end, and increment?
> 
> Please be aware that his bug has the ASSIGNED status, which means there is
> already someone working on it.

Indeed. The patch is here: https://gerrit.libreoffice.org/c/core/+/87841
Comment 7 Commit Notification 2020-03-25 21:24:01 UTC
Sarper Akdemir committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/8cd7543bab7a281646211f439895bbdf9240a64a

tdf#127113: Allow to fill any two numeric fields in Fill Series dialog

It will be available in 7.0.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 8 Commit Notification 2022-02-16 17:35:47 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/72c5c23defee2d542b0e4a57018fc86638d15137

tdf#127113: sc: Add UItest

It will be available in 7.4.0.

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

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