summaryrefslogtreecommitdiff
path: root/sc/source/core/data/table3.cxx
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2014-01-06 16:12:28 -0500
committerKohei Yoshida <kohei.yoshida@collabora.com>2014-01-06 16:17:28 -0500
commitc009bdb061d074bbddd58a16bdf65022e2099ba5 (patch)
tree6973f8784ad6a1def2e230537c0de4200184fade /sc/source/core/data/table3.cxx
parent2c2be1e36a7d6ab0ff7f42badcafa8fbaf5260a0 (diff)
fdo#73001: Simplify the selection function logic & calculate correct results.
Fixing a bug and cleaning up the code all at the same time. And don't forget to write test for it as well. Change-Id: Ia0322c4bebd4c5debcbfa4bb0902afbe581208b2 (cherry picked from commit 4a7a6b46c0dc779581f271b9e6c13c365eca7ab8)
Diffstat (limited to 'sc/source/core/data/table3.cxx')
-rw-r--r--sc/source/core/data/table3.cxx31
1 files changed, 8 insertions, 23 deletions
diff --git a/sc/source/core/data/table3.cxx b/sc/source/core/data/table3.cxx
index a92748568d2f..16ed68dd7de6 100644
--- a/sc/source/core/data/table3.cxx
+++ b/sc/source/core/data/table3.cxx
@@ -2308,30 +2308,15 @@ xub_StrLen ScTable::GetMaxNumberStringLen(
return 0;
}
-void ScTable::UpdateSelectionFunction( ScFunctionData& rData,
- SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow,
- const ScMarkData& rMark )
+void ScTable::UpdateSelectionFunction( ScFunctionData& rData, const ScMarkData& rMark )
{
- // Cursor neben einer Markierung nicht beruecksichtigen:
- //! nur noch MarkData uebergeben, Cursorposition ggf. hineinselektieren!!!
- bool bSingle = ( rMark.IsMarked() || !rMark.IsMultiMarked() );
-
- // Mehrfachselektion:
-
- SCCOL nCol;
- if ( rMark.IsMultiMarked() )
- for (nCol=0; nCol<=MAXCOL && !rData.bError; nCol++)
- if ( !pColFlags || !ColHidden(nCol) )
- aCol[nCol].UpdateSelectionFunction( rMark, rData, *mpHiddenRows,
- bSingle && ( nCol >= nStartCol && nCol <= nEndCol ),
- nStartRow, nEndRow );
-
- // Einfachselektion (oder Cursor) nur wenn nicht negativ (und s.o.):
-
- if ( bSingle && !rMark.IsMarkNegative() )
- for (nCol=nStartCol; nCol<=nEndCol && !rData.bError; nCol++)
- if ( !pColFlags || !ColHidden(nCol) )
- aCol[nCol].UpdateAreaFunction( rData, *mpHiddenRows, nStartRow, nEndRow );
+ for (SCCOL nCol = 0; nCol <= MAXCOL && !rData.bError; ++nCol)
+ {
+ if (pColFlags && ColHidden(nCol))
+ continue;
+
+ aCol[nCol].UpdateSelectionFunction(rMark, rData, *mpHiddenRows);
+ }
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */