sw/inc/SwCapConfigProp.hxx | 38 ++ sw/source/ui/config/optload.cxx | 503 ++++++++++++++++++++++++++++++- sw/source/uibase/inc/optload.hxx | 11 sw/uiconfig/swriter/ui/optcaptionpage.ui | 206 ++++++++++-- 4 files changed, 725 insertions(+), 33 deletions(-)
New commits: commit 3e81415f7f71b7fe99342c82b3c54011fbcb2dbb Author: Balazs Varga <balazs.varga.ext...@allotropia.de> AuthorDate: Fri Nov 17 19:03:51 2023 +0100 Commit: Balazs Varga <balazs.varga.ext...@allotropia.de> CommitDate: Mon Nov 20 12:55:55 2023 +0100 tdf#158136 - UI: Part 31 - Unify lockdown behavior of Options dialog for Writer - AutoCaption Page. Change-Id: Ia3c37510477542556c3302d2013fe10a4ae00545 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159594 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.ext...@allotropia.de> diff --git a/sw/inc/SwCapConfigProp.hxx b/sw/inc/SwCapConfigProp.hxx new file mode 100644 index 000000000000..20257f3d9716 --- /dev/null +++ b/sw/inc/SwCapConfigProp.hxx @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef INCLUDED_SW_INC_SWCAPCONFIGPROP_HXX +#define INCLUDED_SW_INC_SWCAPCONFIGPROP_HXX + +enum CapConfigProp +{ + PROP_CAP_OBJECT_ENABLE = 0, //0 + PROP_CAP_OBJECT_CATEGORY, //1 + PROP_CAP_OBJECT_NUMBERING, //2 + PROP_CAP_OBJECT_NUMBERINGSEPARATOR, //3 + PROP_CAP_OBJECT_CAPTIONTEXT, //4 + PROP_CAP_OBJECT_DELIMITER, //5 + PROP_CAP_OBJECT_LEVEL, //6 + PROP_CAP_OBJECT_POSITION, //7 + PROP_CAP_OBJECT_CHARACTERSTYLE, //8 + PROP_CAP_OBJECT_APPLYATTRIBUTES, //9 +}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/sw/source/ui/config/optload.cxx b/sw/source/ui/config/optload.cxx index 675a2d48e8d6..3adf4dce4e34 100644 --- a/sw/source/ui/config/optload.cxx +++ b/sw/source/ui/config/optload.cxx @@ -55,6 +55,436 @@ using namespace ::com::sun::star; +static bool lcl_isPropertyReadOnly(const SwCapObjType eType, const CapConfigProp ePropType, const SvGlobalName& rOleId) +{ + bool bReadOnly = false; + + switch (ePropType) + { + case PROP_CAP_OBJECT_ENABLE: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Enable::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Enable::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Enable::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Enable::isReadOnly(); + } else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_CATEGORY: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::Category::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::Category::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::Category::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::Category::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::Category::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::Category::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::Category::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::Category::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::Category::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_NUMBERING: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::Numbering::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::Numbering::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::Numbering::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::Numbering::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::Numbering::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::Numbering::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::Numbering::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::Numbering::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::Numbering::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_NUMBERINGSEPARATOR: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::NumberingSeparator::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::NumberingSeparator::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::NumberingSeparator::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::NumberingSeparator::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::NumberingSeparator::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::NumberingSeparator::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::NumberingSeparator::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::NumberingSeparator::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::NumberingSeparator::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_CAPTIONTEXT: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::CaptionText::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::CaptionText::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::CaptionText::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::CaptionText::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::CaptionText::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::CaptionText::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::CaptionText::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::CaptionText::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::CaptionText::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_DELIMITER: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::Delimiter::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::Delimiter::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::Delimiter::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::Delimiter::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::Delimiter::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::Delimiter::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::Delimiter::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::Delimiter::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::Delimiter::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_LEVEL: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::Level::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::Level::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::Level::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::Level::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::Level::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::Level::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::Level::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::Level::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::Level::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_POSITION: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::Position::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::Position::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::Position::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::Position::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::Position::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::Position::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::Position::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::Position::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::Position::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_CHARACTERSTYLE: + { + switch (eType) + { + case TABLE_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Settings::CharacterStyle::isReadOnly(); + break; + case FRAME_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Settings::CharacterStyle::isReadOnly(); + break; + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::CharacterStyle::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::CharacterStyle::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::CharacterStyle::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::CharacterStyle::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::CharacterStyle::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::CharacterStyle::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::CharacterStyle::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + case PROP_CAP_OBJECT_APPLYATTRIBUTES: + { + switch (eType) + { + case GRAPHIC_CAP: + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Settings::ApplyAttributes::isReadOnly(); + break; + case OLE_CAP: + { + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Settings::ApplyAttributes::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Settings::ApplyAttributes::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Settings::ApplyAttributes::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Settings::ApplyAttributes::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Settings::ApplyAttributes::isReadOnly(); + } + else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Settings::ApplyAttributes::isReadOnly(); + } + else { + // Should not reach it. + } + } + break; + default: + break; + } + } + break; + default: + break; + } + + return bReadOnly; +} sal_uInt32 SwFieldUnitTable::Count() { @@ -516,21 +946,31 @@ SwCaptionOptPage::SwCaptionOptPage(weld::Container* pPage, weld::DialogControlle , m_aTextFilter(m_sNone) , m_xCheckLB(m_xBuilder->weld_tree_view("objects")) , m_xLbCaptionOrder(m_xBuilder->weld_combo_box("captionorder")) + , m_xLbCaptionOrderImg(m_xBuilder->weld_widget("lockcaptionorder")) , m_xSettingsGroup(m_xBuilder->weld_widget("settings")) , m_xCategoryBox(m_xBuilder->weld_combo_box("category")) + , m_xCategoryBoxImg(m_xBuilder->weld_widget("lockcategory")) , m_xFormatText(m_xBuilder->weld_label("numberingft")) , m_xFormatBox(m_xBuilder->weld_combo_box("numbering")) + , m_xFormatBoxImg(m_xBuilder->weld_widget("locknumbering")) , m_xNumberingSeparatorFT(m_xBuilder->weld_label("numseparatorft")) , m_xNumberingSeparatorED(m_xBuilder->weld_entry("numseparator")) + , m_xNumberingSeparatorImg(m_xBuilder->weld_widget("locknumseparator")) , m_xTextText(m_xBuilder->weld_label("separatorft")) , m_xTextEdit(m_xBuilder->weld_entry("separator")) + , m_xTextEditImg(m_xBuilder->weld_widget("lockseparator")) , m_xPosBox(m_xBuilder->weld_combo_box("position")) + , m_xPosBoxImg(m_xBuilder->weld_widget("lockposition")) , m_xNumCapt(m_xBuilder->weld_widget("numcaption")) , m_xLbLevel(m_xBuilder->weld_combo_box("level")) + , m_xLbLevelImg(m_xBuilder->weld_widget("locklevel")) , m_xEdDelim(m_xBuilder->weld_entry("chapseparator")) + , m_xEdDelimImg(m_xBuilder->weld_widget("lockchapseparator")) , m_xCategory(m_xBuilder->weld_widget("categoryformat")) , m_xCharStyleLB(m_xBuilder->weld_combo_box("charstyle")) + , m_xCharStyleImg(m_xBuilder->weld_widget("lockcharstyle")) , m_xApplyBorderCB(m_xBuilder->weld_check_button("applyborder")) + , m_xApplyBorderImg(m_xBuilder->weld_widget("lockapplyborder")) , m_xPreview(new weld::CustomWeld(*m_xBuilder, "preview", m_aPreview)) { m_xCategoryBox->connect_entry_insert_text(LINK(this, SwCaptionOptPage, TextFilterHdl)); @@ -674,17 +1114,24 @@ void SwCaptionOptPage::Reset( const SfxItemSet* rSet) // Writer objects int nPos = 0; + bool bReadOnly = false; m_xCheckLB->append(); m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE); m_xCheckLB->set_text(nPos, m_sSWTable, 0); + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Table::Enable::isReadOnly(); + m_xCheckLB->set_sensitive(nPos, !bReadOnly); SetOptions(nPos++, TABLE_CAP); m_xCheckLB->append(); m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE); m_xCheckLB->set_text(nPos, m_sSWFrame, 0); + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Frame::Enable::isReadOnly(); + m_xCheckLB->set_sensitive(nPos, !bReadOnly); SetOptions(nPos++, FRAME_CAP); m_xCheckLB->append(); m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE); m_xCheckLB->set_text(nPos, m_sSWGraphic, 0); + bReadOnly = officecfg::Office::Writer::Insert::Caption::WriterObject::Graphic::Enable::isReadOnly(); + m_xCheckLB->set_sensitive(nPos, !bReadOnly); SetOptions(nPos++, GRAPHIC_CAP); // get Productname and -version @@ -710,10 +1157,29 @@ void SwCaptionOptPage::Reset( const SfxItemSet* rSet) m_xCheckLB->append(); m_xCheckLB->set_toggle(nPos, TRISTATE_FALSE); m_xCheckLB->set_text(nPos, sClass, 0); + if (rOleId == SvGlobalName(SO3_SC_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Calc::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SDRAW_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Draw::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SM_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Formula::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SCH_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Chart::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_SIMPRESS_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::Impress::Enable::isReadOnly(); + } else if (rOleId == SvGlobalName(SO3_OUT_CLASSID)) { + bReadOnly = officecfg::Office::Writer::Insert::Caption::OfficeObject::OLEMisc::Enable::isReadOnly(); + } + else { + // + } + m_xCheckLB->set_sensitive(nPos, !bReadOnly); SetOptions( nPos++, OLE_CAP, &rOleId ); } m_xLbCaptionOrder->set_active( SW_MOD()->GetModuleConfig()->IsCaptionOrderNumberingFirst() ? 1 : 0); + m_xLbCaptionOrder->set_sensitive(!officecfg::Office::Writer::Insert::Caption::CaptionOrderNumberingFirst::isReadOnly()); + m_xLbCaptionOrderImg->set_visible(officecfg::Office::Writer::Insert::Caption::CaptionOrderNumberingFirst::isReadOnly()); m_xCheckLB->select(0); ShowEntryHdl(*m_xCheckLB); } @@ -810,6 +1276,38 @@ void SwCaptionOptPage::UpdateEntry(int nSelEntry) m_xCategoryBox->set_active(nPos); } + bool bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_CATEGORY, pOpt->GetOleId()); + m_xCategoryBox->set_sensitive(bChecked && !bReadOnly); + m_xCategoryBoxImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_NUMBERING, pOpt->GetOleId()); + m_xFormatBox->set_sensitive(bChecked && !bReadOnly); + m_xFormatBoxImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_NUMBERINGSEPARATOR, pOpt->GetOleId()); + m_xNumberingSeparatorED->set_sensitive(bNumSep && !bReadOnly); + m_xNumberingSeparatorImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_CAPTIONTEXT, pOpt->GetOleId()); + m_xTextEdit->set_sensitive(bChecked && !bReadOnly); + m_xTextEditImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_DELIMITER, pOpt->GetOleId()); + m_xPosBox->set_sensitive(bChecked && !bReadOnly); + m_xPosBoxImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_LEVEL, pOpt->GetOleId()); + m_xLbLevel->set_sensitive(bChecked && !bReadOnly); + m_xLbLevelImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_POSITION, pOpt->GetOleId()); + m_xEdDelim->set_sensitive(bChecked && !bReadOnly); + m_xEdDelimImg->set_visible(bReadOnly); + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_CHARACTERSTYLE, pOpt->GetOleId()); + m_xCharStyleLB->set_sensitive(bChecked && !bReadOnly); + m_xCharStyleImg->set_visible(bReadOnly); + for (sal_Int32 i = 0; i < m_xFormatBox->get_count(); i++) { if (pOpt->GetNumType() == m_xFormatBox->get_id(i).toUInt32()) @@ -844,8 +1342,11 @@ void SwCaptionOptPage::UpdateEntry(int nSelEntry) m_xCharStyleLB->set_active_text(pOpt->GetCharacterStyle()); else m_xCharStyleLB->set_active(0); - m_xApplyBorderCB->set_sensitive(m_xCategoryBox->get_sensitive() && + + bReadOnly = lcl_isPropertyReadOnly(pOpt->GetObjType(), PROP_CAP_OBJECT_APPLYATTRIBUTES, pOpt->GetOleId()); + m_xApplyBorderCB->set_sensitive(m_xCategoryBox->get_sensitive() && !bReadOnly && pOpt->GetObjType() != TABLE_CAP && pOpt->GetObjType() != FRAME_CAP ); + m_xApplyBorderImg->set_visible(bReadOnly); m_xApplyBorderCB->set_active(pOpt->CopyAttributes()); } diff --git a/sw/source/uibase/inc/optload.hxx b/sw/source/uibase/inc/optload.hxx index 24ddd25ae434..c39283912d29 100644 --- a/sw/source/uibase/inc/optload.hxx +++ b/sw/source/uibase/inc/optload.hxx @@ -30,6 +30,7 @@ #include <sfx2/basedlgs.hxx> #include <SwCapObjType.hxx> +#include <SwCapConfigProp.hxx> class SwFieldMgr; class SwWrtShell; @@ -157,25 +158,35 @@ private: SwCaptionPreview m_aPreview; std::unique_ptr<weld::TreeView> m_xCheckLB; std::unique_ptr<weld::ComboBox> m_xLbCaptionOrder; + std::unique_ptr<weld::Widget> m_xLbCaptionOrderImg; std::unique_ptr<weld::Widget> m_xSettingsGroup; std::unique_ptr<weld::ComboBox> m_xCategoryBox; + std::unique_ptr<weld::Widget> m_xCategoryBoxImg; std::unique_ptr<weld::Label> m_xFormatText; std::unique_ptr<weld::ComboBox> m_xFormatBox; + std::unique_ptr<weld::Widget> m_xFormatBoxImg; //#i61007# order of captions std::unique_ptr<weld::Label> m_xNumberingSeparatorFT; std::unique_ptr<weld::Entry> m_xNumberingSeparatorED; + std::unique_ptr<weld::Widget> m_xNumberingSeparatorImg; std::unique_ptr<weld::Label> m_xTextText; std::unique_ptr<weld::Entry> m_xTextEdit; + std::unique_ptr<weld::Widget> m_xTextEditImg; std::unique_ptr<weld::ComboBox> m_xPosBox; + std::unique_ptr<weld::Widget> m_xPosBoxImg; std::unique_ptr<weld::Widget> m_xNumCapt; std::unique_ptr<weld::ComboBox> m_xLbLevel; + std::unique_ptr<weld::Widget> m_xLbLevelImg; std::unique_ptr<weld::Entry> m_xEdDelim; + std::unique_ptr<weld::Widget> m_xEdDelimImg; std::unique_ptr<weld::Widget> m_xCategory; std::unique_ptr<weld::ComboBox> m_xCharStyleLB; + std::unique_ptr<weld::Widget> m_xCharStyleImg; std::unique_ptr<weld::CheckButton> m_xApplyBorderCB; + std::unique_ptr<weld::Widget> m_xApplyBorderImg; std::unique_ptr<weld::CustomWeld> m_xPreview; DECL_LINK(SelectHdl, weld::ComboBox&, void); diff --git a/sw/uiconfig/swriter/ui/optcaptionpage.ui b/sw/uiconfig/swriter/ui/optcaptionpage.ui index 1ab036da9aaf..f8384b45bf88 100644 --- a/sw/uiconfig/swriter/ui/optcaptionpage.ui +++ b/sw/uiconfig/swriter/ui/optcaptionpage.ui @@ -44,7 +44,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=5 --> + <!-- n-columns=3 n-rows=5 --> <object class="GtkGrid" id="grid3"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -63,7 +63,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">0</property> </packing> </child> @@ -77,7 +77,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> </packing> </child> @@ -91,7 +91,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">2</property> </packing> </child> @@ -105,7 +105,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">3</property> </packing> </child> @@ -119,7 +119,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">4</property> </packing> </child> @@ -136,7 +136,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">4</property> </packing> </child> @@ -156,7 +156,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">3</property> </packing> </child> @@ -164,12 +164,12 @@ <object class="GtkEntry" id="numseparator"> <property name="visible">True</property> <property name="can-focus">True</property> + <property name="tooltip-text" translatable="yes" context="optcaptionpage|tooltip_text|numseparator">For Numbering first option, define characters to display between caption number and caption category.</property> <property name="valign">center</property> <property name="hexpand">True</property> <property name="activates-default">True</property> <property name="text" translatable="yes" context="optcaptionpage|numseparator">. </property> <property name="truncate-multiline">True</property> - <property name="tooltip-text" translatable="yes" context="optcaptionpage|tooltip_text|numseparator">For Numbering first option, define characters to display between caption number and caption category.</property> <child internal-child="accessible"> <object class="AtkObject" id="numseparator-atkobject"> <property name="AtkObject::accessible-description" translatable="yes" context="optcaptionpage|extended_tip|numseparator">For Numbering first option, defines the characters to be displayed between the caption number and the caption category.</property> @@ -177,7 +177,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">2</property> </packing> </child> @@ -194,7 +194,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">1</property> </packing> </child> @@ -224,10 +224,75 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">0</property> </packing> </child> + <child> + <object class="GtkImage" id="lockcategory"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locknumbering"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locknumseparator"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">2</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockseparator"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">3</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockposition"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">4</property> + </packing> + </child> </object> </child> <child type="label"> @@ -254,7 +319,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=2 --> + <!-- n-columns=3 n-rows=2 --> <object class="GtkGrid" id="grid4"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -273,7 +338,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">0</property> </packing> </child> @@ -287,7 +352,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> </packing> </child> @@ -307,7 +372,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">1</property> </packing> </child> @@ -328,10 +393,36 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="locklevel"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> <property name="top-attach">0</property> </packing> </child> + <child> + <object class="GtkImage" id="lockchapseparator"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> </object> </child> <child type="label"> @@ -358,7 +449,7 @@ <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=2 n-rows=2 --> + <!-- n-columns=3 n-rows=2 --> <object class="GtkGrid" id="grid5"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -377,7 +468,7 @@ <property name="xalign">0</property> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">0</property> </packing> </child> @@ -396,7 +487,7 @@ </child> </object> <packing> - <property name="left-attach">1</property> + <property name="left-attach">2</property> <property name="top-attach">0</property> </packing> </child> @@ -415,11 +506,37 @@ </child> </object> <packing> - <property name="left-attach">0</property> + <property name="left-attach">1</property> <property name="top-attach">1</property> <property name="width">2</property> </packing> </child> + <child> + <object class="GtkImage" id="lockcharstyle"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">0</property> + </packing> + </child> + <child> + <object class="GtkImage" id="lockapplyborder"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> + </object> + <packing> + <property name="left-attach">0</property> + <property name="top-attach">1</property> + </packing> + </child> </object> </child> <child type="label"> @@ -574,20 +691,45 @@ when inserting:</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <object class="GtkComboBoxText" id="captionorder"> + <object class="GtkBox"> <property name="visible">True</property> <property name="can-focus">False</property> - <property name="margin-start">12</property> - <property name="margin-top">6</property> - <property name="hexpand">True</property> - <items> - <item translatable="yes" context="optcaptionpage|captionorder">Category first</item> - <item translatable="yes" context="optcaptionpage|captionorder">Numbering first</item> - </items> - <child internal-child="accessible"> - <object class="AtkObject" id="captionorder-atkobject"> - <property name="AtkObject::accessible-description" translatable="yes" context="optcaptionpage|extended_tip|captionorder">Place the caption number before or after the caption category.</property> + <child> + <object class="GtkImage" id="lockcaptionorder"> + <property name="can-focus">False</property> + <property name="no-show-all">True</property> + <property name="halign">center</property> + <property name="valign">center</property> + <property name="icon-name">res/lock.png</property> </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">0</property> + </packing> + </child> + <child> + <object class="GtkComboBoxText" id="captionorder"> + <property name="visible">True</property> + <property name="can-focus">False</property> + <property name="margin-start">12</property> + <property name="margin-top">6</property> + <property name="hexpand">True</property> + <items> + <item translatable="yes" context="optcaptionpage|captionorder">Category first</item> + <item translatable="yes" context="optcaptionpage|captionorder">Numbering first</item> + </items> + <child internal-child="accessible"> + <object class="AtkObject" id="captionorder-atkobject"> + <property name="AtkObject::accessible-description" translatable="yes" context="optcaptionpage|extended_tip|captionorder">Place the caption number before or after the caption category.</property> + </object> + </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">1</property> + </packing> </child> </object> </child>