Html Reader Comments (#2235)
* Html Reader Comments See issue #2234. Html Reader processes Comment as comment, then processes it as part of cell contents. Change to only do the first. Comment Test checks that comment read by Html Reader is okay, but neglects to check the value of the cell to which the comment is attached. Added that check. * Disconnect Worksheets ... at end of test.
This commit is contained in:
parent
0cd20f3099
commit
de230fa899
|
|
@ -345,8 +345,9 @@ class Html extends BaseReader
|
|||
$sheet->getComment($column . $row)
|
||||
->getText()
|
||||
->createTextRun($child->textContent);
|
||||
} else {
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
}
|
||||
$this->processDomElement($child, $sheet, $row, $column, $cellContent);
|
||||
|
||||
if (isset($this->formats[$child->nodeName])) {
|
||||
$sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
|
||||
|
|
|
|||
|
|
@ -40,8 +40,9 @@ class CommentsTest extends AbstractFunctional
|
|||
|
||||
$commentCoordinate = key($commentsLoaded);
|
||||
self::assertSame('E10', $commentCoordinate);
|
||||
self::assertSame('Comment', $sheet->getCell('E10')->getValue());
|
||||
$comment = $commentsLoaded[$commentCoordinate];
|
||||
self::assertEquals('Comment to test', (string) $comment);
|
||||
self::assertSame('Comment to test', (string) $comment);
|
||||
$commentClone = clone $comment;
|
||||
self::assertEquals($comment, $commentClone);
|
||||
self::assertNotSame($comment, $commentClone);
|
||||
|
|
@ -51,5 +52,7 @@ class CommentsTest extends AbstractFunctional
|
|||
$comment->setAlignment(Alignment::HORIZONTAL_RIGHT);
|
||||
self::assertEquals(Alignment::HORIZONTAL_RIGHT, $comment->getAlignment());
|
||||
}
|
||||
$spreadsheet->disconnectWorksheets();
|
||||
$reloadedSpreadsheet->disconnectWorksheets();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue