summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/cellsh.cxx')
-rw-r--r--sc/source/ui/view/cellsh.cxx13
1 files changed, 12 insertions, 1 deletions
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index 96b82624a1c5..7379cdb94897 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -205,6 +205,14 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
bDisable = (!bSimpleArea);
break;
+ case SID_PASTE:
+ case SID_PASTE_SPECIAL:
+ case SID_PASTE_ONLY_VALUE:
+ case SID_PASTE_ONLY_TEXT:
+ case SID_PASTE_ONLY_FORMULA:
+ bDisable = GetViewData()->SelectionForbidsPaste();
+ break;
+
case FID_INS_ROW:
case FID_INS_ROWS_BEFORE: // insert rows
case FID_INS_ROWS_AFTER:
@@ -490,6 +498,9 @@ bool checkDestRanges(ScViewData& rViewData)
return false;
}
+ if (rViewData.SelectionForbidsPaste())
+ return false;
+
// Multiple destination ranges.
ScDocument* pDoc = rViewData.GetDocument();
@@ -552,7 +563,7 @@ void ScCellShell::GetClipState( SfxItemSet& rSet )
if (!rDoc.IsBlockEditable( nTab, nCol,nRow, nCol,nRow ))
bDisable = true;
- if (!checkDestRanges(*GetViewData()))
+ if (!bDisable && !checkDestRanges(*GetViewData()))
bDisable = true;
}