Skip to content

Commit 0084776

Browse files
SenseExceptionPowerKiKi
authored andcommitted
Remove Scrutinizer failure condition
Previous commits introduced failure conditions in Scrutinizer, which dropped the index of Xlsx reader drasticly.
1 parent edae73b commit 0084776

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/PhpSpreadsheet/Reader/Xlsx.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2068,16 +2068,14 @@ private function parseRichText($is)
20682068
} else {
20692069
if (is_object($is->r)) {
20702070
foreach ($is->r as $run) {
2071-
if (!isset($run->rPr)) {
2072-
$objText = $value->createText(StringHelper::controlCharacterOOXML2PHP((string) $run->t));
2073-
} else {
2071+
if (isset($run->rPr)) {
20742072
$objText = $value->createTextRun(StringHelper::controlCharacterOOXML2PHP((string) $run->t));
20752073

20762074
if (isset($run->rPr->rFont['val'])) {
20772075
$objText->getFont()->setName((string) $run->rPr->rFont['val']);
20782076
}
20792077
if (isset($run->rPr->sz['val'])) {
2080-
$objText->getFont()->setSize((string) $run->rPr->sz['val']);
2078+
$objText->getFont()->setSize((float) $run->rPr->sz['val']);
20812079
}
20822080
if (isset($run->rPr->color)) {
20832081
$objText->getFont()->setColor(new Color(self::readColor($run->rPr->color)));
@@ -2139,7 +2137,7 @@ private function readRibbon(Spreadsheet $excel, $customUITarget, $zip)
21392137
'SimpleXMLElement',
21402138
Settings::getLibXmlLoaderOptions()
21412139
);
2142-
if ($UIRels) {
2140+
if (false !== $UIRels) {
21432141
// we need to save id and target to avoid parsing customUI.xml and "guess" if it's a pseudo callback who load the image
21442142
foreach ($UIRels->Relationship as $ele) {
21452143
if ($ele['Type'] == 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image') {
@@ -2155,11 +2153,11 @@ private function readRibbon(Spreadsheet $excel, $customUITarget, $zip)
21552153
if (count($customUIImagesNames) > 0 && count($customUIImagesBinaries) > 0) {
21562154
$excel->setRibbonBinObjects($customUIImagesNames, $customUIImagesBinaries);
21572155
} else {
2158-
$excel->setRibbonBinObjects(null);
2156+
$excel->setRibbonBinObjects(null, null);
21592157
}
21602158
} else {
2161-
$excel->setRibbonXMLData(null);
2162-
$excel->setRibbonBinObjects(null);
2159+
$excel->setRibbonXMLData(null, null);
2160+
$excel->setRibbonBinObjects(null, null);
21632161
}
21642162
}
21652163

0 commit comments

Comments
 (0)