diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-12-21 20:20:54 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-12-22 10:44:00 +0100 |
commit | 12fd3cf163bd922e1fc2b4e2c31c7f77c2313676 (patch) | |
tree | fdd7bc75ed596e31abca8592479f5cf633b48060 /sc/source/ui/dbgui | |
parent | 9178e44169330afb1271702e20af319175a87d51 (diff) |
more jumbo sheet work
Change-Id: I67884a0c0b897d8d60f2cfaba644e01f90f7d164
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108123
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'sc/source/ui/dbgui')
-rw-r--r-- | sc/source/ui/dbgui/tpsort.cxx | 4 | ||||
-rw-r--r-- | sc/source/ui/dbgui/tpsubt.cxx | 14 |
2 files changed, 10 insertions, 8 deletions
diff --git a/sc/source/ui/dbgui/tpsort.cxx b/sc/source/ui/dbgui/tpsort.cxx index f8c2a996bd22..4b37477b5c30 100644 --- a/sc/source/ui/dbgui/tpsort.cxx +++ b/sc/source/ui/dbgui/tpsort.cxx @@ -339,7 +339,7 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField ) SCCOL nMaxCol = rDoc.ClampToAllocatedColumns(nTab, aSortData.nCol2); SCCOL col; - for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ ) + for ( col=nFirstSortCol; col<=nMaxCol && i<SC_MAXFIELDS(rDoc.GetSheetLimits()); col++ ) { aFieldName = rDoc.GetString(col, nFirstSortRow, nTab); if ( !bHasHeader || aFieldName.isEmpty() ) @@ -360,7 +360,7 @@ void ScTabPageSortFields::FillFieldLists( sal_uInt16 nStartField ) SCROW nMaxRow = aSortData.nRow2; SCROW row; - for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS; row++ ) + for ( row=nFirstSortRow; row<=nMaxRow && i<SC_MAXFIELDS(rDoc.GetSheetLimits()); row++ ) { aFieldName = rDoc.GetString(nFirstSortCol, row, nTab); if ( !bHasHeader || aFieldName.isEmpty() ) diff --git a/sc/source/ui/dbgui/tpsubt.cxx b/sc/source/ui/dbgui/tpsubt.cxx index 4a8d8d85ddab..e99e56bf8d33 100644 --- a/sc/source/ui/dbgui/tpsubt.cxx +++ b/sc/source/ui/dbgui/tpsubt.cxx @@ -31,6 +31,7 @@ #include <subtotals.hrc> #include <tpsubt.hxx> +#include <tpsort.hxx> #include <memory> #include <osl/diagnose.h> @@ -83,7 +84,8 @@ void ScTpSubTotalGroup::Init() mxLbFunctions->connect_changed( LINK( this, ScTpSubTotalGroup, SelectTreeListBoxHdl) ); mxLbSelectAllColumns->connect_clicked( LINK( this, ScTpSubTotalGroup, CheckBoxHdl ) ); - nFieldArr[0] = 0; + mnFieldArr.resize(SC_MAXFIELDS(pDoc->GetSheetLimits())); + mnFieldArr[0] = 0; FillListBoxes(); } @@ -206,7 +208,7 @@ bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo, theSubTotalData.nRow2 = rSubTotalData.nRow2; theSubTotalData.bGroupActive[nGroupIdx] = (nGroup != 0); theSubTotalData.nField[nGroupIdx] = (nGroup != 0) - ? nFieldArr[nGroup-1] + ? mnFieldArr[nGroup-1] : static_cast<SCCOL>(0); if ( nEntryCount>0 && nCheckCount>0 && nGroup!=0 ) @@ -223,7 +225,7 @@ bool ScTpSubTotalGroup::DoFillItemSet( sal_uInt16 nGroupNo, OSL_ENSURE( nCheck <= nCheckCount, "Range error :-(" ); nFunction = mxLbColumns->get_id(i).toUInt32(); - pSubTotals[nCheck] = nFieldArr[i]; + pSubTotals[nCheck] = mnFieldArr[i]; pFunctions[nCheck] = LbPosToFunc( nFunction ); nCheck++; } @@ -259,14 +261,14 @@ void ScTpSubTotalGroup::FillListBoxes() mxLbGroup->insert_text(0, aStrNone ); sal_uInt16 i=0; - for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS; col++ ) + for ( col=nFirstCol; col<=nMaxCol && i<SC_MAXFIELDS(pDoc->GetSheetLimits()); col++ ) { aFieldName = pDoc->GetString(col, nFirstRow, nTab); if ( aFieldName.isEmpty() ) { aFieldName = ScGlobal::ReplaceOrAppend( aStrColumn, u"%1", ScColToAlpha( col )); } - nFieldArr[i] = col; + mnFieldArr[i] = col; mxLbGroup->insert_text(i+1, aFieldName); mxLbColumns->insert(i); mxLbColumns->set_toggle(i, TRISTATE_FALSE); @@ -285,7 +287,7 @@ sal_uInt16 ScTpSubTotalGroup::GetFieldSelPos( SCCOL nField ) for ( sal_uInt16 n=0; n<nFieldCount && !bFound; n++ ) { - if ( nFieldArr[n] == nField ) + if ( mnFieldArr[n] == nField ) { nFieldPos = n; bFound = true; |