[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - sc/source
Yan Pashkovsky
yanp.bugz at gmail.com
Mon Aug 29 12:03:11 UTC 2016
sc/source/core/data/table3.cxx | 28 ++++++++++++++++++++++++++--
1 file changed, 26 insertions(+), 2 deletions(-)
New commits:
commit f45d0d62917606a02dfd646b9ad91b92de462a91
Author: Yan Pashkovsky <yanp.bugz at gmail.com>
Date: Fri Aug 12 23:39:30 2016 +0300
tdf#91305 fix sort calc
Change-Id: Id8969e28d653add5ba4348ece622b2b53ce464da
Reviewed-on: https://gerrit.libreoffice.org/28253
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Eike Rathke <erack at redhat.com>
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index efe0c27..7edc9a8 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -3238,8 +3238,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_EDIT))
+ return true;
+ }
+ return false;
+ }
for (SCCOL nCol=nStartCol; nCol<=nEndCol; nCol++)
{
CellType eType = GetCellType( nCol, nStartRow );
@@ -3249,8 +3261,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_EDIT))
+ return true;
+ }
+ return false;
+ }
for (SCROW nRow=nStartRow; nRow<=nEndRow; nRow++)
{
CellType eType = GetCellType( nStartCol, nRow );
More information about the Libreoffice-commits
mailing list