Skip to content

Commit 3cc82a9

Browse files
committed
Border Tweak
Do not override base style if conditional style indicates BORDER_OMIT. Do not export BORDER_NONE color 0 for conditional; same approach is already taken for unconditional.
1 parent 2735c40 commit 3cc82a9

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/PhpSpreadsheet/Style/ConditionalFormatting/StyleMerger.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,11 @@ protected function mergeBordersStyle(Borders $baseBordersStyle, Borders $borders
7878

7979
protected function mergeBorderStyle(Border $baseBorderStyle, Border $borderStyle): void
8080
{
81-
$baseBorderStyle->setBorderStyle($borderStyle->getBorderStyle());
81+
if ($borderStyle->getBorderStyle() !== Border::BORDER_OMIT) {
82+
$baseBorderStyle->setBorderStyle(
83+
$borderStyle->getBorderStyle()
84+
);
85+
}
8286
if ($borderStyle->getColor()->getARGB() !== null) {
8387
$baseBorderStyle->setColor($borderStyle->getColor());
8488
}

src/PhpSpreadsheet/Writer/Html.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1658,7 +1658,9 @@ private function generateRowWriteCell(
16581658
$holdCss = '';
16591659
}
16601660
foreach ($styles as $key => $value) {
1661-
$html .= $key . ':' . $value . ';';
1661+
if (!str_starts_with($key, 'border-') || $value !== 'none #000000') {
1662+
$html .= $key . ':' . $value . ';';
1663+
}
16621664
}
16631665
$html .= '"';
16641666
}

0 commit comments

Comments
 (0)