summaryrefslogtreecommitdiffstats
path: root/sc
diff options
context:
space:
mode:
authorYan Pashkovsky <yanp.bugz@gmail.com>2016-08-12 23:39:30 +0300
committerEike Rathke <erack@redhat.com>2016-08-18 13:50:30 +0000
commit4cd9e45a439b654c8e1ff7983fe7e4bd073b9c92 (patch)
tree5d03a6c22542e5d64aad5a4cd0483a7bd3d66f18 /sc
parentsw: fix accepting/rejecting a change by index when cursor is not at a redline (diff)
downloadcore-4cd9e45a439b654c8e1ff7983fe7e4bd073b9c92.tar.gz
core-4cd9e45a439b654c8e1ff7983fe7e4bd073b9c92.zip
tdf#91305 fix sort calc
Change-Id: Id8969e28d653add5ba4348ece622b2b53ce464da Reviewed-on: https://gerrit.libreoffice.org/28094 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Eike Rathke <erack@redhat.com> Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/core/data/table3.cxx28
1 files changed, 26 insertions, 2 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 6da1c7cfc140..86b979cba5c0 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3239,8 +3239,20 @@ bool ScTable::CreateQueryParam(SCCOL nCol1, SCROW nRow1, SCCOL nCol2, SCROW nRow
return bValid;
}
-bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW /* nEndRow */ ) const
+bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow) const
{
+ if (nStartCol == nEndCol)
+ {
+ if (nEndRow > nStartRow)
+ {
+ CellType eFstCellType = GetCellType(nStartCol, nStartRow);
+ CellType eSndCellType = GetCellType(nStartCol, nStartRow+1);
+ if ((eFstCellType == CELLTYPE_STRING || eFstCellType == CELLTYPE_EDIT)
+ && (eSndCellType != CELLTYPE_STRING && eSndCellType != CELLTYPE_STRING))
+ return true;
+ }
+ return false;
+ }
for (SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
{
CellType eType = GetCellType( nCol, nStartRow );
@@ -3250,8 +3262,20 @@ bool ScTable::HasColHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCR
return true;
}
-bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL /* nEndCol */, SCROW nEndRow ) const
+bool ScTable::HasRowHeader( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) const
{
+ if (nStartRow == nEndRow)
+ {
+ if (nEndCol > nStartCol)
+ {
+ CellType eFstCellType = GetCellType(nStartCol, nStartRow);
+ CellType eSndCellType = GetCellType(nStartCol+1, nStartRow);
+ if ((eFstCellType == CELLTYPE_STRING || eFstCellType == CELLTYPE_EDIT)
+ && (eSndCellType != CELLTYPE_STRING && eSndCellType != CELLTYPE_STRING))
+ return true;
+ }
+ return false;
+ }
for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++)
{
CellType eType = GetCellType( nStartCol, nRow );