diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-16 17:03:39 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-17 18:55:22 +0100 |
commit | 35f59457ff434b7b97cad6ce1dbef6ff07f7bc96 (patch) | |
tree | 4accc43e0a77463c5014dad283959559767c87b8 /sw/source | |
parent | 487e30bec174342fff07f1f8cc76c9beed4c4843 (diff) |
tdf#158135 - UI: Part 30 - Unify lockdown behavior of Options dialog
for Writer - Compatibility Page.
Change-Id: Id9ad445b451b332314f72f54e183730097584a74
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159513
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/ui/config/optcomp.cxx | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index a1ea231d305c..1393b2864d95 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -216,7 +216,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet ) rEntry.getValue<bool>( SvtCompatibilityEntry::Index::NoExtLeading ), rEntry.getValue<bool>( SvtCompatibilityEntry::Index::UseLineSpacing ), rEntry.getValue<bool>( SvtCompatibilityEntry::Index::AddTableSpacing ), - rEntry.getValue<bool>(SvtCompatibilityEntry::Index::AddTableLineSpacing), + rEntry.getValue<bool>( SvtCompatibilityEntry::Index::AddTableLineSpacing), rEntry.getValue<bool>( SvtCompatibilityEntry::Index::UseObjectPositioning ), rEntry.getValue<bool>( SvtCompatibilityEntry::Index::UseOurTextWrapping ), rEntry.getValue<bool>( SvtCompatibilityEntry::Index::ConsiderWrappingStyle ), @@ -277,9 +277,11 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, weld::Button&, void) void SwCompatibilityOptPage::SetCurrentOptions( sal_uInt32 nOptions ) { const int nCount = m_xOptionsLB->n_children(); + const OUString aOptionsName = m_xFormattingLB->get_active_text(); OSL_ENSURE( nCount <= 32, "SwCompatibilityOptPage::Reset(): entry overflow" ); for (int i = 0; i < nCount; ++i) { + bool bReadOnly = false; bool bChecked = ( ( nOptions & 0x00000001 ) == 0x00000001 ); TriState value = bChecked ? TRISTATE_TRUE : TRISTATE_FALSE; if (i == int(SvtCompatibilityEntry::Index::AddTableSpacing) - 2) @@ -292,8 +294,22 @@ void SwCompatibilityOptPage::SetCurrentOptions( sal_uInt32 nOptions ) } } m_xOptionsLB->set_toggle(i, value); + + int nCoptIdx = i + 2; /* Consider "Name" & "Module" indexes */ + if (aOptionsName.isEmpty() || aOptionsName == SvtCompatibilityEntry::DEFAULT_ENTRY_NAME) + { + bReadOnly = m_aConfigItem.GetDefaultPropertyReadOnly(SvtCompatibilityEntry::Index(nCoptIdx)); + } + else + { + bReadOnly = m_aConfigItem.GetPropertyReadOnly(SvtCompatibilityEntry::Index(nCoptIdx)); + } + m_xOptionsLB->set_sensitive(i, !bReadOnly); + nOptions = nOptions >> 1; } + + m_xDefaultPB->set_sensitive(!m_aConfigItem.HaveDefaultReadOnlyProperty()); } sal_uInt32 SwCompatibilityOptPage::GetDocumentOptions() const |