Kaydet (Commit) d8b9a10d authored tarafından Eike Rathke's avatar Eike Rathke Kaydeden (comit) Andras Timar

Resolves: tdf#116003 check presence of subtotal in group, tdf#107267 follow-up

Change-Id: Ifed6e28926c689dd17914b8b1cbf47b58e2ffcdc
(cherry picked from commit f50e370d)
Reviewed-on: https://gerrit.libreoffice.org/52989Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
(cherry picked from commit 4b48a0b4)
üst c76afc03
......@@ -2164,11 +2164,20 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
for (sal_uInt16 nLevel = 0; nLevel<nLevelCount; nLevel++)
{
const sal_uInt16 nGroupNo = nLevelCount - nLevel - 1;
const ScSubTotalFunc* pResFunc = rParam.pFunctions[nGroupNo];
if (!pResFunc)
{
// No subtotal function given for this group => no formula or
// label and do not insert a row.
continue;
}
// increment end row
nGlobalEndRow++;
// add row entry for formula
aRowEntry.nGroupNo = nLevelCount - nLevel - 1;
aRowEntry.nGroupNo = nGroupNo;
aRowEntry.nSubStartRow = nGlobalStartRow;
aRowEntry.nFuncStart = nGlobalStartFunc;
aRowEntry.nDestRow = nGlobalEndRow;
......@@ -2186,10 +2195,9 @@ bool ScTable::DoSubTotals( ScSubTotalParam& rParam )
DBShowRow(aRowEntry.nDestRow, true);
// insert label
ScSubTotalFunc* eResFunc = rParam.pFunctions[aRowEntry.nGroupNo];
OUString label = ScGlobal::GetRscString(STR_TABLE_GRAND);
label += " ";
label += ScGlobal::GetRscString(lcl_GetSubTotalStrId(eResFunc[0]));
label += ScGlobal::GetRscString(lcl_GetSubTotalStrId(pResFunc[0]));
SetString(nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, nTab, label);
ApplyStyle(nGroupCol[aRowEntry.nGroupNo], aRowEntry.nDestRow, pStyle);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment