Skip to content

Commit 5a36873

Browse files
committed
Update autoported files
f7a0ca8169f8f8229aeece4fdbc9e4ee8786e6b0
1 parent 36ee153 commit 5a36873

File tree

22 files changed

+104
-80
lines changed

22 files changed

+104
-80
lines changed

itext.tests/itext.kernel.tests/itext/kernel/pdf/canvas/TextRenderInfoUnitTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private static PdfDictionary InitFontDictWithNotSpecifiedWidthOfSpaceChar() {
9898
+ " 361 572 484 715 571 490 465";
9999
PdfArray widthsArray = new PdfArray();
100100
foreach (String w in iText.IO.Util.StringUtil.Split(widths, " ")) {
101-
widthsArray.Add(new PdfNumber(Convert.ToInt32(w)));
101+
widthsArray.Add(new PdfNumber(Convert.ToInt32(w, System.Globalization.CultureInfo.InvariantCulture)));
102102
}
103103
fontDict.Put(PdfName.Widths, widthsArray);
104104
return fontDict;

itext/itext.barcodes/itext/barcodes/Barcode128.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ public static String GetHumanReadableUCCEAN(String code) {
225225
if (code.Length < k) {
226226
break;
227227
}
228-
int subcode = Convert.ToInt32(code.JSubstring(0, k));
228+
int subcode = Convert.ToInt32(code.JSubstring(0, k), System.Globalization.CultureInfo.InvariantCulture);
229229
n = ais.ContainsKey(subcode) ? (int)ais.Get(subcode) : 0;
230230
if (n != 0) {
231231
idlen = k;
@@ -688,7 +688,7 @@ public override void SetCode(String code) {
688688
if (sai.Length < 2) {
689689
throw new ArgumentException("AI is too short");
690690
}
691-
int ai = Convert.ToInt32(sai);
691+
int ai = Convert.ToInt32(sai, System.Globalization.CultureInfo.InvariantCulture);
692692
int len = (int)ais.Get(ai);
693693
if (len == 0) {
694694
throw new ArgumentException("AI not found");

itext/itext.forms/itext/forms/xfdf/XfdfObjectFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,8 @@ private void AddAnnotObjectAttribute(AnnotObject annotObject, XmlNode attributeN
272272
switch (attributeName) {
273273
case XfdfConstants.PAGE: {
274274
//required
275-
annotObject.AddFdfAttributes(Convert.ToInt32(attributeNode.Value));
275+
annotObject.AddFdfAttributes(Convert.ToInt32(attributeNode.Value, System.Globalization.CultureInfo.InvariantCulture
276+
));
276277
break;
277278
}
278279

itext/itext.forms/itext/forms/xfdf/XfdfReader.cs

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
148148
if (annotObject.GetAttributeValue(XfdfConstants.STATE_MODEL) != null) {
149149
pdfTextAnnotation.SetStateModel(new PdfString(annotObject.GetAttributeValue(XfdfConstants.STATE_MODEL)));
150150
}
151-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttributeValue(XfdfConstants.PAGE))).AddAnnotation(pdfTextAnnotation
152-
);
151+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttributeValue(XfdfConstants.PAGE), System.Globalization.CultureInfo.InvariantCulture
152+
)).AddAnnotation(pdfTextAnnotation);
153153
break;
154154
}
155155

@@ -159,8 +159,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
159159
(annotObject.GetAttributeValue(XfdfConstants.COORDS)));
160160
AddCommonAnnotationAttributes(pdfHighLightAnnotation, annotObject);
161161
AddMarkupAnnotationAttributes(pdfHighLightAnnotation, annotObject);
162-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
163-
(pdfHighLightAnnotation);
162+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
163+
)).AddAnnotation(pdfHighLightAnnotation);
164164
break;
165165
}
166166

@@ -170,8 +170,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
170170
(annotObject.GetAttributeValue(XfdfConstants.COORDS)));
171171
AddCommonAnnotationAttributes(pdfUnderlineAnnotation, annotObject);
172172
AddMarkupAnnotationAttributes(pdfUnderlineAnnotation, annotObject);
173-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
174-
(pdfUnderlineAnnotation);
173+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
174+
)).AddAnnotation(pdfUnderlineAnnotation);
175175
break;
176176
}
177177

@@ -181,8 +181,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
181181
(annotObject.GetAttributeValue(XfdfConstants.COORDS)));
182182
AddCommonAnnotationAttributes(pdfStrikeoutAnnotation, annotObject);
183183
AddMarkupAnnotationAttributes(pdfStrikeoutAnnotation, annotObject);
184-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
185-
(pdfStrikeoutAnnotation);
184+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
185+
)).AddAnnotation(pdfStrikeoutAnnotation);
186186
break;
187187
}
188188

@@ -192,8 +192,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
192192
(annotObject.GetAttributeValue(XfdfConstants.COORDS)));
193193
AddCommonAnnotationAttributes(pdfSquigglyAnnotation, annotObject);
194194
AddMarkupAnnotationAttributes(pdfSquigglyAnnotation, annotObject);
195-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
196-
(pdfSquigglyAnnotation);
195+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
196+
)).AddAnnotation(pdfSquigglyAnnotation);
197197
break;
198198
}
199199

@@ -210,8 +210,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
210210
pdfCircleAnnotation.SetRectangleDifferences(XfdfObjectUtils.ConvertFringeFromString(annotObject.GetAttributeValue
211211
(XfdfConstants.FRINGE)));
212212
}
213-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
214-
(pdfCircleAnnotation);
213+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
214+
)).AddAnnotation(pdfCircleAnnotation);
215215
break;
216216
}
217217

@@ -224,8 +224,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
224224
pdfSquareAnnotation.SetRectangleDifferences(XfdfObjectUtils.ConvertFringeFromString(annotObject.GetAttributeValue
225225
(XfdfConstants.FRINGE)));
226226
}
227-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
228-
(pdfSquareAnnotation);
227+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
228+
)).AddAnnotation(pdfSquareAnnotation);
229229
break;
230230
}
231231

@@ -236,8 +236,8 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
236236
PdfPolyGeomAnnotation polygonAnnotation = PdfPolyGeomAnnotation.CreatePolygon(rect, vertices);
237237
AddCommonAnnotationAttributes(polygonAnnotation, annotObject);
238238
AddMarkupAnnotationAttributes(polygonAnnotation, annotObject);
239-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
240-
(polygonAnnotation);
239+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
240+
)).AddAnnotation(polygonAnnotation);
241241
break;
242242
}
243243

@@ -249,23 +249,23 @@ private void AddAnnotationToPdf(AnnotObject annotObject, PdfDocument pdfDocument
249249
);
250250
AddCommonAnnotationAttributes(polylineAnnotation, annotObject);
251251
AddMarkupAnnotationAttributes(polylineAnnotation, annotObject);
252-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
253-
(polylineAnnotation);
252+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
253+
)).AddAnnotation(polylineAnnotation);
254254
break;
255255
}
256256

257257
case XfdfConstants.STAMP: {
258-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
259-
(new PdfStampAnnotation(XfdfObjectUtils.ConvertRectFromString(annotObject.GetAttributeValue(XfdfConstants
260-
.RECT))));
258+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
259+
)).AddAnnotation(new PdfStampAnnotation(XfdfObjectUtils.ConvertRectFromString(annotObject.GetAttributeValue
260+
(XfdfConstants.RECT))));
261261
break;
262262
}
263263

264264
case XfdfConstants.FREETEXT: {
265265
//XfdfConstants.INK
266-
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue())).AddAnnotation
267-
(new PdfFreeTextAnnotation(XfdfObjectUtils.ConvertRectFromString(annotObject.GetAttributeValue(XfdfConstants
268-
.RECT)), annotObject.GetContents()));
266+
pdfDocument.GetPage(Convert.ToInt32(annotObject.GetAttribute(XfdfConstants.PAGE).GetValue(), System.Globalization.CultureInfo.InvariantCulture
267+
)).AddAnnotation(new PdfFreeTextAnnotation(XfdfObjectUtils.ConvertRectFromString(annotObject.GetAttributeValue
268+
(XfdfConstants.RECT)), annotObject.GetContents()));
269269
break;
270270
}
271271

itext/itext.io/itext/io/font/CidFont.cs

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,18 +112,24 @@ private void InitializeCidFontNameAndStyle(String fontName) {
112112

113113
private void InitializeCidFontProperties(IDictionary<String, Object> fontDesc) {
114114
fontIdentification.SetPanose((String)fontDesc.Get("Panose"));
115-
fontMetrics.SetItalicAngle(Convert.ToInt32((String)fontDesc.Get("ItalicAngle")));
116-
fontMetrics.SetCapHeight(Convert.ToInt32((String)fontDesc.Get("CapHeight")));
117-
fontMetrics.SetTypoAscender(Convert.ToInt32((String)fontDesc.Get("Ascent")));
118-
fontMetrics.SetTypoDescender(Convert.ToInt32((String)fontDesc.Get("Descent")));
119-
fontMetrics.SetStemV(Convert.ToInt32((String)fontDesc.Get("StemV")));
120-
pdfFontFlags = Convert.ToInt32((String)fontDesc.Get("Flags"));
115+
fontMetrics.SetItalicAngle(Convert.ToInt32((String)fontDesc.Get("ItalicAngle"), System.Globalization.CultureInfo.InvariantCulture
116+
));
117+
fontMetrics.SetCapHeight(Convert.ToInt32((String)fontDesc.Get("CapHeight"), System.Globalization.CultureInfo.InvariantCulture
118+
));
119+
fontMetrics.SetTypoAscender(Convert.ToInt32((String)fontDesc.Get("Ascent"), System.Globalization.CultureInfo.InvariantCulture
120+
));
121+
fontMetrics.SetTypoDescender(Convert.ToInt32((String)fontDesc.Get("Descent"), System.Globalization.CultureInfo.InvariantCulture
122+
));
123+
fontMetrics.SetStemV(Convert.ToInt32((String)fontDesc.Get("StemV"), System.Globalization.CultureInfo.InvariantCulture
124+
));
125+
pdfFontFlags = Convert.ToInt32((String)fontDesc.Get("Flags"), System.Globalization.CultureInfo.InvariantCulture
126+
);
121127
String fontBBox = (String)fontDesc.Get("FontBBox");
122128
StringTokenizer tk = new StringTokenizer(fontBBox, " []\r\n\t\f");
123-
int llx = Convert.ToInt32(tk.NextToken());
124-
int lly = Convert.ToInt32(tk.NextToken());
125-
int urx = Convert.ToInt32(tk.NextToken());
126-
int ury = Convert.ToInt32(tk.NextToken());
129+
int llx = Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
130+
int lly = Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
131+
int urx = Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
132+
int ury = Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
127133
fontMetrics.UpdateBbox(llx, lly, urx, ury);
128134
registry = (String)fontDesc.Get("Registry");
129135
String uniMap = GetCompatibleUniMap(registry);

itext/itext.io/itext/io/font/CidFontProperties.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,8 @@ private static IntHashtable CreateMetric(String s) {
152152
IntHashtable h = new IntHashtable();
153153
StringTokenizer tk = new StringTokenizer(s);
154154
while (tk.HasMoreTokens()) {
155-
int n1 = Convert.ToInt32(tk.NextToken());
156-
h.Put(n1, Convert.ToInt32(tk.NextToken()));
155+
int n1 = Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
156+
h.Put(n1, Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture));
157157
}
158158
return h;
159159
}

itext/itext.io/itext/io/font/FontCache.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,8 +255,8 @@ private static IntHashtable CreateMetric(String s) {
255255
IntHashtable h = new IntHashtable();
256256
StringTokenizer tk = new StringTokenizer(s);
257257
while (tk.HasMoreTokens()) {
258-
int n1 = Convert.ToInt32(tk.NextToken());
259-
h.Put(n1, Convert.ToInt32(tk.NextToken()));
258+
int n1 = Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
259+
h.Put(n1, Convert.ToInt32(tk.NextToken(), System.Globalization.CultureInfo.InvariantCulture));
260260
}
261261
return h;
262262
}

itext/itext.io/itext/io/font/FontEncoding.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ protected internal virtual void FillCustomEncoding() {
284284
orderK = order[1];
285285
}
286286
else {
287-
orderK = Convert.ToInt32(order);
287+
orderK = Convert.ToInt32(order, System.Globalization.CultureInfo.InvariantCulture);
288288
}
289289
orderK %= 256;
290290
unicodeToCode.Put(uni, orderK);
@@ -296,7 +296,7 @@ protected internal virtual void FillCustomEncoding() {
296296
else {
297297
int k = 0;
298298
if (tok.HasMoreTokens()) {
299-
k = Convert.ToInt32(tok.NextToken());
299+
k = Convert.ToInt32(tok.NextToken(), System.Globalization.CultureInfo.InvariantCulture);
300300
}
301301
while (tok.HasMoreTokens() && k < 256) {
302302
String hex = tok.NextToken();

itext/itext.io/itext/io/font/FontProgramDescriptorFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,8 @@ private static FontProgramDescriptor FetchTTCDescriptor(String baseName) {
152152
// count(.ttc) = 4
153153
ttcName = baseName.JSubstring(0, ttcSplit + 4);
154154
// count(.ttc,) = 5)
155-
ttcIndex = Convert.ToInt32(baseName.Substring(ttcSplit + 5));
155+
ttcIndex = Convert.ToInt32(baseName.Substring(ttcSplit + 5), System.Globalization.CultureInfo.InvariantCulture
156+
);
156157
}
157158
catch (FormatException nfe) {
158159
throw new iText.IO.IOException(nfe.Message, nfe);

itext/itext.io/itext/io/font/FontProgramFactory.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ private static FontProgram CreateFont(String name, byte[] fontProgram, bool cach
251251
// count(.ttc) = 4
252252
String ttcName = baseName.JSubstring(0, ttcSplit + 4);
253253
// count(.ttc,) = 5)
254-
int ttcIndex = Convert.ToInt32(baseName.Substring(ttcSplit + 5));
254+
int ttcIndex = Convert.ToInt32(baseName.Substring(ttcSplit + 5), System.Globalization.CultureInfo.InvariantCulture
255+
);
255256
fontBuilt = new TrueTypeFont(ttcName, ttcIndex);
256257
}
257258
catch (FormatException nfe) {

0 commit comments

Comments
 (0)