diff options
author | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-04-06 13:25:27 +0200 |
---|---|---|
committer | Tamás Zolnai <tamas.zolnai@collabora.com> | 2019-04-06 18:41:30 +0200 |
commit | 1ac1fdbe5bb3139c81a331beb16c79e84d7c4f27 (patch) | |
tree | 574a6362913c021999d4b8143672816a734f6b3d /sw | |
parent | 6db38ca2cc9cafb353dd2ca2f4a617d5fa3eb51d (diff) |
respect read-only config item: MSCompatibleFormsMenu
Change-Id: I4eacbe8ad2025a54c13f4c0fa06e30e5ab59b721
Reviewed-on: https://gerrit.libreoffice.org/70344
Tested-by: Jenkins
Reviewed-by: Tamás Zolnai <tamas.zolnai@collabora.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/config/optcomp.cxx | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 0eebed82220d..1f49688d6249 100644 --- a/sw/source/ui/config/optcomp.cxx +++ b/sw/source/ui/config/optcomp.cxx @@ -37,6 +37,8 @@ #include <vector> #include <svtools/restartdialog.hxx> #include <comphelper/processfactory.hxx> +#include <officecfg/Office/Compatibility.hxx> +#include <vcl/svlbitm.hxx> using namespace ::com::sun::star::beans; using namespace ::com::sun::star::document; @@ -82,11 +84,31 @@ SwCompatibilityOptPage::SwCompatibilityOptPage(vcl::Window* pParent, const SfxIt m_pOptionsLB->SetStyle( m_pOptionsLB->GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); m_pOptionsLB->SetHighlightRange(); - SvTreeListEntry* pEntry = m_pGlobalOptionsCLB->SvTreeListBox::InsertEntry( m_pGlobalOptionsLB->GetEntry( 0 ) ); + + // Set MSOCompatibleFormsMenu entry attributes + const bool bReadOnly = officecfg::Office::Compatibility::View::MSCompatibleFormsMenu::isReadOnly(); + const bool bChecked = m_aViewConfigItem.HasMSOCompatibleFormsMenu(); + + SvTreeListEntry* pEntry; + if(bReadOnly) + { + pEntry = m_pGlobalOptionsCLB->SvTreeListBox::InsertEntry( m_pGlobalOptionsLB->GetEntry( 0 ), nullptr, false, + TREELIST_APPEND, nullptr, SvLBoxButtonKind::DisabledCheckbox); + } + else + { + pEntry = m_pGlobalOptionsCLB->SvTreeListBox::InsertEntry( m_pGlobalOptionsLB->GetEntry( 0 ) ); + } + if ( pEntry ) { - m_pGlobalOptionsCLB->SetCheckButtonState( pEntry, SvButtonState::Unchecked ); + SvLBoxButton* pButton = static_cast<SvLBoxButton*>(pEntry->GetFirstItem(SvLBoxItemType::Button)); + if(bChecked) + pButton->SetStateChecked(); + else + pButton->SetStateUnchecked(); } + m_pGlobalOptionsLB->Clear(); m_pGlobalOptionsCLB->SetStyle( m_pGlobalOptionsCLB->GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); |