@@ -663,19 +663,15 @@ protected static function parseStyle($attribute, $styles)
663
663
$ matches = array ();
664
664
if (preg_match ('/([a-z]+)/ ' , $ cValue , $ matches )) {
665
665
//$cvalue text and not number
666
- if ($ cValue == 'normal ' ) {
666
+ if ($ cValue == 'normal ' ) {
667
667
$ cValue = 1.12 ;
668
- $ spacingLineRule = \PhpOffice \PhpWord \SimpleType \LineSpacingRule::AUTO ;
669
- //we are subtracting 1 line height because the Spacing writer is adding one line
670
- $ spacing = ($ cValue * Paragraph::LINE_HEIGHT ) - Paragraph::LINE_HEIGHT ;
671
- }else {
668
+ } else {
672
669
$ cValue = 1.13 ;
673
- $ spacingLineRule = \PhpOffice \PhpWord \SimpleType \LineSpacingRule::AUTO ;
674
- //we are subtracting 1 line height because the Spacing writer is adding one line
675
- $ spacing = ($ cValue * Paragraph::LINE_HEIGHT ) - Paragraph::LINE_HEIGHT ;
676
670
}
677
- }
678
- elseif (preg_match ('/([0-9]+\.?[0-9]*[a-z]+)/ ' , $ cValue , $ matches )) {
671
+ $ spacingLineRule = \PhpOffice \PhpWord \SimpleType \LineSpacingRule::AUTO ;
672
+ //we are subtracting 1 line height because the Spacing writer is adding one line
673
+ $ spacing = ($ cValue * Paragraph::LINE_HEIGHT ) - Paragraph::LINE_HEIGHT ;
674
+ } elseif (preg_match ('/([0-9]+\.?[0-9]*[a-z]+)/ ' , $ cValue , $ matches )) {
679
675
//matches number with a unit, e.g. 12px, 15pt, 20mm, ...
680
676
$ spacingLineRule = \PhpOffice \PhpWord \SimpleType \LineSpacingRule::EXACT ;
681
677
$ spacing = Converter::cssToTwip ($ matches [1 ]);
0 commit comments