[Libreoffice-commits] core.git: sw/source
Justin Luth (via logerrit)
logerrit at kemper.freedesktop.org
Fri Dec 20 09:54:01 UTC 2019
sw/source/core/doc/tblafmt.cxx | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
New commits:
commit 43f983d08d66520536980339f33ef44d5eec35f6
Author: Justin Luth <justin.luth at collabora.com>
AuthorDate: Wed Nov 27 12:52:38 2019 +0300
Commit: Miklos Vajna <vmiklos at collabora.com>
CommitDate: Fri Dec 20 10:52:42 2019 +0100
tdf#115026 sw tableAutoFormat: don't clear break/keep
If a table style HAS defined a page-break
or keep-with-next-paragraph, then apply it when
applying the style. But if the format just has a default
non-break/non-keep attribute, then don't apply that.
Kinda seems artificial/arbitrary, but it looks difficult
to change the break/keep property to be an optional component.
If it was optional, then it would be fine to take a
defined non-break and apply it, but since it is a
mandatory value, just ignore the default state.
Yes, this means that applying one style can introduce a
break/keep, but applying a different style cannot
remove it. None of the build-in styles has either of
these properties set. Since there is no way to identify
direct formatting, assuming the user intentionally
set these is the better policy by far...
I didn't do the same thing with shadow/collapsing borders
etc. Those seem more like table style properties than these
two flow items.
I still couldn't get the unit test to work.
I got access to the created document by removing
EnableKillingFile from swmodelbase, and from that I can see
that the autoformat is not affecting the table with
RestoreTableProperties.
I assume the Break is overwritten during the table creation
process because I can see the background being applied
in that case, but still no Break.
Change-Id: Ia2a4ff8a19158b1ea5d74ec3a21c688c53d66724
Reviewed-on: https://gerrit.libreoffice.org/83879
Tested-by: Jenkins
Reviewed-by: Justin Luth <justin_luth at sil.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.com>
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index ae7c3e6fadbb..58756cce6d7f 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -684,11 +684,13 @@ void SwTableAutoFormat::RestoreTableProperties(SwTable &table) const
SfxItemSet rSet(pDoc->GetAttrPool(), aTableSetRange);
- rSet.Put(*m_aBreak);
+ if ( m_aBreak->GetBreak() != SvxBreak::NONE )
+ rSet.Put(*m_aBreak);
rSet.Put(m_aPageDesc);
rSet.Put(SwFormatLayoutSplit(m_bLayoutSplit));
rSet.Put(SfxBoolItem(RES_COLLAPSING_BORDERS, m_bCollapsingBorders));
- rSet.Put(*m_aKeepWithNextPara);
+ if ( m_aKeepWithNextPara->GetValue() )
+ rSet.Put(*m_aKeepWithNextPara);
rSet.Put(*m_aShadow);
pFormat->SetFormatAttr(rSet);
@@ -881,7 +883,7 @@ OUString SwTableAutoFormat::GetTableTemplateCellSubName(const SwBoxAutoFormat& r
* +-----------------------------------------------------------------------+
* 4 | | | | | | |
* +-----------------------------------------------------------------------+
- * 5 | LRSC | LR | LRENC | | | LRENC |
+ * 5 | LRSC | LR | LREC | | | LRENC |
* +-----------+-----------+-----------+-----------+-----------+-----------+
* ODD = 1, 3, 5, ...
* EVEN = 2, 4, 6, ...
More information about the Libreoffice-commits
mailing list