diff options
author | Miklos Vajna <vmiklos@collabora.com> | 2020-02-19 18:03:59 +0100 |
---|---|---|
committer | Miklos Vajna <vmiklos@collabora.com> | 2020-02-19 20:15:29 +0100 |
commit | e6fa52c2c371c7adc9c2c2cb18c3a8cf782cfa4b (patch) | |
tree | f090c50815727c468bebe50311246ab9424d1250 /sw/source | |
parent | 7448b69b4aaa982940e49c5ace9842f07dd81938 (diff) |
sw table cell borders: add optional Word-compatible border collapsing
We always compared border width and other aspects only after that, Word
works with border weight according to their implementer notes.
So extend svx::frame::Style to be able to collapse borders using weights
and opt in for that from sw/ in case a compat mode (which is related to
tables, off by default and is set by the DOC/DOCX import) is set.
Change-Id: I1f682789302c88a0d326c6c0263ad3007441cb24
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/89052
Reviewed-by: Miklos Vajna <vmiklos@collabora.com>
Tested-by: Jenkins
Diffstat (limited to 'sw/source')
-rw-r--r-- | sw/source/core/layout/paintfrm.cxx | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx index d0c72f9b4f91..50cc2aaac8a7 100644 --- a/sw/source/core/layout/paintfrm.cxx +++ b/sw/source/core/layout/paintfrm.cxx @@ -2744,11 +2744,23 @@ void SwTabFramePainter::Insert(const SwFrame& rFrame, const SvxBoxItem& rBoxItem bool const bVert = mrTabFrame.IsVertical(); bool const bR2L = mrTabFrame.IsRightToLeft(); + bool bWordTableCell = false; + SwViewShell* pShell = rFrame.getRootFrame()->GetCurrShell(); + if (pShell) + { + const IDocumentSettingAccess& rIDSA = pShell->GetDoc()->getIDocumentSettingAccess(); + bWordTableCell = rIDSA.get(DocumentSettingId::TABLE_ROW_KEEP); + } + // no scaling needed, it's all in the primitives and the target device svx::frame::Style aL(rBoxItem.GetLeft(), 1.0); + aL.SetWordTableCell(bWordTableCell); svx::frame::Style aR(rBoxItem.GetRight(), 1.0); + aR.SetWordTableCell(bWordTableCell); svx::frame::Style aT(rBoxItem.GetTop(), 1.0); + aT.SetWordTableCell(bWordTableCell); svx::frame::Style aB(rBoxItem.GetBottom(), 1.0); + aB.SetWordTableCell(bWordTableCell); aR.MirrorSelf(); aB.MirrorSelf(); |