Version 6.4.0.0.beta1, tag libreoffice-6.4.0.0.beta1
[LibreOffice.git] / external / libcdr / ubsan.patch
blob316c47a45ab9573f97914d66ace743d61192b4a7
1 --- src/lib/CDRPath.cpp
2 +++ src/lib/CDRPath.cpp
3 @@ -796,7 +796,7 @@ void CDRPath::writeOut(librevenge::RVNGString &path, librevenge::RVNGString &vie
6 width = qy - py;
7 - viewBox.sprintf("%i %i %i %i", 0, 0, (unsigned)(2540*(qx - px)), (unsigned)(2540*(qy - py)));
8 + viewBox.sprintf("%i %i %i %i", 0, 0, (int)(2540*(qx - px)), (int)(2540*(qy - py)));
10 for (unsigned i = 0; i < vec.count(); ++i)
12 @@ -804,38 +804,38 @@ void CDRPath::writeOut(librevenge::RVNGString &path, librevenge::RVNGString &vie
13 if (vec[i]["librevenge:path-action"]->getStr() == "M")
15 // 2540 is 2.54*1000, 2.54 in = 1 inch
16 - sElement.sprintf("M%i %i", (unsigned)((vec[i]["svg:x"]->getDouble()-px)*2540),
17 - (unsigned)((vec[i]["svg:y"]->getDouble()-py)*2540));
18 + sElement.sprintf("M%i %i", (int)((vec[i]["svg:x"]->getDouble()-px)*2540),
19 + (int)((vec[i]["svg:y"]->getDouble()-py)*2540));
20 path.append(sElement);
22 else if (vec[i]["librevenge:path-action"]->getStr() == "L")
24 - sElement.sprintf("L%i %i", (unsigned)((vec[i]["svg:x"]->getDouble()-px)*2540),
25 - (unsigned)((vec[i]["svg:y"]->getDouble()-py)*2540));
26 + sElement.sprintf("L%i %i", (int)((vec[i]["svg:x"]->getDouble()-px)*2540),
27 + (int)((vec[i]["svg:y"]->getDouble()-py)*2540));
28 path.append(sElement);
30 else if (vec[i]["librevenge:path-action"]->getStr() == "C")
32 - sElement.sprintf("C%i %i %i %i %i %i", (unsigned)((vec[i]["svg:x1"]->getDouble()-px)*2540),
33 - (unsigned)((vec[i]["svg:y1"]->getDouble()-py)*2540), (unsigned)((vec[i]["svg:x2"]->getDouble()-px)*2540),
34 - (unsigned)((vec[i]["svg:y2"]->getDouble()-py)*2540), (unsigned)((vec[i]["svg:x"]->getDouble()-px)*2540),
35 - (unsigned)((vec[i]["svg:y"]->getDouble()-py)*2540));
36 + sElement.sprintf("C%i %i %i %i %i %i", (int)((vec[i]["svg:x1"]->getDouble()-px)*2540),
37 + (int)((vec[i]["svg:y1"]->getDouble()-py)*2540), (int)((vec[i]["svg:x2"]->getDouble()-px)*2540),
38 + (int)((vec[i]["svg:y2"]->getDouble()-py)*2540), (int)((vec[i]["svg:x"]->getDouble()-px)*2540),
39 + (int)((vec[i]["svg:y"]->getDouble()-py)*2540));
40 path.append(sElement);
42 else if (vec[i]["librevenge:path-action"]->getStr() == "Q")
44 - sElement.sprintf("Q%i %i %i %i", (unsigned)((vec[i]["svg:x1"]->getDouble()-px)*2540),
45 - (unsigned)((vec[i]["svg:y1"]->getDouble()-py)*2540), (unsigned)((vec[i]["svg:x"]->getDouble()-px)*2540),
46 - (unsigned)((vec[i]["svg:y"]->getDouble()-py)*2540));
47 + sElement.sprintf("Q%i %i %i %i", (int)((vec[i]["svg:x1"]->getDouble()-px)*2540),
48 + (int)((vec[i]["svg:y1"]->getDouble()-py)*2540), (int)((vec[i]["svg:x"]->getDouble()-px)*2540),
49 + (int)((vec[i]["svg:y"]->getDouble()-py)*2540));
50 path.append(sElement);
52 else if (vec[i]["librevenge:path-action"]->getStr() == "A")
54 - sElement.sprintf("A%i %i %i %i %i %i %i", (unsigned)((vec[i]["svg:rx"]->getDouble())*2540),
55 - (unsigned)((vec[i]["svg:ry"]->getDouble())*2540), (vec[i]["librevenge:rotate"] ? vec[i]["librevenge:rotate"]->getInt() : 0),
56 + sElement.sprintf("A%i %i %i %i %i %i %i", (int)((vec[i]["svg:rx"]->getDouble())*2540),
57 + (int)((vec[i]["svg:ry"]->getDouble())*2540), (vec[i]["librevenge:rotate"] ? vec[i]["librevenge:rotate"]->getInt() : 0),
58 (vec[i]["librevenge:large-arc"] ? vec[i]["librevenge:large-arc"]->getInt() : 1),
59 (vec[i]["librevenge:sweep"] ? vec[i]["librevenge:sweep"]->getInt() : 1),
60 - (unsigned)((vec[i]["svg:x"]->getDouble()-px)*2540), (unsigned)((vec[i]["svg:y"]->getDouble()-py)*2540));
61 + (int)((vec[i]["svg:x"]->getDouble()-px)*2540), (int)((vec[i]["svg:y"]->getDouble()-py)*2540));
62 path.append(sElement);
64 else if (vec[i]["librevenge:path-action"]->getStr() == "Z")