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 <jluth@mail.com>
Reviewed-by: Samuel Mehrbrodt <samuel.mehrbrodt@allotropia.de>
diff --git a/sw/source/core/docnode/ndtbl1.cxx b/sw/source/core/docnode/ndtbl1.cxx
index 1cb5fc6..e6a68e7 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);