summaryrefslogtreecommitdiff
path: root/sw/source/uibase
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 /sw/source/uibase
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 'sw/source/uibase')
-rw-r--r--sw/source/uibase/app/apphdl.cxx3
-rw-r--r--sw/source/uibase/app/docsh.cxx6
-rw-r--r--sw/source/uibase/dochdl/swdtflvr.cxx2
-rw-r--r--sw/source/uibase/docvw/edtdd.cxx2
-rw-r--r--sw/source/uibase/shells/annotsh.cxx2
-rw-r--r--sw/source/uibase/shells/basesh.cxx2
-rw-r--r--sw/source/uibase/shells/drwtxtex.cxx2
-rw-r--r--sw/source/uibase/shells/grfsh.cxx2
-rw-r--r--sw/source/uibase/shells/textsh1.cxx2
9 files changed, 11 insertions, 12 deletions
diff --git a/sw/source/uibase/app/apphdl.cxx b/sw/source/uibase/app/apphdl.cxx
index 09ff2872f3a3..782445027c8c 100644
--- a/sw/source/uibase/app/apphdl.cxx
+++ b/sw/source/uibase/app/apphdl.cxx
@@ -158,8 +158,7 @@ void SwModule::StateOther(SfxItemSet &rSet)
break;
case FN_MAILMERGE_WIZARD:
{
- SwView* pView = ::GetActiveView();
- if (pView && pView->GetViewShell()->isExportLocked())
+ if (GetObjectShell()->isExportLocked())
rSet.DisableItem(nWhich);
break;
}
diff --git a/sw/source/uibase/app/docsh.cxx b/sw/source/uibase/app/docsh.cxx
index a8e80a688e58..5ccae0801946 100644
--- a/sw/source/uibase/app/docsh.cxx
+++ b/sw/source/uibase/app/docsh.cxx
@@ -1019,7 +1019,7 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case FN_OUTLINE_TO_IMPRESS:
{
SvtModuleOptions aMOpt;
- if (!aMOpt.IsImpress() || (GetViewShell() && GetViewShell()->isExportLocked()))
+ if (!aMOpt.IsImpress() || GetObjectShell()->isExportLocked())
rSet.DisableItem( nWhich );
}
[[fallthrough]];
@@ -1042,13 +1042,13 @@ void SwDocShell::GetState(SfxItemSet& rSet)
case FN_NEW_GLOBAL_DOC:
if (dynamic_cast<const SwGlobalDocShell*>(this) != nullptr
- || (GetViewShell() && GetViewShell()->isExportLocked()))
+ || GetObjectShell()->isExportLocked())
rSet.DisableItem( nWhich );
break;
case FN_NEW_HTML_DOC:
if (dynamic_cast<const SwWebDocShell*>(this) != nullptr
- || (GetViewShell() && GetViewShell()->isExportLocked()))
+ || GetObjectShell()->isExportLocked())
rSet.DisableItem( nWhich );
break;
diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx
index f79f27ed271c..ea3dcf29db71 100644
--- a/sw/source/uibase/dochdl/swdtflvr.cxx
+++ b/sw/source/uibase/dochdl/swdtflvr.cxx
@@ -1125,7 +1125,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut )
int SwTransferable::Copy( bool bIsCut )
{
- if (m_pWrtShell->GetView().isContentExtractionLocked())
+ if (m_pWrtShell->GetView().GetObjectShell()->isContentExtractionLocked())
return 0;
int nRet = PrepareForCopy( bIsCut );
diff --git a/sw/source/uibase/docvw/edtdd.cxx b/sw/source/uibase/docvw/edtdd.cxx
index 1a5690e96e7e..44728b9ba129 100644
--- a/sw/source/uibase/docvw/edtdd.cxx
+++ b/sw/source/uibase/docvw/edtdd.cxx
@@ -63,7 +63,7 @@ void SwEditWin::StopDDTimer(SwWrtShell *pSh, const Point &rPt)
void SwEditWin::StartDrag( sal_Int8 /*nAction*/, const Point& rPosPixel )
{
- if (m_rView.isContentExtractionLocked())
+ if (m_rView.GetObjectShell()->isContentExtractionLocked())
return;
SwWrtShell &rSh = m_rView.GetWrtShell();
diff --git a/sw/source/uibase/shells/annotsh.cxx b/sw/source/uibase/shells/annotsh.cxx
index 1df965b8c343..df50cb78163d 100644
--- a/sw/source/uibase/shells/annotsh.cxx
+++ b/sw/source/uibase/shells/annotsh.cxx
@@ -963,7 +963,7 @@ void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
}
case SID_COPY:
{
- if (!pOLV->HasSelection() || rView.isContentExtractionLocked())
+ if (!pOLV->HasSelection() || GetObjectShell()->isContentExtractionLocked())
rSet.DisableItem( nWhich );
break;
}
diff --git a/sw/source/uibase/shells/basesh.cxx b/sw/source/uibase/shells/basesh.cxx
index 55a0293a47c8..2cdd1e3a44cd 100644
--- a/sw/source/uibase/shells/basesh.cxx
+++ b/sw/source/uibase/shells/basesh.cxx
@@ -462,7 +462,7 @@ void SwBaseShell::StateClpbrd(SfxItemSet &rSet)
}
[[fallthrough]];
case SID_COPY:
- if( !bCopy || GetView().isContentExtractionLocked())
+ if( !bCopy || GetObjectShell()->isContentExtractionLocked())
rSet.DisableItem( nWhich );
break;
diff --git a/sw/source/uibase/shells/drwtxtex.cxx b/sw/source/uibase/shells/drwtxtex.cxx
index 8ace0fde6156..185b79dd3eb2 100644
--- a/sw/source/uibase/shells/drwtxtex.cxx
+++ b/sw/source/uibase/shells/drwtxtex.cxx
@@ -1162,7 +1162,7 @@ void SwDrawTextShell::StateClpbrd(SfxItemSet &rSet)
{
case SID_CUT:
case SID_COPY:
- if( !bCopy || GetView().isContentExtractionLocked())
+ if( !bCopy || GetObjectShell()->isContentExtractionLocked())
rSet.DisableItem( nWhich );
break;
diff --git a/sw/source/uibase/shells/grfsh.cxx b/sw/source/uibase/shells/grfsh.cxx
index 1d91400926a3..e9808d6be430 100644
--- a/sw/source/uibase/shells/grfsh.cxx
+++ b/sw/source/uibase/shells/grfsh.cxx
@@ -754,7 +754,7 @@ void SwGrfShell::GetAttrState(SfxItemSet &rSet)
case SID_SAVE_GRAPHIC:
case SID_EXTERNAL_EDIT:
- if( rSh.GetGraphicType() == GraphicType::NONE || GetView().isExportLocked())
+ if( rSh.GetGraphicType() == GraphicType::NONE || GetObjectShell()->isExportLocked())
bDisable = true;
break;
diff --git a/sw/source/uibase/shells/textsh1.cxx b/sw/source/uibase/shells/textsh1.cxx
index 89df49393efa..9567067f13e7 100644
--- a/sw/source/uibase/shells/textsh1.cxx
+++ b/sw/source/uibase/shells/textsh1.cxx
@@ -2170,7 +2170,7 @@ void SwTextShell::GetState( SfxItemSet &rSet )
case SID_COPY:
case SID_CUT:
{
- if (GetShell().GetView().isContentExtractionLocked())
+ if (GetObjectShell()->isContentExtractionLocked())
rSet.DisableItem(nWhich);
break;
}