Kaydet (Commit) 107cb122 authored tarafından Kohei Yoshida's avatar Kohei Yoshida

fdo#58004: Let's remove these upper bound truncation.

We may still need to set an upper bound, but we shouldn't do these
all over the place.  Apparently we now allow more than 256 fields, so
doing this would only break things for fields whose indices are greater
than 255.

Change-Id: Ic2e374ec01267044c2e40664775e7f62b1461f41
üst 6a393297
...@@ -2138,9 +2138,7 @@ bool ScDPObject::FillLabelData(sal_Int32 nDim, ScDPLabelData& rLabels) ...@@ -2138,9 +2138,7 @@ bool ScDPObject::FillLabelData(sal_Int32 nDim, ScDPLabelData& rLabels)
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName ); uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName );
sal_Int32 nDimCount = xDims->getCount(); sal_Int32 nDimCount = xDims->getCount();
if ( nDimCount > SC_DP_MAX_FIELDS ) if (nDimCount <= 0 || nDim >= nDimCount)
nDimCount = SC_DP_MAX_FIELDS;
if (!nDimCount || nDim >= nDimCount)
return false; return false;
return FillLabelDataForDimension(xDims, nDim, rLabels); return FillLabelDataForDimension(xDims, nDim, rLabels);
...@@ -2157,9 +2155,7 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam) ...@@ -2157,9 +2155,7 @@ bool ScDPObject::FillLabelData(ScPivotParam& rParam)
uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions(); uno::Reference<container::XNameAccess> xDimsName = xSource->getDimensions();
uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName ); uno::Reference<container::XIndexAccess> xDims = new ScNameToIndexAccess( xDimsName );
sal_Int32 nDimCount = xDims->getCount(); sal_Int32 nDimCount = xDims->getCount();
if ( nDimCount > SC_DP_MAX_FIELDS ) if (nDimCount <= 0)
nDimCount = SC_DP_MAX_FIELDS;
if (!nDimCount)
return false; return false;
for (sal_Int32 nDim = 0; nDim < nDimCount; ++nDim) for (sal_Int32 nDim = 0; nDim < nDimCount; ++nDim)
......
...@@ -289,8 +289,6 @@ sal_Bool ScPivotLayoutDlg::Close() ...@@ -289,8 +289,6 @@ sal_Bool ScPivotLayoutDlg::Close()
void ScPivotLayoutDlg::InitWndSelect(const ScDPLabelDataVector& rLabels) void ScPivotLayoutDlg::InitWndSelect(const ScDPLabelDataVector& rLabels)
{ {
size_t nLabelCount = rLabels.size(); size_t nLabelCount = rLabels.size();
if (nLabelCount > SC_DP_MAX_FIELDS)
nLabelCount = SC_DP_MAX_FIELDS;
maLabelData.clear(); maLabelData.clear();
maLabelData.reserve( nLabelCount ); maLabelData.reserve( nLabelCount );
......
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