diff options
author | Eike Rathke <erack@redhat.com> | 2016-07-29 13:30:07 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2016-07-29 13:34:35 +0200 |
commit | 4b90c9dc83d96908d3732d95e75c2f71d0f5d988 (patch) | |
tree | 81cb1deb25c4420f29969a2fe1dae553e0f1be85 /sc/source/ui/view/viewdata.cxx | |
parent | 9a40590d0ca45a587717b3931a5eed8c2c2c6f1b (diff) |
move range detection to ScViewData::SelectionFillDOOM()
Change-Id: Ic5205428136fc323affed8d956d6ee0434d43988
Diffstat (limited to 'sc/source/ui/view/viewdata.cxx')
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index d07f711c28be..dc310564632b 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -856,14 +856,19 @@ bool ScViewData::IsMultiMarked() bool ScViewData::SelectionForbidsPaste() { - SCCOL nCol1, nCol2; - SCROW nRow1, nRow2; - SCTAB nTab1, nTab2; - ScMarkType eMarkType = GetSimpleArea( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2); + ScRange aSelRange( ScAddress::UNINITIALIZED ); + ScMarkType eMarkType = GetSimpleArea( aSelRange); + return eMarkType != SC_MARK_MULTI && SelectionFillDOOM( aSelRange); +} + +// static +bool ScViewData::SelectionFillDOOM( const ScRange& rRange ) +{ /* TODO: it is still possible to select one row less than the entire sheet * and fool around. We could narrow this down to some "sane" value, just * what would be sane? At least this helps against the Ctrl+A cases. */ - return eMarkType != SC_MARK_MULTI && nCol1 == 0 && nCol2 == MAXCOL && nRow1 == 0 && nRow2 == MAXROW; + return rRange.aStart.Col() == 0 && rRange.aEnd.Col() == MAXCOL && + rRange.aStart.Row() == 0 && rRange.aEnd.Row() == MAXROW; } void ScViewData::SetFillMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow ) |