sw/source/ui/config/optcomp.cxx | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-)
New commits: commit 59e9e31e1640edf6b6b6c50088f5eb7e83d4cf3c Author: Tamás Zolnai <tamas.zol...@collabora.com> AuthorDate: Sat Apr 6 13:25:27 2019 +0200 Commit: Andras Timar <andras.ti...@collabora.com> CommitDate: Mon Apr 8 08:19:20 2019 +0200 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.zol...@collabora.com> diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx index 897eb4027206..9f5eb0c7ac10 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 <svtools/svlbitm.hxx> using namespace ::com::sun::star::beans; using namespace ::com::sun::star::document; @@ -84,11 +86,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 ); _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits