summaryrefslogtreecommitdiff
path: root/sc
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-04-08 08:54:21 +0200
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2020-04-09 11:14:15 +0200
commit65404e2c72ea2d5d3f6c074121005b8b9369e7fb (patch)
tree15eeeb5b634c461611893dbe3b49d689ef71f5c4 /sc
parent40d83914d43f60a196dfabddea0b52e2046b333a (diff)
Move is*Locked methods to object shell
They depend on the model, not the view. Follow-up to 523922ee9d033fd304d2b50a72b76853ddcfbcdf Change-Id: I429bc25b8dd4f04ebf62eddd5ef455b5161e925d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/91867 Tested-by: Jenkins Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'sc')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx2
-rw-r--r--sc/source/ui/drawfunc/chartsh.cxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh2.cxx3
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx2
-rw-r--r--sc/source/ui/drawfunc/graphsh.cxx4
-rw-r--r--sc/source/ui/view/cellsh.cxx4
-rw-r--r--sc/source/ui/view/editsh.cxx2
7 files changed, 10 insertions, 9 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index 14058badaa02..be9ac2921f40 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -2075,7 +2075,7 @@ void ScDocShell::GetState( SfxItemSet &rSet )
case SID_SHARE_DOC:
{
- if ( IsReadOnly() || GetBestViewShell()->isExportLocked() )
+ if ( IsReadOnly() || GetObjectShell()->isExportLocked() )
{
rSet.DisableItem( nWhich );
}
diff --git a/sc/source/ui/drawfunc/chartsh.cxx b/sc/source/ui/drawfunc/chartsh.cxx
index b70ce15e57c2..70a46b8d5e71 100644
--- a/sc/source/ui/drawfunc/chartsh.cxx
+++ b/sc/source/ui/drawfunc/chartsh.cxx
@@ -73,7 +73,7 @@ void ScChartShell::GetExportAsGraphicState( SfxItemSet& rSet )
bEnable = true;
}
- if (GetViewShell()->isExportLocked())
+ if (GetObjectShell()->isExportLocked())
bEnable = false;
if( !bEnable )
diff --git a/sc/source/ui/drawfunc/drawsh2.cxx b/sc/source/ui/drawfunc/drawsh2.cxx
index 772e2936911a..b34b3c19522b 100644
--- a/sc/source/ui/drawfunc/drawsh2.cxx
+++ b/sc/source/ui/drawfunc/drawsh2.cxx
@@ -156,7 +156,8 @@ void ScDrawShell::GetDrawFuncState( SfxItemSet& rSet ) // disable functions
rSet.DisableItem( SID_FLIP_VERTICAL );
}
- if (pViewData->GetViewShell()->isContentExtractionLocked())
+
+ if (GetObjectShell()->isContentExtractionLocked())
{
rSet.DisableItem(SID_COPY);
rSet.DisableItem(SID_CUT);
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index 67fe69e1c957..06012848c489 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -465,7 +465,7 @@ void ScDrawTextObjectBar::GetState( SfxItemSet& rSet )
rSet.DisableItem( SID_THESAURUS );
}
- if (pViewData->GetViewShell()->isContentExtractionLocked())
+ if (GetObjectShell()->isContentExtractionLocked())
{
rSet.DisableItem(SID_COPY);
rSet.DisableItem(SID_CUT);
diff --git a/sc/source/ui/drawfunc/graphsh.cxx b/sc/source/ui/drawfunc/graphsh.cxx
index c3c5dd4b5f5c..e48c425419d6 100644
--- a/sc/source/ui/drawfunc/graphsh.cxx
+++ b/sc/source/ui/drawfunc/graphsh.cxx
@@ -145,7 +145,7 @@ void ScGraphicShell::GetExternalEditState( SfxItemSet& rSet )
bEnable = true;
}
- if (GetViewShell()->isExportLocked())
+ if (GetObjectShell()->isExportLocked())
bEnable = false;
if( !bEnable )
@@ -307,7 +307,7 @@ void ScGraphicShell::GetSaveGraphicState(SfxItemSet &rSet)
bEnable = true;
}
- if (GetViewShell()->isExportLocked())
+ if (GetObjectShell()->isExportLocked())
bEnable = false;
if( !bEnable )
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index e8b47ddcef34..a9dfdc4db199 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -210,7 +210,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
bDisable = false;
break;
case SID_CUT: // cut
- bDisable = !bSimpleArea || GetViewData()->GetViewShell()->isContentExtractionLocked();
+ bDisable = !bSimpleArea || GetObjectShell()->isContentExtractionLocked();
break;
case FID_INS_CELL: // insert cells, just simple selection
bDisable = (!bSimpleArea);
@@ -273,7 +273,7 @@ void ScCellShell::GetBlockState( SfxItemSet& rSet )
//! work is to be done once more
if ( !(!bEditable && bOnlyNotBecauseOfMatrix) )
bNeedEdit = false; // allowed when protected/ReadOnly
- bDisable = GetViewData()->GetViewShell()->isContentExtractionLocked();
+ bDisable = GetObjectShell()->isContentExtractionLocked();
break;
case SID_AUTOFORMAT: // Autoformat, at least 3x3 selected
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index bf2ebc3d75cf..9997dd3f703d 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -813,7 +813,7 @@ void ScEditShell::GetState( SfxItemSet& rSet )
break;
case SID_COPY:
case SID_CUT:
- if (pViewData->GetViewShell()->isContentExtractionLocked())
+ if (GetObjectShell()->isContentExtractionLocked())
{
rSet.DisableItem(SID_COPY);
rSet.DisableItem(SID_CUT);