Resolves: tdf#60056 disallow Fill when entire sheet is selected
Change-Id: I866f84d72c27be962dbad8f8e4dcb345aa336bff
This commit is contained in:
@@ -4604,6 +4604,11 @@ bool ScDocFunc::FillAuto( ScRange& rRange, const ScMarkData* pTabMark, FillDir e
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FID_FILL_... slots should already had been disabled, check here for API
|
||||||
|
// calls, no message.
|
||||||
|
if (ScViewData::SelectionFillDOOM( aDestArea))
|
||||||
|
return false;
|
||||||
|
|
||||||
WaitObject aWait( ScDocShell::GetActiveDialogParent() );
|
WaitObject aWait( ScDocShell::GetActiveDialogParent() );
|
||||||
|
|
||||||
ScDocument* pUndoDoc = nullptr;
|
ScDocument* pUndoDoc = nullptr;
|
||||||
|
@@ -129,6 +129,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
|
|||||||
case FID_FILL_TO_BOTTOM: // fill to top / bottom
|
case FID_FILL_TO_BOTTOM: // fill to top / bottom
|
||||||
{
|
{
|
||||||
bDisable = !bSimpleArea || (nRow1 == 0 && nRow2 == 0);
|
bDisable = !bSimpleArea || (nRow1 == 0 && nRow2 == 0);
|
||||||
|
if (!bDisable && GetViewData()->SelectionForbidsPaste())
|
||||||
|
bDisable = true;
|
||||||
if ( !bDisable && bEditable )
|
if ( !bDisable && bEditable )
|
||||||
{ // do not damage matrix
|
{ // do not damage matrix
|
||||||
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
||||||
@@ -139,6 +141,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
|
|||||||
case FID_FILL_TO_TOP:
|
case FID_FILL_TO_TOP:
|
||||||
{
|
{
|
||||||
bDisable = (!bSimpleArea) || (nRow1 == MAXROW && nRow2 == MAXROW);
|
bDisable = (!bSimpleArea) || (nRow1 == MAXROW && nRow2 == MAXROW);
|
||||||
|
if (!bDisable && GetViewData()->SelectionForbidsPaste())
|
||||||
|
bDisable = true;
|
||||||
if ( !bDisable && bEditable )
|
if ( !bDisable && bEditable )
|
||||||
{ // do not damage matrix
|
{ // do not damage matrix
|
||||||
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
||||||
@@ -149,6 +153,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
|
|||||||
case FID_FILL_TO_RIGHT: // fill to left / right
|
case FID_FILL_TO_RIGHT: // fill to left / right
|
||||||
{
|
{
|
||||||
bDisable = !bSimpleArea || (nCol1 == 0 && nCol2 == 0);
|
bDisable = !bSimpleArea || (nCol1 == 0 && nCol2 == 0);
|
||||||
|
if (!bDisable && GetViewData()->SelectionForbidsPaste())
|
||||||
|
bDisable = true;
|
||||||
if ( !bDisable && bEditable )
|
if ( !bDisable && bEditable )
|
||||||
{ // do not damage matrix
|
{ // do not damage matrix
|
||||||
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
||||||
@@ -159,6 +165,8 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
|
|||||||
case FID_FILL_TO_LEFT:
|
case FID_FILL_TO_LEFT:
|
||||||
{
|
{
|
||||||
bDisable = (!bSimpleArea) || (nCol1 == MAXCOL && nCol2 == MAXCOL);
|
bDisable = (!bSimpleArea) || (nCol1 == MAXCOL && nCol2 == MAXCOL);
|
||||||
|
if (!bDisable && GetViewData()->SelectionForbidsPaste())
|
||||||
|
bDisable = true;
|
||||||
if ( !bDisable && bEditable )
|
if ( !bDisable && bEditable )
|
||||||
{ // do not damage matrix
|
{ // do not damage matrix
|
||||||
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
||||||
@@ -185,6 +193,9 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
|
|||||||
else
|
else
|
||||||
bDisable = (!bSimpleArea) || (nCol1 == nCol2 && nRow1 == nRow2);
|
bDisable = (!bSimpleArea) || (nCol1 == nCol2 && nRow1 == nRow2);
|
||||||
|
|
||||||
|
if (!bDisable && GetViewData()->SelectionForbidsPaste())
|
||||||
|
bDisable = true;
|
||||||
|
|
||||||
if ( !bDisable && bEditable && nWhich == FID_FILL_SERIES )
|
if ( !bDisable && bEditable && nWhich == FID_FILL_SERIES )
|
||||||
{ // do not damage matrix
|
{ // do not damage matrix
|
||||||
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
bDisable = pDoc->HasSelectedBlockMatrixFragment(
|
||||||
|
@@ -527,6 +527,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
|
|||||||
|
|
||||||
case FID_FILL_SERIES:
|
case FID_FILL_SERIES:
|
||||||
{
|
{
|
||||||
|
if (GetViewData()->SelectionForbidsPaste())
|
||||||
|
// Slot should be already disabled, but in case it wasn't
|
||||||
|
// don't even attempt to do the evaluation and popup a
|
||||||
|
// dialog.
|
||||||
|
break;
|
||||||
|
|
||||||
SCCOL nStartCol;
|
SCCOL nStartCol;
|
||||||
SCROW nStartRow;
|
SCROW nStartRow;
|
||||||
SCTAB nStartTab;
|
SCTAB nStartTab;
|
||||||
|
Reference in New Issue
Block a user