[Libreoffice-commits] core.git: Branch 'distro/collabora/cp-6.4' - 2 commits - include/unotools officecfg/registry sw/inc sw/source sw/uiconfig unotools/source writerfilter/source

Michael Stahl (via logerrit) logerrit at kemper.freedesktop.org
Fri Sep 25 13:56:42 UTC 2020


 include/unotools/compatibility.hxx                                |    4 
 officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs |    8 +
 sw/inc/IDocumentSettingAccess.hxx                                 |    1 
 sw/source/core/doc/DocumentSettingManager.cxx                     |    7 +
 sw/source/core/inc/DocumentSettingManager.hxx                     |    1 
 sw/source/core/layout/calcmove.cxx                                |   16 ++-
 sw/source/core/layout/flowfrm.cxx                                 |   12 ++
 sw/source/core/layout/frmtool.cxx                                 |    2 
 sw/source/core/view/viewsh.cxx                                    |    5 -
 sw/source/filter/ww8/ww8par.cxx                                   |    1 
 sw/source/filter/xml/xmlimp.cxx                                   |    7 +
 sw/source/ui/config/optcomp.cxx                                   |   48 ++++++++--
 sw/source/uibase/uno/SwXDocumentSettings.cxx                      |   13 ++
 sw/uiconfig/swriter/ui/optcompatpage.ui                           |    1 
 unotools/source/config/compatibility.cxx                          |    2 
 writerfilter/source/filter/WriterFilter.cxx                       |    1 
 16 files changed, 116 insertions(+), 13 deletions(-)

New commits:
commit 63596e6798fac2d1ff363d69e92efc4f19a10810
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Sep 23 18:51:54 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Sep 25 15:56:09 2020 +0200

    tdf#134782 sw,unotools,officecfg: adapt configuration and UI
    
    Store AddParaLineSpacingToTableCells in configuration as
    "AddTableLineSpacing", consistently inconsistent like AddTableSpacing
    (the <desc> 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 <michael.stahl at cib.de>
    (cherry picked from commit 68aec8fd57eda8c05926b7f361dc102772f2c501)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103360
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/include/unotools/compatibility.hxx b/include/unotools/compatibility.hxx
index 24f2da53e590..812b8cc480bd 100644
--- a/include/unotools/compatibility.hxx
+++ b/include/unotools/compatibility.hxx
@@ -62,6 +62,10 @@ class UNOTOOLS_DLLPUBLIC SvtCompatibilityEntry
             MsWordTrailingBlanks,
             SubtractFlysAnchoredAtFlys,
             EmptyDbFieldHidesPara,
+            /// special entry: optcomp.cxx converts the other values to
+            /// integers but not this one because it doesn't have its own
+            /// checkbox, so keep it at the end!
+            AddTableLineSpacing,
 
             /* Should be at the end. Do not remove it. */
             INVALID
diff --git a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
index 71007f80c22e..77d33d1fbc0c 100644
--- a/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
+++ b/officecfg/registry/schema/org/openoffice/Office/Compatibility.xcs
@@ -76,7 +76,13 @@
       </prop>
       <prop oor:name="AddTableSpacing" oor:type="xs:boolean" oor:nillable="false">
         <info>
-          <desc>???</desc>
+          <desc>Add paragraph and table spacing at bottom of table cells</desc>
+        </info>
+        <value>true</value>
+      </prop>
+      <prop oor:name="AddTableLineSpacing" oor:type="xs:boolean" oor:nillable="false">
+        <info>
+          <desc>Add paragraph line spacing at bottom of table cells</desc>
         </info>
         <value>true</value>
       </prop>
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 );
     }
diff --git a/sw/source/ui/config/optcomp.cxx b/sw/source/ui/config/optcomp.cxx
index 9ae91126e608..8c2c821570ad 100644
--- a/sw/source/ui/config/optcomp.cxx
+++ b/sw/source/ui/config/optcomp.cxx
@@ -72,7 +72,9 @@ SwCompatibilityOptPage::SwCompatibilityOptPage(weld::Container* pPage, weld::Dia
     m_xGlobalOptionsCLB->set_column_fixed_widths(aWidths);
 
     int nPos = 0;
-    for ( int i = static_cast<int>(SvtCompatibilityEntry::Index::Module) + 1; i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID); ++i )
+    for (int i = static_cast<int>(SvtCompatibilityEntry::Index::Module) + 1;
+         i < static_cast<int>(SvtCompatibilityEntry::Index::INVALID) - 1; // omit AddTableLineSpacing
+         ++i)
     {
         int nCoptIdx = i - 2; /* Do not consider "Name" & "Module" indexes */
 
@@ -122,6 +124,7 @@ static sal_uLong convertBools2Ulong_Impl
     bool _bNoExtLeading,
     bool _bUseLineSpacing,
     bool _bAddTableSpacing,
+    bool _bAddTableLineSpacing,
     bool _bUseObjPos,
     bool _bUseOurTextWrapping,
     bool _bConsiderWrappingStyle,
@@ -156,6 +159,9 @@ static sal_uLong convertBools2Ulong_Impl
     if ( _bAddTableSpacing )
         nRet |= nSetBit;
     nSetBit = nSetBit << 1;
+    if (_bAddTableLineSpacing)
+        nRet |= nSetBit;
+    nSetBit = nSetBit << 1;
     if ( _bUseObjPos )
         nRet |= nSetBit;
     nSetBit = nSetBit << 1;
@@ -253,6 +259,7 @@ void SwCompatibilityOptPage::InitControls( const SfxItemSet& rSet )
             aEntry.getValue<bool>( SvtCompatibilityEntry::Index::NoExtLeading ),
             aEntry.getValue<bool>( SvtCompatibilityEntry::Index::UseLineSpacing ),
             aEntry.getValue<bool>( SvtCompatibilityEntry::Index::AddTableSpacing ),
+            aEntry.getValue<bool>(SvtCompatibilityEntry::Index::AddTableLineSpacing),
             aEntry.getValue<bool>( SvtCompatibilityEntry::Index::UseObjectPositioning ),
             aEntry.getValue<bool>( SvtCompatibilityEntry::Index::UseOurTextWrapping ),
             aEntry.getValue<bool>( SvtCompatibilityEntry::Index::ConsiderWrappingStyle ),
@@ -288,6 +295,15 @@ IMPL_LINK_NOARG(SwCompatibilityOptPage, UseAsDefaultHdl, weld::Button&, void)
 
                 int nCoptIdx = i + 2; /* Consider "Name" & "Module" indexes */
                 pItem->setValue<bool>( SvtCompatibilityEntry::Index(nCoptIdx), bChecked );
+                if (nCoptIdx == int(SvtCompatibilityEntry::Index::AddTableSpacing))
+                {
+                    bool const isLineSpacing = m_xOptionsLB->get_toggle(i, 0) == TRISTATE_TRUE;
+                    pItem->setValue<bool>(SvtCompatibilityEntry::Index::AddTableLineSpacing, isLineSpacing);
+                }
+                else
+                {
+                    assert(m_xOptionsLB->get_toggle(i, 0) != TRISTATE_INDET);
+                }
             }
         }
 
@@ -302,7 +318,17 @@ void SwCompatibilityOptPage::SetCurrentOptions( sal_uLong nOptions )
     for (int i = 0; i < nCount; ++i)
     {
         bool bChecked = ( ( nOptions & 0x00000001 ) == 0x00000001 );
-        m_xOptionsLB->set_toggle(i, bChecked ? TRISTATE_TRUE : TRISTATE_FALSE, 0);
+        TriState value = bChecked ? TRISTATE_TRUE : TRISTATE_FALSE;
+        if (i == int(SvtCompatibilityEntry::Index::AddTableSpacing) - 2)
+        {   // hack: map 2 bools to 1 tristate
+            nOptions = nOptions >> 1;
+            if (value == TRISTATE_TRUE
+                && (nOptions & 0x00000001) != 0x00000001) // ADD_PARA_LINE_SPACING_TO_TABLE_CELLS
+            {
+                value = TRISTATE_INDET; // 3 values possible here
+            }
+        }
+        m_xOptionsLB->set_toggle(i, value, 0);
         nOptions = nOptions >> 1;
     }
 }
@@ -321,6 +347,7 @@ sal_uLong SwCompatibilityOptPage::GetDocumentOptions() const
             !rIDocumentSettingAccess.get( DocumentSettingId::ADD_EXT_LEADING ),
             rIDocumentSettingAccess.get( DocumentSettingId::OLD_LINE_SPACING ),
             rIDocumentSettingAccess.get( DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS ),
+            rIDocumentSettingAccess.get( DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS ),
             rIDocumentSettingAccess.get( DocumentSettingId::USE_FORMER_OBJECT_POS ),
             rIDocumentSettingAccess.get( DocumentSettingId::USE_FORMER_TEXT_WRAPPING ),
             rIDocumentSettingAccess.get( DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION ),
@@ -356,10 +383,21 @@ bool SwCompatibilityOptPage::FillItemSet( SfxItemSet*  )
 
         for (int i = 0; i < nCount; ++i)
         {
-            bool bChecked = m_xOptionsLB->get_toggle(i, 0) == TRISTATE_TRUE;
-            bool bSavedChecked = ( ( nSavedOptions & 0x00000001 ) == 0x00000001 );
-            if ( bChecked != bSavedChecked )
+            TriState const current = m_xOptionsLB->get_toggle(i, 0);
+            TriState saved = ((nSavedOptions & 0x00000001) == 0x00000001) ? TRISTATE_TRUE : TRISTATE_FALSE;
+            if (i == int(SvtCompatibilityEntry::Index::AddTableSpacing) - 2)
+            {   // hack: map 2 bools to 1 tristate
+                nSavedOptions = nSavedOptions >> 1;
+                if (saved == TRISTATE_TRUE
+                    && ((nSavedOptions & 0x00000001) != 0x00000001))
+                {
+                    saved = TRISTATE_INDET;
+                }
+            }
+            if (current != saved)
             {
+                bool const bChecked(current != TRISTATE_FALSE);
+                assert(current != TRISTATE_INDET); // can't *change* it to that
                 int nCoptIdx = i + 2; /* Consider "Name" & "Module" indexes */
                 switch ( SvtCompatibilityEntry::Index(nCoptIdx) )
                 {
diff --git a/sw/uiconfig/swriter/ui/optcompatpage.ui b/sw/uiconfig/swriter/ui/optcompatpage.ui
index 29a5c6eaee75..1018dcc5e979 100644
--- a/sw/uiconfig/swriter/ui/optcompatpage.ui
+++ b/sw/uiconfig/swriter/ui/optcompatpage.ui
@@ -229,6 +229,7 @@
                               <attributes>
                                 <attribute name="visible">3</attribute>
                                 <attribute name="active">0</attribute>
+                                <attribute name="inconsistent">4</attribute>
                               </attributes>
                             </child>
                           </object>
diff --git a/unotools/source/config/compatibility.cxx b/unotools/source/config/compatibility.cxx
index a71c8ac39c8d..5556a0a231d4 100644
--- a/unotools/source/config/compatibility.cxx
+++ b/unotools/source/config/compatibility.cxx
@@ -66,6 +66,7 @@ SvtCompatibilityEntry::SvtCompatibilityEntry()
     setValue<bool>( Index::MsWordTrailingBlanks, false );
     setValue<bool>( Index::SubtractFlysAnchoredAtFlys, false );
     setValue<bool>( Index::EmptyDbFieldHidesPara, true );
+    setValue<bool>( Index::AddTableLineSpacing, false );
 
     setDefaultEntry( false );
 }
@@ -94,6 +95,7 @@ OUString SvtCompatibilityEntry::getName( const Index rIdx )
         "MsWordCompTrailingBlanks",
         "SubtractFlysAnchoredAtFlys",
         "EmptyDbFieldHidesPara",
+        "AddTableLineSpacing",
     };
 
     /* Size of sPropertyName array not equal size of the SvtCompatibilityEntry::Index enum class */
commit 10bd6792523509c6726dc7c1b02c17e758e568fe
Author:     Michael Stahl <Michael.Stahl at cib.de>
AuthorDate: Wed Sep 23 15:14:08 2020 +0200
Commit:     Andras Timar <andras.timar at collabora.com>
CommitDate: Fri Sep 25 15:56:01 2020 +0200

    tdf#134782 sw: split AddParaSpacingToTableCells flag in 2
    
    commit 3cccdabf19a99fd3f657985c1822436d7679df2b "extend
    AddParaSpacingToTableCells with line spacing" changed how the
    ADD_PARA_SPACING_TO_TABLE_CELLS compat flag works, to improve interop
    with Word.
    
    This commit splits out the change as a separate new compat flag
    ADD_PARA_LINE_SPACING_TO_TABLE_CELLS ("AddParaLineSpacingToTableCells"),
    to preserve compatibility with ODT documents that were produced
    by LO < 6.4 (via SwXMLImport::SetConfigurationSettings()).
    
    New documents and WW8/RTF/DOCX import have both flags enabled.
    
    The combination false/true is invalid, and treated as equivalent
    to false/false.
    
    Change-Id: Ida20df8fe4a8192a714f91da95345f9726fd7d98
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103317
    Tested-by: Jenkins
    Reviewed-by: Michael Stahl <michael.stahl at cib.de>
    (cherry picked from commit 38aa699f265c17548769aaa4f20e1ae35d18f202)
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103359
    Reviewed-by: Thorsten Behrens <Thorsten.Behrens at CIB.de>

diff --git a/sw/inc/IDocumentSettingAccess.hxx b/sw/inc/IDocumentSettingAccess.hxx
index 814f139b64fc..5b093bc0d08a 100644
--- a/sw/inc/IDocumentSettingAccess.hxx
+++ b/sw/inc/IDocumentSettingAccess.hxx
@@ -47,6 +47,7 @@ enum class DocumentSettingId
     USE_HIRES_VIRTUAL_DEVICE,
     OLD_LINE_SPACING,
     ADD_PARA_SPACING_TO_TABLE_CELLS,
+    ADD_PARA_LINE_SPACING_TO_TABLE_CELLS,
     USE_FORMER_OBJECT_POS,
     USE_FORMER_TEXT_WRAPPING,
     CONSIDER_WRAP_ON_OBJECT_POSITION,
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index 7a4442afcf52..dbb5f2f5121b 100644
--- a/sw/source/core/doc/DocumentSettingManager.cxx
+++ b/sw/source/core/doc/DocumentSettingManager.cxx
@@ -112,6 +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?
         mbUseFormerObjectPos                = aOptions.GetDefault( SvtCompatibilityEntry::Index::UseObjectPositioning );
         mbUseFormerTextWrapping             = aOptions.GetDefault( SvtCompatibilityEntry::Index::UseOurTextWrapping );
         mbConsiderWrapOnObjPos              = aOptions.GetDefault( SvtCompatibilityEntry::Index::ConsiderWrappingStyle );
@@ -131,6 +132,7 @@ sw::DocumentSettingManager::DocumentSettingManager(SwDoc &rDoc)
         mbAddExternalLeading                = true;
         mbOldLineSpacing                    = false;
         mbAddParaSpacingToTableCells        = false;
+        mbAddParaLineSpacingToTableCells    = false;
         mbUseFormerObjectPos                = false;
         mbUseFormerTextWrapping             = false;
         mbConsiderWrapOnObjPos              = false;
@@ -167,6 +169,7 @@ bool sw::DocumentSettingManager::get(/*[in]*/ DocumentSettingId id) const
         case DocumentSettingId::OLD_NUMBERING: return mbOldNumbering;
         case DocumentSettingId::OLD_LINE_SPACING: return mbOldLineSpacing;
         case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS: return mbAddParaSpacingToTableCells;
+        case DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS: return mbAddParaLineSpacingToTableCells;
         case DocumentSettingId::USE_FORMER_OBJECT_POS: return mbUseFormerObjectPos;
         case DocumentSettingId::USE_FORMER_TEXT_WRAPPING: return mbUseFormerTextWrapping;
         case DocumentSettingId::CONSIDER_WRAP_ON_OBJECT_POSITION: return mbConsiderWrapOnObjPos;
@@ -282,6 +285,9 @@ void sw::DocumentSettingManager::set(/*[in]*/ DocumentSettingId id, /*[in]*/ boo
         case DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS:
             mbAddParaSpacingToTableCells = value;
             break;
+        case DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS:
+            mbAddParaLineSpacingToTableCells = value;
+            break;
         case DocumentSettingId::USE_FORMER_OBJECT_POS:
             mbUseFormerObjectPos = value;
             break;
@@ -587,6 +593,7 @@ void sw::DocumentSettingManager::ReplaceCompatibilityOptions(const DocumentSetti
     mbAddExternalLeading = rSource.mbAddExternalLeading;
     mbOldLineSpacing = rSource.mbOldLineSpacing;
     mbAddParaSpacingToTableCells = rSource.mbAddParaSpacingToTableCells;
+    mbAddParaLineSpacingToTableCells = rSource.mbAddParaLineSpacingToTableCells;
     mbUseFormerObjectPos = rSource.mbUseFormerObjectPos;
     mbUseFormerTextWrapping = rSource.mbUseFormerTextWrapping;
     mbConsiderWrapOnObjPos = rSource.mbConsiderWrapOnObjPos;
diff --git a/sw/source/core/inc/DocumentSettingManager.hxx b/sw/source/core/inc/DocumentSettingManager.hxx
index e548c55a26b2..5a19e930f664 100644
--- a/sw/source/core/inc/DocumentSettingManager.hxx
+++ b/sw/source/core/inc/DocumentSettingManager.hxx
@@ -157,6 +157,7 @@ class DocumentSettingManager :
     bool mbPropLineSpacingShrinksFirstLine; // fdo#79602
     bool mbSubtractFlys; // tdf#86578
     bool mApplyParagraphMarkFormatToNumbering;
+    bool mbAddParaLineSpacingToTableCells; // tdf#125300 tdf#134782
 
     bool mbLastBrowseMode                           : 1;
     bool mbDisableOffPagePositioning; // tdf#112443
diff --git a/sw/source/core/layout/calcmove.cxx b/sw/source/core/layout/calcmove.cxx
index caa81ecbd182..b9687accdf90 100644
--- a/sw/source/core/layout/calcmove.cxx
+++ b/sw/source/core/layout/calcmove.cxx
@@ -134,7 +134,11 @@ bool SwContentFrame::ShouldBwdMoved( SwLayoutFrame *pNewUpper, bool & )
                         {
                             SwBorderAttrAccess aAccess( SwFrame::GetCache(), pLastFrame );
                             const SwBorderAttrs& rAttrs = *aAccess.Get();
-                            nNewTop -= rAttrs.GetULSpace().GetLower() + rAttrs.CalcLineSpacing();
+                            nNewTop -= rAttrs.GetULSpace().GetLower();
+                            if (rIDSA.get(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS))
+                            {
+                                nNewTop -= rAttrs.CalcLineSpacing();
+                            }
                         }
                     }
                 }
@@ -2147,10 +2151,16 @@ bool SwContentFrame::WouldFit_( SwTwips nSpace,
         }
 
         // Also consider lower spacing in table cells
+        IDocumentSettingAccess const& rIDSA(pNewUpper->GetFormat()->getIDocumentSettingAccess());
         if ( bRet && IsInTab() &&
-             pNewUpper->GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) )
+            rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS))
         {
-            nSpace -= rAttrs.GetULSpace().GetLower() + rAttrs.CalcLineSpacing();
+            nSpace -= rAttrs.GetULSpace().GetLower();
+
+            if (rIDSA.get(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS))
+            {
+                nSpace -= rAttrs.CalcLineSpacing();
+            }
             if ( nSpace < 0 )
             {
                 bRet = false;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 6d83406583a7..d416b637c02f 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -1716,7 +1716,8 @@ SwTwips SwFlowFrame::CalcAddLowerSpaceAsLastInTableCell(
 {
     SwTwips nAdditionalLowerSpace = 0;
 
-    if ( m_rThis.GetUpper()->GetFormat()->getIDocumentSettingAccess().get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS) )
+    IDocumentSettingAccess const& rIDSA(m_rThis.GetUpper()->GetFormat()->getIDocumentSettingAccess());
+    if (rIDSA.get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS))
     {
         const SwFrame* pFrame = &m_rThis;
         if ( pFrame->IsSctFrame() )
@@ -1741,7 +1742,14 @@ SwTwips SwFlowFrame::CalcAddLowerSpaceAsLastInTableCell(
         }
 
         if (_pAttrs)
-            nAdditionalLowerSpace += _pAttrs->GetULSpace().GetLower() + _pAttrs->CalcLineSpacing();
+        {
+            nAdditionalLowerSpace += _pAttrs->GetULSpace().GetLower();
+
+            if (rIDSA.get(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS))
+            {
+                nAdditionalLowerSpace += _pAttrs->CalcLineSpacing();
+            }
+        }
     }
 
     return nAdditionalLowerSpace;
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index f839d0b946b4..a861dd60013b 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -2525,7 +2525,7 @@ void SwBorderAttrs::GetBottomLine_( const SwFrame& _rFrame )
 
 void SwBorderAttrs::CalcLineSpacing_()
 {
-    // tdf#125300 compatibility option AddParaSpacingToTableCells needs also line spacing
+    // tdf#125300 compatibility option AddParaLineSpacingToTableCells needs also line spacing
     const SvxLineSpacingItem &rSpace = m_rAttrSet.GetLineSpacing();
     if ( rSpace.GetInterLineSpaceRule() == SvxInterLineSpaceRule::Prop && rSpace.GetPropLineSpace() > 100 )
     {
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index f29833775b4b..7fc65b6598e5 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1891,6 +1891,7 @@ void SwWW8ImplReader::ImportDop()
     // #i25901# - set new compatibility option
     //      'Add paragraph and table spacing at bottom of table cells'
     m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS, true);
+    m_rDoc.getIDocumentSettingAccess().set(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, true);
 
     // #i11860# - set new compatibility option
     //      'Use former object positioning' to <false>
diff --git a/sw/source/filter/xml/xmlimp.cxx b/sw/source/filter/xml/xmlimp.cxx
index 5ca2c262496e..75766a7f8a64 100644
--- a/sw/source/filter/xml/xmlimp.cxx
+++ b/sw/source/filter/xml/xmlimp.cxx
@@ -1362,6 +1362,7 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
     bool bUseOldNumbering = false;
     bool bAddExternalLeading = false;
     bool bAddParaSpacingToTableCells = false;
+    bool bAddParaLineSpacingToTableCells = false;
     bool bUseFormerLineSpacing = false;
     bool bUseFormerObjectPositioning = false;
     bool bUseFormerTextWrapping = false;
@@ -1434,6 +1435,8 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
                     bAddExternalLeading = true;
                 else if ( rValue.Name == "AddParaSpacingToTableCells" )
                     bAddParaSpacingToTableCells = true;
+                else if ( rValue.Name == "AddParaLineSpacingToTableCells" )
+                    bAddParaLineSpacingToTableCells = true;
                 else if ( rValue.Name == "UseFormerLineSpacing" )
                     bUseFormerLineSpacing = true;
                 else if ( rValue.Name == "UseFormerObjectPositioning" )
@@ -1536,6 +1539,10 @@ void SwXMLImport::SetConfigurationSettings(const Sequence < PropertyValue > & aC
         xProps->setPropertyValue( "AddParaSpacingToTableCells",
             makeAny( false ) );
     }
+    if (!bAddParaLineSpacingToTableCells)
+    {
+        xProps->setPropertyValue("AddParaLineSpacingToTableCells", makeAny(false));
+    }
 
     if( !bUseFormerTextWrapping )
     {
diff --git a/sw/source/uibase/uno/SwXDocumentSettings.cxx b/sw/source/uibase/uno/SwXDocumentSettings.cxx
index 51124bfe4071..1c437e021f93 100644
--- a/sw/source/uibase/uno/SwXDocumentSettings.cxx
+++ b/sw/source/uibase/uno/SwXDocumentSettings.cxx
@@ -98,6 +98,7 @@ enum SwDocumentSettingsPropertyHandles
     HANDLE_ALLOW_PRINTJOB_CANCEL,
     HANDLE_USE_FORMER_LINE_SPACING,
     HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS,
+    HANDLE_ADD_PARA_LINE_SPACING_TO_TABLE_CELLS,
     HANDLE_USE_FORMER_OBJECT_POSITIONING,
     HANDLE_USE_FORMER_TEXT_WRAPPING,
     HANDLE_CHANGES_PASSWORD,
@@ -185,6 +186,7 @@ static MasterPropertySetInfo * lcl_createSettingsInfo()
         { OUString("AllowPrintJobCancel"),        HANDLE_ALLOW_PRINTJOB_CANCEL,           cppu::UnoType<bool>::get(),           0},
         { OUString("UseFormerLineSpacing"),       HANDLE_USE_FORMER_LINE_SPACING,         cppu::UnoType<bool>::get(),           0},
         { OUString("AddParaSpacingToTableCells"), HANDLE_ADD_PARA_SPACING_TO_TABLE_CELLS, cppu::UnoType<bool>::get(),           0},
+        { OUString("AddParaLineSpacingToTableCells"), HANDLE_ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, cppu::UnoType<bool>::get(),           0},
         { OUString("UseFormerObjectPositioning"), HANDLE_USE_FORMER_OBJECT_POSITIONING,   cppu::UnoType<bool>::get(),           0},
         { OUString("UseFormerTextWrapping"),      HANDLE_USE_FORMER_TEXT_WRAPPING,        cppu::UnoType<bool>::get(),           0},
         { OUString("RedlineProtectionKey"),       HANDLE_CHANGES_PASSWORD,                cppu::UnoType< cppu::UnoSequenceType<sal_Int8> >::get(),           0},
@@ -630,6 +632,12 @@ void SwXDocumentSettings::_setSingleValue( const comphelper::PropertyInfo & rInf
             mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS, bTmp);
         }
         break;
+        case HANDLE_ADD_PARA_LINE_SPACING_TO_TABLE_CELLS:
+        {
+            bool bTmp = *o3tl::doAccess<bool>(rValue);
+            mpDoc->getIDocumentSettingAccess().set(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS, bTmp);
+        }
+        break;
         case HANDLE_USE_FORMER_OBJECT_POSITIONING:
         {
             bool bTmp = *o3tl::doAccess<bool>(rValue);
@@ -1188,6 +1196,11 @@ void SwXDocumentSettings::_getSingleValue( const comphelper::PropertyInfo & rInf
             rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_PARA_SPACING_TO_TABLE_CELLS);
         }
         break;
+        case HANDLE_ADD_PARA_LINE_SPACING_TO_TABLE_CELLS:
+        {
+            rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::ADD_PARA_LINE_SPACING_TO_TABLE_CELLS);
+        }
+        break;
         case HANDLE_USE_FORMER_OBJECT_POSITIONING:
         {
             rValue <<= mpDoc->getIDocumentSettingAccess().get(DocumentSettingId::USE_FORMER_OBJECT_POS);
diff --git a/writerfilter/source/filter/WriterFilter.cxx b/writerfilter/source/filter/WriterFilter.cxx
index 3b2405867aad..9f6c6d2881ac 100644
--- a/writerfilter/source/filter/WriterFilter.cxx
+++ b/writerfilter/source/filter/WriterFilter.cxx
@@ -293,6 +293,7 @@ void WriterFilter::setTargetDocument(const uno::Reference< lang::XComponent >& x
     xSettings->setPropertyValue("DoNotResetParaAttrsForNumFont", uno::makeAny(false));
     xSettings->setPropertyValue("UseFormerLineSpacing", uno::makeAny(false));
     xSettings->setPropertyValue("AddParaSpacingToTableCells", uno::makeAny(true));
+    xSettings->setPropertyValue("AddParaLineSpacingToTableCells", uno::makeAny(true));
     xSettings->setPropertyValue("UseFormerObjectPositioning", uno::makeAny(false));
     xSettings->setPropertyValue("ConsiderTextWrapOnObjPos", uno::makeAny(true));
     xSettings->setPropertyValue("UseFormerTextWrapping", uno::makeAny(false));


More information about the Libreoffice-commits mailing list