tdf#148380 sw fieldui: always allow turning off "Fixed Content"
As we add more and more MS fields as fixed,
some of them are set so the UI to manage that flag
is disabled. While it doesn't necessarily make
much sense to allow a user to SET these fields
as fixed (so don't ALWAYS enable that flag),
at least allow it to be turned off if it somehow
did get enabled.
Change-Id: I331c871fa7a3e40a7a0154ab4d7d68c67d9c1dad
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/133086
Tested-by: Jenkins
Reviewed-by: Justin Luth <jluth@mail.com>
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
diff --git a/sw/source/ui/fldui/flddinf.cxx b/sw/source/ui/fldui/flddinf.cxx
index 50ce0548..c96cfbc 100644
--- a/sw/source/ui/fldui/flddinf.cxx
+++ b/sw/source/ui/fldui/flddinf.cxx
@@ -359,9 +359,12 @@ IMPL_LINK_NOARG(SwFieldDokInfPage, SubTypeHdl, weld::TreeView&, void)
}
}
m_xFormat->set_sensitive(bEnable);
// Always allow Fixed Content to be turned off if it is currently on
m_xFormat->set_sensitive(bEnable || m_xFixedCB->get_active());
if (bEnable && m_xFormatLB->get_selected_index() == -1)
if (!bEnable)
m_xFormatLB->clear();
else if (m_xFormatLB->get_selected_index() == -1)
m_xFormatLB->select(0);
}