summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorAttila Szűcs <szucs.attila3@nisz.hu>2020-10-01 14:40:08 +0200
committerLászló Németh <nemeth@numbertext.org>2020-10-05 11:22:12 +0200
commit03dfa09886b6fd0ebda7abe7d5e142da172e8cc2 (patch)
tree41028434105f9cd5b6756e745bdd470bcc401d07 /sc/source/ui
parent47f0e09af5bfc250d91896d0af56b34b83bd16a2 (diff)
tdf#88782 sc: autofill number sequences in merged cells
Improve FillAuto, FillAnalyse and FillSeries to continue linear sequences of numbers in merged cells by skipping the empty overlapped cells of the merged area, like other spreadsheets do. For example this fix autofill, when merged cells are used to highlight nth numbers. Instead of 1, 2 -> 1, 2, 2, 3, we get 1, 2 -> 1, 2, 3, 4 on the following fill: +-+-+-+ +-+-+-+-+-+-+ |1| 2 | -> |1| 2 |3| 4 | +-+-+-+ +-+-+-+-+-+-+ See the unit test document for more complex examples, and use merge/unmerge to check the work of the algorithm. For example, column C of the test document contains cells EMPTY, EMPTY, EMPTY, 2, EMPTY, 4, EMPTY calculated as 2, 4 during fill by skipping empty overlapped cells, but keeping also the merged structure, resulting the requested continuation of the linear sequence: EMPTY, EMPTY, EMPTY, 6, EMPTY, 8, EMPTY Note: special formats are not handled yet like date, string, boolean and userlist. Co-authored-by: Tibor Nagy (NISZ) Change-Id: Ib431e8968f5d71e321b0e57cfb173534a0f5da31 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103765 Tested-by: László Németh <nemeth@numbertext.org> Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/cellmergeoption.hxx6
-rw-r--r--sc/source/ui/inc/docfunc.hxx3
2 files changed, 5 insertions, 4 deletions
diff --git a/sc/source/ui/inc/cellmergeoption.hxx b/sc/source/ui/inc/cellmergeoption.hxx
index ff4a7cbebcc9..937b9079960d 100644
--- a/sc/source/ui/inc/cellmergeoption.hxx
+++ b/sc/source/ui/inc/cellmergeoption.hxx
@@ -24,9 +24,9 @@ struct ScCellMergeOption
bool mbCenter;
explicit ScCellMergeOption(const ScRange& rRange);
- explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow,
- SCCOL nEndCol, SCROW nEndRow,
- bool bCenter = false);
+ SC_DLLPUBLIC explicit ScCellMergeOption(SCCOL nStartCol, SCROW nStartRow,
+ SCCOL nEndCol, SCROW nEndRow,
+ bool bCenter = false);
ScRange getSingleRange(SCTAB nTab) const;
ScRange getFirstSingleRange() const;
diff --git a/sc/source/ui/inc/docfunc.hxx b/sc/source/ui/inc/docfunc.hxx
index e3a8117a5493..1984c0da440a 100644
--- a/sc/source/ui/inc/docfunc.hxx
+++ b/sc/source/ui/inc/docfunc.hxx
@@ -191,7 +191,8 @@ public:
void ResizeMatrix( const ScRange& rOldRange, const ScAddress& rNewEnd );
- bool MergeCells( const ScCellMergeOption& rOption, bool bContents,
+ SC_DLLPUBLIC bool
+ MergeCells( const ScCellMergeOption& rOption, bool bContents,
bool bRecord, bool bApi, bool bEmptyMergedCells = false );
bool UnmergeCells( const ScRange& rRange, bool bRecord, ScUndoRemoveMerge* pUndoRemoveMerge );
bool UnmergeCells( const ScCellMergeOption& rOption, bool bRecord, ScUndoRemoveMerge* pUndoRemoveMerge );