diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-02 16:28:29 +0100 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-11-03 10:50:28 +0100 |
commit | 6f12739b6201948b8ccf8f162c999e42714539ba (patch) | |
tree | da6d620ee4e8cd4ba18457a65f1e4f4b0cbf88ac /cui/source | |
parent | 61351fcc5f111da87a3def813bb0cf769a83e07f (diff) |
tdf#157861 - UI: Part 15 - Unify lockdown behavior of Options dialog
for Load/Save - MS Office Page.
Change-Id: Ifd576e5030e49bef3c73f55f4d3f23eea34a45f9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158837
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optfltr.cxx | 50 | ||||
-rw-r--r-- | cui/source/options/optfltr.hxx | 3 |
2 files changed, 53 insertions, 0 deletions
diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 7c04c20b27d0..b582b065bc65 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -185,9 +185,12 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2(weld::Container* pPage, weld::DialogCon , sChgToFromVisio(CuiResId(RID_CUISTR_CHG_VISIO)) , sChgToFromPDF(CuiResId(RID_CUISTR_CHG_PDF)) , m_xCheckLB(m_xBuilder->weld_tree_view("checklbcontainer")) + , m_xHighlightingFT(m_xBuilder->weld_label("label5")) , m_xHighlightingRB(m_xBuilder->weld_radio_button("highlighting")) , m_xShadingRB(m_xBuilder->weld_radio_button("shading")) + , m_xShadingImg(m_xBuilder->weld_widget("lockbuttonbox1")) , m_xMSOLockFileCB(m_xBuilder->weld_check_button("mso_lockfile")) + , m_xMSOLockFileImg(m_xBuilder->weld_widget("lockmso_lockfile")) { std::vector<int> aWidths { @@ -351,6 +354,7 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) }; bool bFirstCol = true; + bool bReadOnly = false; for( const ChkCBoxEntries & rArr : aChkArr ) { // we loop through the list, alternating reading the first/second column, @@ -365,13 +369,50 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) if (rArr.eType != MSFltrPg2_CheckBoxEntries::PDF) { bCheck = (rOpt.*rArr.FnIs)(); + switch (rArr.eType) + { + case MSFltrPg2_CheckBoxEntries::Math: + if (nCol == 0) + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Import::MathTypeToMath::isReadOnly(); + else + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Export::MathToMathType::isReadOnly(); + break; + case MSFltrPg2_CheckBoxEntries::Writer: + if (nCol == 0) + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Import::WinWordToWriter::isReadOnly(); + else + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Export::WriterToWinWord::isReadOnly(); + break; + case MSFltrPg2_CheckBoxEntries::Calc: + if (nCol == 0) + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Import::ExcelToCalc::isReadOnly(); + else + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Export::CalcToExcel::isReadOnly(); + break; + case MSFltrPg2_CheckBoxEntries::Impress: + if (nCol == 0) + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Import::PowerPointToImpress::isReadOnly(); + else + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Export::ImpressToPowerPoint::isReadOnly(); + break; + case MSFltrPg2_CheckBoxEntries::SmartArt: + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Import::SmartArtToShapes::isReadOnly(); + break; + case MSFltrPg2_CheckBoxEntries::Visio: + bReadOnly = officecfg::Office::Common::Filter::Microsoft::Import::VisioToDraw::isReadOnly(); + break; + default: + break; + } } else { bCheck = officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::get(); + bReadOnly = officecfg::Office::Common::Filter::Adobe::Import::PDFToDraw::isReadOnly(); nCol = 0; } m_xCheckLB->set_toggle(nEntry, bCheck ? TRISTATE_TRUE : TRISTATE_FALSE, nCol); + m_xCheckLB->set_sensitive(nEntry, !bReadOnly, nCol); } if (rArr.eType == MSFltrPg2_CheckBoxEntries::SmartArt) { @@ -385,11 +426,20 @@ void OfaMSFilterTabPage2::Reset( const SfxItemSet* ) else m_xShadingRB->set_active(true); + if (officecfg::Office::Common::Filter::Microsoft::Export::CharBackgroundToHighlighting::isReadOnly()) + { + m_xHighlightingRB->set_sensitive(false); + m_xShadingRB->set_sensitive(false); + m_xHighlightingFT->set_sensitive(false); + m_xShadingImg->set_visible(true); + } + m_xHighlightingRB->save_state(); m_xMSOLockFileCB->set_active(rOpt.IsMSOLockFileCreationIsEnabled()); m_xMSOLockFileCB->save_state(); m_xMSOLockFileCB->set_sensitive(!officecfg::Office::Common::Filter::Microsoft::Import::CreateMSOLockFiles::isReadOnly()); + m_xMSOLockFileImg->set_visible(officecfg::Office::Common::Filter::Microsoft::Import::CreateMSOLockFiles::isReadOnly()); } void OfaMSFilterTabPage2::InsertEntry( const OUString& _rTxt, MSFltrPg2_CheckBoxEntries _nType ) diff --git a/cui/source/options/optfltr.hxx b/cui/source/options/optfltr.hxx index dd4fcf18cd2e..51a51ec04456 100644 --- a/cui/source/options/optfltr.hxx +++ b/cui/source/options/optfltr.hxx @@ -67,9 +67,12 @@ class OfaMSFilterTabPage2 : public SfxTabPage sChgToFromPDF; std::unique_ptr<weld::TreeView> m_xCheckLB; + std::unique_ptr<weld::Label> m_xHighlightingFT; std::unique_ptr<weld::RadioButton> m_xHighlightingRB; std::unique_ptr<weld::RadioButton> m_xShadingRB; + std::unique_ptr<weld::Widget> m_xShadingImg; std::unique_ptr<weld::CheckButton> m_xMSOLockFileCB; + std::unique_ptr<weld::Widget> m_xMSOLockFileImg; void InsertEntry( const OUString& _rTxt, MSFltrPg2_CheckBoxEntries _nType ); void InsertEntry( const OUString& _rTxt, MSFltrPg2_CheckBoxEntries _nType, |