diff options
author | Michael Stahl <Michael.Stahl@cib.de> | 2020-10-01 17:29:06 +0200 |
---|---|---|
committer | Michael Stahl <michael.stahl@cib.de> | 2020-10-05 12:54:09 +0200 |
commit | e65b1ba0033e1adaa4135539bb7b34b28cbedd7c (patch) | |
tree | 3d1dd6273c034ad043861ab5de5db297ac3b64c0 /sw | |
parent | 309868c32f00e5ca045f941deafb5216aad2538c (diff) |
sw: SwTable::GCLines(): don't throw away row background
If there's a row background, and a cell in the row doesn't override it,
apply the row background to the cell.
Change-Id: I37cd33249d3ab66c898c537e3bc6bab067d6f74b
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103772
Tested-by: Jenkins
Reviewed-by: Michael Stahl <michael.stahl@cib.de>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/core/doc/gctable.cxx | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx index 355eb70538dd..7f428dee033c 100644 --- a/sw/source/core/doc/gctable.cxx +++ b/sw/source/core/doc/gctable.cxx @@ -360,6 +360,21 @@ static bool lcl_MergeGCBox(SwTableBox* pTableBox, GCLinePara* pPara) for( auto pTabBox : pCpyLine->GetTabBoxes() ) pTabBox->SetUpper( pInsLine ); + SfxPoolItem const* pRowBrush(nullptr); + pCpyLine->GetFrameFormat()->GetItemState(RES_BACKGROUND, true, &pRowBrush); + if (pRowBrush) + { + for (auto pBox : pCpyLine->GetTabBoxes()) + { + SfxPoolItem const* pCellBrush(nullptr); + if (pBox->GetFrameFormat()->GetItemState(RES_BACKGROUND, true, &pCellBrush) != SfxItemState::SET) + { // set inner row background on inner cell + pBox->ClaimFrameFormat(); + pBox->GetFrameFormat()->SetFormatAttr(*pRowBrush); + } + } + } + // remove the old box from its parent line it = pInsLine->GetTabBoxes().erase( it ); // insert the nested line's boxes in its place |