summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/viewdata.cxx
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2016-07-28 18:51:01 +0200
committerEike Rathke <erack@redhat.com>2016-07-28 19:04:08 +0200
commit984b0d1599ff1672cb0d28019bd652d58d6bdefa (patch)
tree2ecbcf72013f22886d3e85a9d92e13d003492b0e /sc/source/ui/view/viewdata.cxx
parent4e85daeb78e9d9f290e49518b11efc2285f86713 (diff)
Resolves: tdf#60021 disallow Paste when entire sheet is selected
... which exhausts memory unless you have 100GB or more of free RAM. Change-Id: Ie6f02c48457f80acad33d2286194765f8343f2fb
Diffstat (limited to 'sc/source/ui/view/viewdata.cxx')
-rw-r--r--sc/source/ui/view/viewdata.cxx12
1 files changed, 12 insertions, 0 deletions
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index d188643b660c..d07f711c28be 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -854,6 +854,18 @@ bool ScViewData::IsMultiMarked()
return (eType & SC_MARK_SIMPLE) != SC_MARK_SIMPLE;
}
+bool ScViewData::SelectionForbidsPaste()
+{
+ SCCOL nCol1, nCol2;
+ SCROW nRow1, nRow2;
+ SCTAB nTab1, nTab2;
+ ScMarkType eMarkType = GetSimpleArea( nCol1, nRow1, nTab1, nCol2, nRow2, nTab2);
+ /* 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;
+}
+
void ScViewData::SetFillMode( SCCOL nStartCol, SCROW nStartRow, SCCOL nEndCol, SCROW nEndRow )
{
nFillMode = ScFillMode::FILL;