summaryrefslogtreecommitdiff
path: root/sw/source
diff options
context:
space:
mode:
authorMichael Weghorn <m.weghorn@posteo.de>2020-09-28 17:46:27 +0200
committerMichael Weghorn <m.weghorn@posteo.de>2020-09-28 17:46:27 +0200
commite3daa3b3aa88ada77d4680a2df9ef534341cb618 (patch)
tree0f274ea0334d8e61b7ce9fba97fee7ccde4e2c55 /sw/source
parentd0fdfe0e92a1989c61613fcb8deeb3256eb0816a (diff)
parent956513a6990f59b8bcf2ed7e12a6c8fe57bb13f5 (diff)
Merge branch 'libreoffice-6-4'
into distro/lhm/libreoffice-6-4+backports Change-Id: Id89f295a3e669a51da822c09a759165dfc79dc6f
Diffstat (limited to 'sw/source')
-rw-r--r--sw/source/core/crsr/callnk.cxx5
-rw-r--r--sw/source/core/doc/DocumentSettingManager.cxx7
-rw-r--r--sw/source/core/doc/docfmt.cxx1
-rw-r--r--sw/source/core/doc/doclay.cxx8
-rw-r--r--sw/source/core/inc/DocumentSettingManager.hxx1
-rw-r--r--sw/source/core/layout/calcmove.cxx16
-rw-r--r--sw/source/core/layout/flowfrm.cxx12
-rw-r--r--sw/source/core/layout/frmtool.cxx2
-rw-r--r--sw/source/core/view/viewsh.cxx5
-rw-r--r--sw/source/filter/ww8/ww8par.cxx1
-rw-r--r--sw/source/filter/xml/xmlimp.cxx7
-rw-r--r--sw/source/filter/xml/xmltble.cxx21
-rw-r--r--sw/source/ui/config/optcomp.cxx48
-rw-r--r--sw/source/uibase/uno/SwXDocumentSettings.cxx13
14 files changed, 127 insertions, 20 deletions
diff --git a/sw/source/core/crsr/callnk.cxx b/sw/source/core/crsr/callnk.cxx
index f02e6336631a..4d956e90e2c5 100644
--- a/sw/source/core/crsr/callnk.cxx
+++ b/sw/source/core/crsr/callnk.cxx
@@ -59,7 +59,7 @@ SwCallLink::SwCallLink( SwCursorShell & rSh )
}
}
-static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell const & rShell)
+static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell & rShell)
{
if ( !pNode )
return;
@@ -76,11 +76,12 @@ static void lcl_notifyRow(const SwContentNode* pNode, SwCursorShell const & rShe
const SwTableLine* pLine = pRow->GetTabLine( );
- if (rShell.IsTableMode())
+ if (rShell.IsTableMode() || (rShell.StartsWithTable() && rShell.ExtendedSelectedAll()))
{
// If we have a table selection, then avoid the notification: it's not necessary (the text
// cursor needs no updating) and the notification may kill the selection overlay, leading to
// flicker.
+ // Same for whole-document selection when it starts with a table.
return;
}
diff --git a/sw/source/core/doc/DocumentSettingManager.cxx b/sw/source/core/doc/DocumentSettingManager.cxx
index b7f3af73d2af..726db3242647 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::AddTableLineSpacing );
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;
@@ -283,6 +286,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;
@@ -588,6 +594,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/doc/docfmt.cxx b/sw/source/core/doc/docfmt.cxx
index a738ea1596a0..f7a11676594e 100644
--- a/sw/source/core/doc/docfmt.cxx
+++ b/sw/source/core/doc/docfmt.cxx
@@ -1942,6 +1942,7 @@ void SwDoc::dumpAsXml(xmlTextWriterPtr pWriter) const
mpFrameFormatTable->dumpAsXml(pWriter, "frmFormatTable");
mpSpzFrameFormatTable->dumpAsXml(pWriter, "spzFrameFormatTable");
mpSectionFormatTable->dumpAsXml(pWriter);
+ mpTableFrameFormatTable->dumpAsXml(pWriter, "tableFrameFormatTable");
mpNumRuleTable->dumpAsXml(pWriter);
getIDocumentRedlineAccess().GetRedlineTable().dumpAsXml(pWriter);
getIDocumentRedlineAccess().GetExtraRedlineTable().dumpAsXml(pWriter);
diff --git a/sw/source/core/doc/doclay.cxx b/sw/source/core/doc/doclay.cxx
index 2a63e2112b6b..ec4861fe39b2 100644
--- a/sw/source/core/doc/doclay.cxx
+++ b/sw/source/core/doc/doclay.cxx
@@ -1349,11 +1349,9 @@ static OUString lcl_GetUniqueFlyName(const SwDoc* pDoc, const char* pDefStrId, s
if (pObj)
lcl_collectUsedNums(aUsedNums, nNmLen, *pObj, aName);
}
- else
- {
- OUString sName = pFlyFormat->GetName();
- lcl_collectUsedNums(aUsedNums, nNmLen, sName, aName);
- }
+
+ OUString sName = pFlyFormat->GetName();
+ lcl_collectUsedNums(aUsedNums, nNmLen, sName, aName);
}
// All numbers are flagged accordingly, so determine the right one
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/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 12c1989478a0..f618105629c0 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/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 166df718c720..44812a67ad1f 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/filter/xml/xmltble.cxx b/sw/source/filter/xml/xmltble.cxx
index 80d786d8d884..6a4fa1c9902b 100644
--- a/sw/source/filter/xml/xmltble.cxx
+++ b/sw/source/filter/xml/xmltble.cxx
@@ -1183,8 +1183,27 @@ void SwXMLTextParagraphExport::exportTable(
// During the flat XML export (used e.g. by .sdw-export)
// ALL flags are set at the same time.
const bool bExportStyles = bool( GetExport().getExportFlags() & SvXMLExportFlags::STYLES );
- if ( bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter( aIdx ) )
+ if (!isAutoStylesCollected()
+ && (bExportStyles || !pFormat->GetDoc()->IsInHeaderFooter(aIdx)))
+ {
maTableNodes.push_back(pTableNd);
+ // Collect all tables inside cells of this table, too
+ const auto aCellNames = pXTable->getCellNames();
+ for (const OUString& rCellName : aCellNames)
+ {
+ css::uno::Reference<css::container::XEnumerationAccess> xCell(
+ pXTable->getCellByName(rCellName), css::uno::UNO_QUERY);
+ if (!xCell)
+ continue;
+ auto xEnumeration = xCell->createEnumeration();
+ while (xEnumeration->hasMoreElements())
+ {
+ if (css::uno::Reference<css::text::XTextTable> xInnerTable{
+ xEnumeration->nextElement(), css::uno::UNO_QUERY })
+ exportTable(xInnerTable, bAutoStyles, _bProgress);
+ }
+ }
+ }
}
else
{
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/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);