diff options
author | Noel Grandin <noelgrandin@gmail.com> | 2020-10-31 18:55:36 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2020-11-01 21:05:00 +0100 |
commit | d3a9db6310204247a3bd8f23a984c5a04afbeef1 (patch) | |
tree | 1281a59dd42891545845d428dfff6a12bc89ca00 /svx/source | |
parent | 63076928d41d95d6c0bc86580ba8a5a985b1f415 (diff) |
use officecfg for ShowLinkWarningDialog
Change-Id: I92a42eb2ff48bff4e635f1a37a25c8ecb9ac1347
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/105153
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'svx/source')
-rw-r--r-- | svx/source/dialog/linkwarn.cxx | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/svx/source/dialog/linkwarn.cxx b/svx/source/dialog/linkwarn.cxx index 7df6f472ff21..852c92af1089 100644 --- a/svx/source/dialog/linkwarn.cxx +++ b/svx/source/dialog/linkwarn.cxx @@ -19,7 +19,7 @@ #include <osl/file.hxx> #include <svx/linkwarn.hxx> -#include <svtools/miscopt.hxx> +#include <officecfg/Office/Common.hxx> SvxLinkWarningDialog::SvxLinkWarningDialog(weld::Widget* pParent, const OUString& _rFileName) : MessageDialogController(pParent, "svx/ui/linkwarndialog.ui", "LinkWarnDialog", "ask") @@ -34,9 +34,9 @@ SvxLinkWarningDialog::SvxLinkWarningDialog(weld::Widget* pParent, const OUString m_xDialog->set_primary_text(sInfoText); // load state of "warning on" checkbox from misc options - SvtMiscOptions aMiscOpt; - m_xWarningOnBox->set_active(aMiscOpt.ShowLinkWarningDialog()); - m_xWarningOnBox->set_sensitive(!aMiscOpt.IsShowLinkWarningDialogReadOnly()); + m_xWarningOnBox->set_active(officecfg::Office::Common::Misc::ShowLinkWarningDialog::get()); + m_xWarningOnBox->set_sensitive( + !officecfg::Office::Common::Misc::ShowLinkWarningDialog::isReadOnly()); } SvxLinkWarningDialog::~SvxLinkWarningDialog() @@ -44,10 +44,14 @@ SvxLinkWarningDialog::~SvxLinkWarningDialog() try { // save value of "warning off" checkbox, if necessary - SvtMiscOptions aMiscOpt; bool bChecked = m_xWarningOnBox->get_active(); - if (aMiscOpt.ShowLinkWarningDialog() != bChecked) - aMiscOpt.SetShowLinkWarningDialog(bChecked); + if (officecfg::Office::Common::Misc::ShowLinkWarningDialog::get() != bChecked) + { + std::shared_ptr<comphelper::ConfigurationChanges> xChanges( + comphelper::ConfigurationChanges::create()); + officecfg::Office::Common::Misc::ShowLinkWarningDialog::set(bChecked, xChanges); + xChanges->commit(); + } } catch (...) { |