sw/source/core/docnode/ndtbl1.cxx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
New commits: commit 1f13e12700af83734eb830e4aed04f701a2caabc Author: Justin Luth <justin_l...@sil.org> AuthorDate: Mon Dec 20 15:42:46 2021 +0200 Commit: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> CommitDate: Thu Feb 3 08:04:13 2022 +0100 related tdf#90805 sw table: ensure border when setting border style When using uno:LineStyle to set a table's border style, add all borders if there are none at all. The thickness of this line is set in svx/source/tbxctrls/tbcontrl.cxx to ::Thin (which is different from ::VeryThin set by color and borders). Change-Id: I8af1e6a2447a3bb99f00b9c19708bd2a1208109d Reviewed-on: https://gerrit.libreoffice.org/c/core/+/127166 Tested-by: Jenkins Reviewed-by: Justin Luth <jl...@mail.com> Reviewed-by: Samuel Mehrbrodt <samuel.mehrbr...@allotropia.de> diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx index 1cb5fc651b6c..e6a68e76a521 100644 --- a/sw/source/core/docnode/ndtbl1.cxx +++ b/sw/source/core/docnode/ndtbl1.cxx @@ -930,7 +930,10 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, GetIDocumentUndoRedo().AppendUndo(std::make_unique<SwUndoAttrTable>(*pTableNd)); } - const SvxBorderLine aDefaultBorder(pColor, SvxBorderLineWidth::VeryThin); + SvxBorderLine aDefaultBorder(pBorderLine ? *pBorderLine + : SvxBorderLine(pColor, SvxBorderLineWidth::VeryThin)); + if (pColor && pBorderLine) + aDefaultBorder.SetColor(*pColor); for( auto &rU : aUnions ) { @@ -959,7 +962,7 @@ void SwDoc::SetTabLineStyle( const SwCursor& rCursor, { aBox.reset(::GetDfltAttr(RES_BOX)->Clone()); } - else if (pColor && !pBorderLine && !pTop && !pBot && !pLeft && !pRight) + else if ((pColor || pBorderLine) && !pTop && !pBot && !pLeft && !pRight) { aBox->SetLine(&aDefaultBorder, SvxBoxItemLine::TOP); aBox->SetLine(&aDefaultBorder, SvxBoxItemLine::BOTTOM);