@@ -90,7 +90,7 @@ public class PathSvgNodeRenderer : AbstractSvgNodeRenderer {
90
90
/// the attribute to be split is valid.
91
91
/// The regex splits at each letter.
92
92
/// </summary>
93
- private readonly String SPLIT_REGEX = "(?=[\\ p{L}])" ;
93
+ private const String SPLIT_REGEX = "(?=[\\ p{L}])" ;
94
94
95
95
/// <summary>
96
96
/// The
@@ -276,7 +276,7 @@ private IList<IPathShape> ProcessPathOperator(String[] pathProperties, IPathShap
276
276
277
277
/// <summary>
278
278
/// Processes the
279
- /// <see cref="SvgConstants.Attributes.D"/>
279
+ /// <see cref="iText.Svg. SvgConstants.Attributes.D"/>
280
280
///
281
281
/// <see cref="AbstractSvgNodeRenderer.attributesAndStyles"/>
282
282
/// and converts them
@@ -340,38 +340,41 @@ private ICollection<String> ParsePropertiesAndStyles() {
340
340
}
341
341
}
342
342
String [ ] resultArray = iText . IO . Util . StringUtil . Split ( result . ToString ( ) , SPLIT_REGEX ) ;
343
- IList < String > resultList = new List < String > ( JavaUtil . ArraysAsList ( resultArray ) ) ;
344
- return resultList ;
343
+ return new List < String > ( JavaUtil . ArraysAsList ( resultArray ) ) ;
345
344
}
346
345
347
346
/// <summary>Iterate over the input string and to seperate</summary>
348
- /// <param name="input"/>
349
- /// <returns/>
350
347
internal virtual String SeparateDecimalPoints ( String input ) {
351
348
//If a space or minus sign is found reset
352
349
//If a another point is found, add an extra space on before the point
353
- String res = "" ;
350
+ StringBuilder res = new StringBuilder ( ) ;
354
351
//Iterate over string
355
352
bool decimalPointEncountered = false ;
356
353
for ( int i = 0 ; i < input . Length ; i ++ ) {
357
354
char c = input [ i ] ;
358
- //If it's a whitespace or minus sign and a point was previously found, reset
355
+ //If it's a whitespace or a minus sign and a point was previously found, reset the decimal point flag
359
356
if ( decimalPointEncountered && ( c == '-' || iText . IO . Util . TextUtil . IsWhiteSpace ( c ) ) ) {
360
357
decimalPointEncountered = false ;
361
358
}
362
359
//If a point is found, mark and continue
363
360
if ( c == '.' ) {
364
- //If it's the second point, add extra space
361
+ //If it's the second point, add an extra space
365
362
if ( decimalPointEncountered ) {
366
- res += " " ;
363
+ res . Append ( " " ) ;
367
364
}
368
365
else {
369
366
decimalPointEncountered = true ;
370
367
}
371
368
}
372
- res += c ;
369
+ else {
370
+ if ( c == '-' ) {
371
+ // If a minus is found, add an extra space
372
+ res . Append ( " " ) ;
373
+ }
374
+ }
375
+ res . Append ( c ) ;
373
376
}
374
- return res ;
377
+ return res . ToString ( ) ;
375
378
}
376
379
}
377
380
}
0 commit comments