diff options
-rw-r--r-- | sc/source/ui/inc/viewdata.hxx | 7 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh.cxx | 16 | ||||
-rw-r--r-- | sc/source/ui/view/cellsh1.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewdata.cxx | 2 | ||||
-rw-r--r-- | sc/source/ui/view/viewfun3.cxx | 2 |
5 files changed, 16 insertions, 13 deletions
diff --git a/sc/source/ui/inc/viewdata.hxx b/sc/source/ui/inc/viewdata.hxx index 141e758729a3..1e717cc98668 100644 --- a/sc/source/ui/inc/viewdata.hxx +++ b/sc/source/ui/inc/viewdata.hxx @@ -354,8 +354,11 @@ public: bool IsMultiMarked(); - /// Disallow paste on Ctrl+A all selected. We'd go DOOM. - bool SelectionForbidsPaste(); + /** Disallow cell fill (Paste,Fill,...) on Ctrl+A all + selected or another high amount of selected cells. + We'd go DOOM. + */ + bool SelectionForbidsCellFill(); /// Determine DOOM condition, i.e. from selected range. static bool SelectionFillDOOM( const ScRange& rRange ); diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx index c3b69dad2d60..9f060ef7dde0 100644 --- a/sc/source/ui/view/cellsh.cxx +++ b/sc/source/ui/view/cellsh.cxx @@ -129,7 +129,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_TO_BOTTOM: // fill to top / bottom { bDisable = !bSimpleArea || (nRow1 == 0 && nRow2 == 0); - if (!bDisable && GetViewData()->SelectionForbidsPaste()) + if (!bDisable && GetViewData()->SelectionForbidsCellFill()) bDisable = true; if ( !bDisable && bEditable ) { // do not damage matrix @@ -141,7 +141,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_TO_TOP: { bDisable = (!bSimpleArea) || (nRow1 == MAXROW && nRow2 == MAXROW); - if (!bDisable && GetViewData()->SelectionForbidsPaste()) + if (!bDisable && GetViewData()->SelectionForbidsCellFill()) bDisable = true; if ( !bDisable && bEditable ) { // do not damage matrix @@ -153,7 +153,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_TO_RIGHT: // fill to left / right { bDisable = !bSimpleArea || (nCol1 == 0 && nCol2 == 0); - if (!bDisable && GetViewData()->SelectionForbidsPaste()) + if (!bDisable && GetViewData()->SelectionForbidsCellFill()) bDisable = true; if ( !bDisable && bEditable ) { // do not damage matrix @@ -165,7 +165,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case FID_FILL_TO_LEFT: { bDisable = (!bSimpleArea) || (nCol1 == MAXCOL && nCol2 == MAXCOL); - if (!bDisable && GetViewData()->SelectionForbidsPaste()) + if (!bDisable && GetViewData()->SelectionForbidsCellFill()) bDisable = true; if ( !bDisable && bEditable ) { // do not damage matrix @@ -176,7 +176,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) break; case SID_RANDOM_NUMBER_GENERATOR_DIALOG: - bDisable = !bSimpleArea || GetViewData()->SelectionForbidsPaste(); + bDisable = !bSimpleArea || GetViewData()->SelectionForbidsCellFill(); break; case SID_SAMPLING_DIALOG: case SID_DESCRIPTIVE_STATISTICS_DIALOG: @@ -195,7 +195,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) else bDisable = (!bSimpleArea) || (nCol1 == nCol2 && nRow1 == nRow2); - if (!bDisable && GetViewData()->SelectionForbidsPaste()) + if (!bDisable && GetViewData()->SelectionForbidsCellFill()) bDisable = true; if ( !bDisable && bEditable && nWhich == FID_FILL_SERIES ) @@ -223,7 +223,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet ) case SID_PASTE_ONLY_VALUE: case SID_PASTE_ONLY_TEXT: case SID_PASTE_ONLY_FORMULA: - bDisable = GetViewData()->SelectionForbidsPaste(); + bDisable = GetViewData()->SelectionForbidsCellFill(); break; case FID_INS_ROW: @@ -511,7 +511,7 @@ bool checkDestRanges(ScViewData& rViewData) return false; } - if (rViewData.SelectionForbidsPaste()) + if (rViewData.SelectionForbidsCellFill()) return false; // Multiple destination ranges. diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx index 10a34303cabb..365297c5a86f 100644 --- a/sc/source/ui/view/cellsh1.cxx +++ b/sc/source/ui/view/cellsh1.cxx @@ -527,7 +527,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq ) case FID_FILL_SERIES: { - if (GetViewData()->SelectionForbidsPaste()) + if (GetViewData()->SelectionForbidsCellFill()) // Slot should be already disabled, but in case it wasn't // don't even attempt to do the evaluation and popup a // dialog. diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx index f87fda6e08ca..6e56363712a7 100644 --- a/sc/source/ui/view/viewdata.cxx +++ b/sc/source/ui/view/viewdata.cxx @@ -854,7 +854,7 @@ bool ScViewData::IsMultiMarked() return (eType & SC_MARK_SIMPLE) != SC_MARK_SIMPLE; } -bool ScViewData::SelectionForbidsPaste() +bool ScViewData::SelectionForbidsCellFill() { ScRange aSelRange( ScAddress::UNINITIALIZED ); ScMarkType eMarkType = GetSimpleArea( aSelRange); diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx index f798690cb8a2..2f5ecb667778 100644 --- a/sc/source/ui/view/viewfun3.cxx +++ b/sc/source/ui/view/viewfun3.cxx @@ -859,7 +859,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc, return false; } - if (GetViewData().SelectionForbidsPaste()) + if (GetViewData().SelectionForbidsCellFill()) return false; // undo: save all or no content |