summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2020-10-01 17:29:06 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2020-10-16 11:09:32 +0200
commit1bb8842f8c1f8bd12a3b9e6a99c037579654d2cd (patch)
tree82e06f1e3d6ade61f318adc4a83394e97e90afa8
parent0352089409859b0017a877b26d1c8590f8a4e5f1 (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> (cherry picked from commit e65b1ba0033e1adaa4135539bb7b34b28cbedd7c)
-rw-r--r--sw/source/core/doc/gctable.cxx15
1 files changed, 15 insertions, 0 deletions
diff --git a/sw/source/core/doc/gctable.cxx b/sw/source/core/doc/gctable.cxx
index 493ef4248c91..1d5a2a4eed25 100644
--- a/sw/source/core/doc/gctable.cxx
+++ b/sw/source/core/doc/gctable.cxx
@@ -351,6 +351,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