summaryrefslogtreecommitdiff
path: root/Makefile.gbuild
diff options
context:
space:
mode:
authorJean-Sebastien Bevilacqua <realitix@gmail.com>2017-02-09 09:30:56 +0100
committerEike Rathke <erack@redhat.com>2017-03-07 23:07:11 +0000
commit3e4db9f12046255dbcd968b28c670cb83cf83418 (patch)
treec90f6877d4ee4d907ac43ee128bc6c1d8746111b /Makefile.gbuild
parentdb5060fcff010694e362674c87038d4abfae838e (diff)
tdf#101904 Fix Date deleting in SCalc
Introduction ------------ In SCalc, when you want to clear contents, a dialog box asks you the data type you want to delete. For example, if you select `Date & time`, only cells of type `Datetime` should be deleted in the selected area. Currently, this feature is not working for datetime type. To delete datetime cells, you must select `Numbers` type. Datetime type is seen as number. Context of this fix ------------------- First, `DeleteAreaHandler::operator` function is called for each area to delete. In this context, area has a special meaning. An area is a group of consecutive cells (on column) of the same datatype (numeric, formula...). To locate area in the column, we use the `node.position` attribute which contains the row index of the cell (remember area can be only on one column) and `nDataSize` which contains the number of rows. How this fix works ------------------ In `deleteNumeric` function, we loop through area rows to detect if cell contains a numeric value or a datetime value. To optimize performance, we don't delete cells one by one but we get a range of the same datatype. As long as datatype stays the same, we add current cell to a "sub-area" but as soon as datatype switches (datetime -> number or number -> datetime), we delete this sub-area. Finally, at the end of `deleteNumeric` function, we delete the last "sub-area". Note ---- `deleteNumberOrDateTime` function deletes rows only if the corresponding flag in the dialog box is setted: `mbNumeric` for `Numbers` and `mbDateTime` for `Date & time`. Change-Id: I24c0b3c0a6195211af71aa18d867df82109fa941 Reviewed-on: https://gerrit.libreoffice.org/34068 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com> (cherry picked from commit 4575d7cf657ae291c427c2318eb4600cec2f12b7) Reviewed-on: https://gerrit.libreoffice.org/34956
Diffstat (limited to 'Makefile.gbuild')
0 files changed, 0 insertions, 0 deletions