From 63596e6798fac2d1ff363d69e92efc4f19a10810 Mon Sep 17 00:00:00 2001 From: Michael Stahl Date: Wed, 23 Sep 2020 18:51:54 +0200 Subject: tdf#134782 sw,unotools,officecfg: adapt configuration and UI Store AddParaLineSpacingToTableCells in configuration as "AddTableLineSpacing", consistently inconsistent like AddTableSpacing (the elements are not subject to translation). Adapt SwCompatibilityOptPage with some ugly hacks to allow 3 different states (TriState) for the corresponding checkbox that map to false/false, true/false and true/true. The checkbox widget doesn't allow to change *to* indeterminate but at least the status of the document can be displayed this way, with a non-obvious tweak to optcompatpage.ui to reference "checktri1" column. Change-Id: I5f32e05c93b5e16e782cba5d1d055809d9e5e251 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103318 Tested-by: Jenkins Reviewed-by: Michael Stahl (cherry picked from commit 68aec8fd57eda8c05926b7f361dc102772f2c501) Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103360 Reviewed-by: Thorsten Behrens --- sw/source/core/doc/DocumentSettingManager.cxx | 2 +- sw/source/core/view/viewsh.cxx | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) (limited to 'sw/source/core') diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx index dbb5f2f5121b..5d6a0ba7df1c 100644 --- a/sw/source/core/doc/DocumentSettingManager.cxx +++ b/sw/source/core/doc/DocumentSettingManager.cxx @@ -112,7 +112,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc) mbAddExternalLeading = !aOptions.GetDefault( SvtCompatibilityEntry::Index::NoExtLeading ); mbOldLineSpacing = aOptions.GetDefault( SvtCompatibilityEntry::Index::UseLineSpacing ); mbAddParaSpacingToTableCells = aOptions.GetDefault( SvtCompatibilityEntry::Index::AddTableSpacing ); - mbAddParaLineSpacingToTableCells = aOptions.GetDefault( SvtCompatibilityEntry::Index::AddTableSpacing ); // FIXME? separate UI? + mbAddParaLineSpacingToTableCells = aOptions.GetDefault( SvtCompatibilityEntry::Index::AddTableLineSpacing ); mbUseFormerObjectPos = aOptions.GetDefault( SvtCompatibilityEntry::Index::UseObjectPositioning ); mbUseFormerTextWrapping = aOptions.GetDefault( SvtCompatibilityEntry::Index::UseOurTextWrapping ); mbConsiderWrapOnObjPos = aOptions.GetDefault( SvtCompatibilityEntry::Index::ConsiderWrappingStyle ); diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx index 6ce52e5e041c..bf160861ee3c 100644 --- a/sw/source/core/view/viewsh.cxx +++ b/sw/source/core/view/viewsh.cxx @@ -833,10 +833,13 @@ void SwViewShell::SetUseVirDev( bool bNewVirtual ) void SwViewShell::SetAddParaSpacingToTableCells( bool _bAddParaSpacingToTableCells ) { IDocumentSettingAccess& rIDSA = getIDocumentSettingAccess(); - if ( rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells ) + if (rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells + || rIDSA.get(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS) != _bAddParaSpacingToTableCells) { SwWait aWait( *GetDoc()->GetDocShell(), true ); rIDSA.set(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells ); + // note: the dialog can't change the value to indeterminate, so only false/false and true/true + rIDSA.set(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, _bAddParaSpacingToTableCells ); const SwInvalidateFlags nInv = SwInvalidateFlags::PrtArea; lcl_InvalidateAllContent( *this, nInv ); } -- cgit v1.2.3