Kaydet (Commit) 1ac1fdbe authored tarafından Tamás Zolnai's avatar Tamás Zolnai

respect read-only config item: MSCompatibleFormsMenu

Change-Id: I4eacbe8ad2025a54c13f4c0fa06e30e5ab59b721
Reviewed-on: https://gerrit.libreoffice.org/70344
Tested-by: Jenkins
Reviewed-by: 's avatarTamás Zolnai <tamas.zolnai@collabora.com>
üst 6db38ca2
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment