summaryrefslogtreecommitdiff
path: root/sc/source/core/data/grouptokenconverter.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-02-26 14:32:57 -0500
committerJan Holesovsky <kendy@collabora.com>2014-02-28 17:16:49 +0100
commitd1fc65581906ef0ce4c8e276ae67a35fb0fc6dfd (patch)
treeefa6c7c02b023fe315067511661f6acbbd9a3d39 /sc/source/core/data/grouptokenconverter.cxx
parent7da51df558c1fbc21188a0c58773ba549195ca5a (diff)
Store the length of originally requested array size prior to trimming.
This change adds GetRequestedArrayLength() method to both single and double vector ref tokens, which returns the length of the requested array size prior to trimming of the trailing empty cell region. Change-Id: Iaba96fa2ea4ff3c8bccb0bc86fa4f1525e2f45fb
Diffstat (limited to 'sc/source/core/data/grouptokenconverter.cxx')
-rw-r--r--sc/source/core/data/grouptokenconverter.cxx12
1 files changed, 6 insertions, 6 deletions
diff --git a/sc/source/core/data/grouptokenconverter.cxx b/sc/source/core/data/grouptokenconverter.cxx
index b295fee100de..47585fd67619 100644
--- a/sc/source/core/data/grouptokenconverter.cxx
+++ b/sc/source/core/data/grouptokenconverter.cxx
@@ -110,17 +110,16 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
return false;
// Trim data array length to actual data range.
- nLen = trimLength(aRefPos.Tab(), aRefPos.Col(), aRefPos.Col(), aRefPos.Row(), nLen);
-
+ SCROW nTrimLen = trimLength(aRefPos.Tab(), aRefPos.Col(), aRefPos.Col(), aRefPos.Row(), nLen);
// Fetch double array guarantees that the length of the
// returned array equals or greater than the requested
// length.
formula::VectorRefArray aArray;
- if (nLen)
- aArray = mrDoc.FetchVectorRefArray(aRefPos, nLen);
+ if (nTrimLen)
+ aArray = mrDoc.FetchVectorRefArray(aRefPos, nTrimLen);
- formula::SingleVectorRefToken aTok(aArray, nLen);
+ formula::SingleVectorRefToken aTok(aArray, nLen, nTrimLen);
mrGroupTokens.AddToken(aTok);
}
else
@@ -179,6 +178,7 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
}
// Trim trailing empty rows.
+ SCROW nRequestedLength = nArrayLength; // keep the original length.
nArrayLength = trimLength(aRefPos.Tab(), aAbs.aStart.Col(), aAbs.aEnd.Col(), aRefPos.Row(), nArrayLength);
for (SCCOL i = aAbs.aStart.Col(); i <= aAbs.aEnd.Col(); ++i)
@@ -191,7 +191,7 @@ bool ScGroupTokenConverter::convert(ScTokenArray& rCode)
aArrays.push_back(aArray);
}
- formula::DoubleVectorRefToken aTok(aArrays, nArrayLength, nRefRowSize, bAbsFirst, bAbsLast);
+ formula::DoubleVectorRefToken aTok(aArrays, nRequestedLength, nArrayLength, nRefRowSize, bAbsFirst, bAbsLast);
mrGroupTokens.AddToken(aTok);
}
break;