summaryrefslogtreecommitdiff
path: root/sc/source/core/data/table3.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/core/data/table3.cxx')
-rw-r--r--sc/source/core/data/table3.cxx7
1 files changed, 3 insertions, 4 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index 4e9f074470ae..819bfa6f87db 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -17,7 +17,6 @@
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
-#include <rtl/math.hxx>
#include <comphelper/processfactory.hxx>
#include <comphelper/random.hxx>
#include <unotools/textsearch.hxx>
@@ -1825,7 +1824,7 @@ bool ScTable::TestRemoveSubTotals( const ScSubTotalParam& rParam )
{
SCCOL nStartCol = rParam.nCol1;
SCROW nStartRow = rParam.nRow1 + 1; // Header
- SCCOL nEndCol = rParam.nCol2;
+ SCCOL nEndCol = ClampToAllocatedColumns(rParam.nCol2);
SCROW nEndRow = rParam.nRow2;
for (SCCOL nCol = nStartCol; nCol <= nEndCol; ++nCol)
@@ -1859,7 +1858,7 @@ void ScTable::RemoveSubTotals( ScSubTotalParam& rParam )
{
SCCOL nStartCol = rParam.nCol1;
SCROW nStartRow = rParam.nRow1 + 1; // Header
- SCCOL nEndCol = rParam.nCol2;
+ SCCOL nEndCol = ClampToAllocatedColumns(rParam.nCol2);
SCROW nEndRow = rParam.nRow2; // will change
RemoveSubTotalsHandler aFunc;
@@ -3541,7 +3540,7 @@ void ScTable::UpdateSelectionFunction( ScFunctionData& rData, const ScMarkData&
aMarkArea.aEnd.SetCol(MAXCOL);
}
const SCCOL nStartCol = aMarkArea.aStart.Col();
- const SCCOL nEndCol = aMarkArea.aEnd.Col();
+ const SCCOL nEndCol = ClampToAllocatedColumns(aMarkArea.aEnd.Col());
for (SCCOL nCol = nStartCol; nCol <= nEndCol && !rData.getError(); ++nCol)
{
if (mpColFlags && ColHidden(nCol))