diff options
author | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-12-18 17:28:20 +0300 |
---|---|---|
committer | Sarper Akdemir <sarper.akdemir.extern@allotropia.de> | 2023-12-21 11:06:44 +0100 |
commit | ec21a5935062175598d36c21d4484b777c915bff (patch) | |
tree | e725e880f77780ca445341233f28e013e0d781f0 /sw | |
parent | e377a29bcf9bc383749edfb5a9d0c0dcbd8dfe59 (diff) |
tdf#158375: adapt UI when DDE is disabled via DisableActiveContent
When DisableActiveContent is set, provide now non-functional areas
meaningful error messages / popup dialogs.
Change-Id: I34bffee10fb0ba5c0194193f3d3d81b93d7dbd26
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160923
Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Tested-by: Jenkins
(cherry picked from commit b693fba185df86fba6389ed564a12c0afeb33778)
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/161095
Reviewed-by: Sarper Akdemir <sarper.akdemir.extern@allotropia.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/uibase/shells/textfld.cxx | 13 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 11 |
2 files changed, 24 insertions, 0 deletions
diff --git a/sw/source/uibase/shells/textfld.cxx b/sw/source/uibase/shells/textfld.cxx index 780a01f943da..68561d8b8ded 100644 --- a/sw/source/uibase/shells/textfld.cxx +++ b/sw/source/uibase/shells/textfld.cxx @@ -56,6 +56,8 @@ #include <doc.hxx> #include <PostItMgr.hxx> #include <swmodule.hxx> +#include <svtools/strings.hrc> +#include <svtools/svtresid.hxx> #include <editeng/ulspitem.hxx> #include <xmloff/odffields.hxx> @@ -68,6 +70,7 @@ #include <svx/pageitem.hxx> #include <comphelper/sequenceashashmap.hxx> #include <IMark.hxx> +#include <officecfg/Office/Common.hxx> #include <officecfg/Office/Compatibility.hxx> #include <ndtxt.hxx> #include <translatehelper.hxx> @@ -137,6 +140,16 @@ void SwTextShell::ExecField(SfxRequest &rReq) GetBaseLink(); if(rLink.IsVisible()) { + if (officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()) + { + std::unique_ptr<weld::MessageDialog> xError( + Application::CreateMessageDialog( + nullptr, VclMessageType::Warning, VclButtonsType::Ok, + SvtResId(STR_WARNING_EXTERNAL_LINK_EDIT_DISABLED))); + xError->run(); + break; + } + SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog(GetView().GetFrameWeld(), &rSh.GetLinkManager(), false, &rLink)); pDlg->Execute(); diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 6cb3aeedeece..cc6faf78a3c5 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -120,6 +120,8 @@ #include <comphelper/lok.hxx> #include <comphelper/string.hxx> #include <comphelper/docpasswordhelper.hxx> +#include <svtools/strings.hrc> +#include <svtools/svtresid.hxx> #include <PostItMgr.hxx> @@ -2454,6 +2456,15 @@ void SwView::InsFrameMode(sal_uInt16 nCols) /// show "edit link" dialog void SwView::EditLinkDlg() { + if (officecfg::Office::Common::Security::Scripting::DisableActiveContent::get()) + { + std::unique_ptr<weld::MessageDialog> xError( + Application::CreateMessageDialog(nullptr, VclMessageType::Warning, VclButtonsType::Ok, + SvtResId(STR_WARNING_EXTERNAL_LINK_EDIT_DISABLED))); + xError->run(); + return; + } + bool bWeb = dynamic_cast<SwWebView*>( this ) != nullptr; SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create(); ScopedVclPtr<SfxAbstractLinksDialog> pDlg(pFact->CreateLinksDialog(GetViewFrame().GetFrameWeld(), &GetWrtShell().GetLinkManager(), bWeb)); |