diff options
author | Eike Rathke <erack@redhat.com> | 2020-04-08 00:47:09 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2020-04-08 01:57:45 +0200 |
commit | b1da67699bd05b26ee11460347ca7077d366c2fc (patch) | |
tree | c6f9b96bceac4fabe3748f66e52232684ef0f20d /sc/source/core/data/column.cxx | |
parent | b3363960f97dcb7eaa10dfa708d71198a345924c (diff) |
Resolves: tdf#131442 Sort must not contain matrix formula except 1x1 array
Change-Id: Idc7a9646a70c59fceee0b36426f38a938cf073ce
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91858
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Jenkins
Diffstat (limited to 'sc/source/core/data/column.cxx')
-rw-r--r-- | sc/source/core/data/column.cxx | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sc/source/core/data/column.cxx b/sc/source/core/data/column.cxx index 7fa1c4c30286..9388e01ee1f0 100644 --- a/sc/source/core/data/column.cxx +++ b/sc/source/core/data/column.cxx @@ -110,7 +110,8 @@ SCROW ScColumn::GetNextUnprotected( SCROW nRow, bool bUp ) const return pAttrArray->GetNextUnprotected(nRow, bUp); } -sc::MatrixEdge ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sc::MatrixEdge nMask ) const +sc::MatrixEdge ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sc::MatrixEdge nMask, + bool bNoMatrixAtAll ) const { using namespace sc; @@ -163,6 +164,11 @@ sc::MatrixEdge ScColumn::GetBlockMatrixEdges( SCROW nRow1, SCROW nRow2, sc::Matr if (nEdges == MatrixEdge::Nothing) continue; + // A 1x1 matrix array formula is OK even for no matrix at all. + if (bNoMatrixAtAll + && (nEdges != (MatrixEdge::Top | MatrixEdge::Left | MatrixEdge::Bottom | MatrixEdge::Right))) + return MatrixEdge::Inside; // per convention Inside + if (nEdges & MatrixEdge::Top) bOpen = true; // top edge opens, keep on looking else if (!bOpen) |