summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBalazs Varga <balazs.varga.extern@allotropia.de>2023-11-21 14:32:21 +0100
committerBalazs Varga <balazs.varga.extern@allotropia.de>2023-11-21 21:03:25 +0100
commitedf05194527e596e8b32956f7f3f34357f6e4a27 (patch)
tree22f399ebd618124224c39bfb707cf443fcfef25a
parent49c200cf9f3e8f61716a15bf67dee9f54d2931fa (diff)
tdf#158141 - UI: Part 34 - Unify lockdown behavior of Options dialog
for Writer/Web - Formatting Aids Page. Change-Id: I8e67ac65add2aab50fe1db2d071ce731be80f946 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159783 Tested-by: Jenkins Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
-rw-r--r--sw/source/ui/config/optpage.cxx40
-rw-r--r--sw/source/uibase/inc/optpage.hxx1
2 files changed, 28 insertions, 13 deletions
diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx
index 90ea14acf64f..7062a68716c8 100644
--- a/sw/source/ui/config/optpage.cxx
+++ b/sw/source/ui/config/optpage.cxx
@@ -1560,6 +1560,7 @@ void SwTableOptionsTabPage::PageCreated( const SfxAllItemSet& aSet)
SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
: SfxTabPage(pPage, pController, "modules/swriter/ui/optformataidspage.ui", "OptFormatAidsPage", &rSet)
, m_pWrtShell(nullptr)
+ , m_bHTMLMode(false)
, m_xParaCB(m_xBuilder->weld_check_button("paragraph"))
, m_xParaImg(m_xBuilder->weld_widget("lockparagraph"))
, m_xSHyphCB(m_xBuilder->weld_check_button("hyphens"))
@@ -1607,6 +1608,8 @@ SwShdwCursorOptionsTabPage::SwShdwCursorOptionsTabPage(weld::Container* pPage, w
if(!pHtmlModeItem || !(pHtmlModeItem->GetValue() & HTMLMODE_ON))
return;
+ m_bHTMLMode = true;
+
m_xTabCB->hide();
m_xTabLabel->hide();
m_xCharHiddenCB->hide();
@@ -1721,18 +1724,23 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet )
eMode = pItem->GetMode();
bIsOn = pItem->IsOn();
}
+
+ bool bReadOnly = officecfg::Office::Writer::Cursor::DirectCursor::UseDirectCursor::isReadOnly();
m_xOnOffCB->set_active( bIsOn );
- m_xOnOffCB->set_sensitive(!officecfg::Office::Writer::Cursor::DirectCursor::UseDirectCursor::isReadOnly());
- m_xOnOffImg->set_visible(officecfg::Office::Writer::Cursor::DirectCursor::UseDirectCursor::isReadOnly());
+ m_xOnOffCB->set_sensitive(!bReadOnly);
+ m_xOnOffImg->set_visible(bReadOnly);
+ bReadOnly = officecfg::Office::Writer::Cursor::DirectCursor::Insert::isReadOnly();
m_xDirectCursorFillMode->set_active( static_cast<int>(eMode) );
- m_xDirectCursorFillMode->set_sensitive(!officecfg::Office::Writer::Cursor::DirectCursor::Insert::isReadOnly());
- m_xDirectCursorFillModeImg->set_visible(officecfg::Office::Writer::Cursor::DirectCursor::Insert::isReadOnly());
+ m_xDirectCursorFillMode->set_sensitive(!bReadOnly);
+ m_xDirectCursorFillModeImg->set_visible(bReadOnly);
if (m_pWrtShell) {
+ bReadOnly = !m_bHTMLMode ? officecfg::Office::Writer::Layout::Other::IsAlignMathObjectsToBaseline::isReadOnly() :
+ officecfg::Office::WriterWeb::Layout::Other::IsAlignMathObjectsToBaseline::isReadOnly();
m_xMathBaselineAlignmentCB->set_active( m_pWrtShell->GetDoc()->getIDocumentSettingAccess().get( DocumentSettingId::MATH_BASELINE_ALIGNMENT ) );
- m_xMathBaselineAlignmentCB->set_sensitive(!officecfg::Office::Writer::Layout::Other::IsAlignMathObjectsToBaseline::isReadOnly());
- m_xMathBaselineAlignmentImg->set_visible(officecfg::Office::Writer::Layout::Other::IsAlignMathObjectsToBaseline::isReadOnly());
+ m_xMathBaselineAlignmentCB->set_sensitive(!bReadOnly);
+ m_xMathBaselineAlignmentImg->set_visible(bReadOnly);
m_xMathBaselineAlignmentCB->save_state();
} else {
m_xMathBaselineAlignmentCB->hide();
@@ -1740,14 +1748,16 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet )
if( const SfxBoolItem* pItem = rSet->GetItemIfSet( FN_PARAM_CRSR_IN_PROTECTED, false ) )
m_xCursorInProtCB->set_active(pItem->GetValue());
- m_xCursorInProtCB->set_sensitive(!officecfg::Office::Writer::Cursor::Option::ProtectedArea::isReadOnly());
- m_xCursorInProtImg->set_visible(officecfg::Office::Writer::Cursor::Option::ProtectedArea::isReadOnly());
+ bReadOnly = officecfg::Office::Writer::Cursor::Option::ProtectedArea::isReadOnly();
+ m_xCursorInProtCB->set_sensitive(!bReadOnly);
+ m_xCursorInProtImg->set_visible(bReadOnly);
m_xCursorInProtCB->save_state();
const SwDocDisplayItem* pDocDisplayAttr = rSet->GetItemIfSet( FN_PARAM_DOCDISP, false );
if(pDocDisplayAttr)
{
- bool bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::ParagraphEnd::isReadOnly();
+ bReadOnly = !m_bHTMLMode ? officecfg::Office::Writer::Content::NonprintingCharacter::ParagraphEnd::isReadOnly() :
+ officecfg::Office::WriterWeb::Content::NonprintingCharacter::ParagraphEnd::isReadOnly();
m_xParaCB->set_active( pDocDisplayAttr->m_bParagraphEnd );
m_xParaCB->set_sensitive(!bReadOnly);
m_xParaImg->set_visible(bReadOnly);
@@ -1757,17 +1767,20 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet )
m_xTabCB->set_sensitive(!bReadOnly);
m_xTabImg->set_visible(bReadOnly);
- bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::Space::isReadOnly();
+ bReadOnly = !m_bHTMLMode ? officecfg::Office::Writer::Content::NonprintingCharacter::Space::isReadOnly() :
+ officecfg::Office::WriterWeb::Content::NonprintingCharacter::Space::isReadOnly();
m_xSpacesCB->set_active( pDocDisplayAttr->m_bSpace );
m_xSpacesCB->set_sensitive(!bReadOnly);
m_xSpacesImg->set_visible(bReadOnly);
- bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::ProtectedSpace::isReadOnly();
+ bReadOnly = !m_bHTMLMode ? officecfg::Office::Writer::Content::NonprintingCharacter::ProtectedSpace::isReadOnly() :
+ officecfg::Office::WriterWeb::Content::NonprintingCharacter::ProtectedSpace::isReadOnly();
m_xHSpacesCB->set_active( pDocDisplayAttr->m_bNonbreakingSpace );
m_xHSpacesCB->set_sensitive(!bReadOnly);
m_xHSpacesImg->set_visible(bReadOnly);
- bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::OptionalHyphen::isReadOnly();
+ bReadOnly = !m_bHTMLMode ? officecfg::Office::Writer::Content::NonprintingCharacter::OptionalHyphen::isReadOnly() :
+ officecfg::Office::WriterWeb::Content::NonprintingCharacter::OptionalHyphen::isReadOnly();
m_xSHyphCB->set_active( pDocDisplayAttr->m_bSoftHyphen );
m_xSHyphCB->set_sensitive(!bReadOnly);
m_xSHyphImg->set_visible(bReadOnly);
@@ -1782,7 +1795,8 @@ void SwShdwCursorOptionsTabPage::Reset( const SfxItemSet* rSet )
m_xBookmarkCB->set_sensitive(!bReadOnly);
m_xBookmarkImg->set_visible(bReadOnly);
- bReadOnly = officecfg::Office::Writer::Content::NonprintingCharacter::Break::isReadOnly();
+ bReadOnly = !m_bHTMLMode ? officecfg::Office::Writer::Content::NonprintingCharacter::Break::isReadOnly() :
+ officecfg::Office::WriterWeb::Content::NonprintingCharacter::Break::isReadOnly();
m_xBreakCB->set_active( pDocDisplayAttr->m_bManualBreak );
m_xBreakCB->set_sensitive(!bReadOnly);
m_xBreakImg->set_visible(bReadOnly);
diff --git a/sw/source/uibase/inc/optpage.hxx b/sw/source/uibase/inc/optpage.hxx
index 4c5734253d35..949861f37101 100644
--- a/sw/source/uibase/inc/optpage.hxx
+++ b/sw/source/uibase/inc/optpage.hxx
@@ -278,6 +278,7 @@ public:
class SwShdwCursorOptionsTabPage final : public SfxTabPage
{
SwWrtShell * m_pWrtShell;
+ bool m_bHTMLMode;
//nonprinting characters
std::unique_ptr<weld::CheckButton> m_xParaCB;