summaryrefslogtreecommitdiff
path: root/external/libmwaw/0001-fix-build-with-MSVC.patch.1
blob: ab6035811ce52dc5c3144fe2d9c223332d388c7e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
From ae8f006018f6cfc79b86f327116f6ceed71692f9 Mon Sep 17 00:00:00 2001
From: David Tardon <dtardon@redhat.com>
Date: Wed, 23 Nov 2016 09:06:35 +0100
Subject: [PATCH] fix build with MSVC

---
 src/lib/PowerPoint3Parser.cxx | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/src/lib/PowerPoint3Parser.cxx b/src/lib/PowerPoint3Parser.cxx
index 9ecbe1b..51348d6 100644
--- a/src/lib/PowerPoint3Parser.cxx
+++ b/src/lib/PowerPoint3Parser.cxx
@@ -1076,15 +1076,15 @@ bool PowerPoint3Parser::readDocInfo(MWAWEntry const &entry)
   f << "],";
   for (int i=0; i<4; ++i) dim[i]=int(input->readLong(2));
   if (!m_state->m_isMacFile) {
-    std::swap<int>(dim[0],dim[1]);
-    std::swap<int>(dim[2],dim[3]);
+    std::swap(dim[0],dim[1]);
+    std::swap(dim[2],dim[3]);
   }
   MWAWBox2i pageBox(MWAWVec2i(dim[1],dim[0]),MWAWVec2i(dim[3],dim[2]));
   f << "dim[page]=" << pageBox << ",";
   for (int i=0; i<4; ++i) dim[i]=int(input->readLong(2));
   if (!m_state->m_isMacFile) {
-    std::swap<int>(dim[0],dim[1]);
-    std::swap<int>(dim[2],dim[3]);
+    std::swap(dim[0],dim[1]);
+    std::swap(dim[2],dim[3]);
   }
   MWAWBox2i paperBox=MWAWBox2i(MWAWVec2i(dim[0],dim[1]),MWAWVec2i(dim[2],dim[3]));
   f << "dim[paper]=" << paperBox << ",";
@@ -1673,16 +1673,16 @@ bool PowerPoint3Parser::readSlideFormats(MWAWEntry const &entry, std::vector<Pow
     if (val) f << "id=" << std::hex << val << std::dec << ",";
     int dim[2];
     for (int j=0; j<2; ++j) dim[j]=int(input->readLong(2));
-    if (!isMacFile) std::swap<int>(dim[0],dim[1]);
+    if (!isMacFile) std::swap(dim[0],dim[1]);
     f << "dim0=" << MWAWVec2i(dim[1], dim[0]) << ",";
     format.m_gradientOffset=int(input->readLong(2));
     if (format.m_gradientOffset) f << "grad[col,offset]=" << format.m_gradientOffset << ",";
     for (int j=0; j<2; ++j) dim[j]=int(input->readLong(2));
-    if (!isMacFile) std::swap<int>(dim[0],dim[1]);
+    if (!isMacFile) std::swap(dim[0],dim[1]);
     format.m_margins=MWAWVec2i(dim[1], dim[0]);
     f << "box[margins]=" << format.m_margins << ",";
     for (int j=0; j<2; ++j) dim[j]=int(input->readLong(2));
-    if (!isMacFile) std::swap<int>(dim[0],dim[1]);
+    if (!isMacFile) std::swap(dim[0],dim[1]);
     format.m_shadowOffset=MWAWVec2i(dim[1], dim[0]);
     if (format.m_shadowOffset!=MWAWVec2i(0,0))
       f << "shadow[offset]=" << format.m_shadowOffset << ",";
@@ -1727,15 +1727,15 @@ bool PowerPoint3Parser::readSlidePolygons(MWAWEntry const &entry, std::vector<Po
     int dim[4];
     for (int i=0; i<4; ++i) dim[i]=int(input->readLong(2));
     if (!isMacFile) {
-      std::swap<int>(dim[0],dim[1]);
-      std::swap<int>(dim[2],dim[3]);
+      std::swap(dim[0],dim[1]);
+      std::swap(dim[2],dim[3]);
     }
     poly.m_box=MWAWBox2i(MWAWVec2i(dim[1],dim[0]), MWAWVec2i(dim[3],dim[2]));
     f << "box=" << poly.m_box << ",";
     f << "pts=[";
     for (int pt=0; pt<N; ++pt) {
       for (int i=0; i<2; ++i) dim[i]=int(input->readLong(2));
-      if (!isMacFile) std::swap<int>(dim[0],dim[1]);
+      if (!isMacFile) std::swap(dim[0],dim[1]);
       poly.m_vertices.push_back(MWAWVec2f(float(dim[1])/8.f, float(dim[0])/8.f));
       f << poly.m_vertices.back() << ",";
     }
@@ -1918,8 +1918,8 @@ bool PowerPoint3Parser::readFramesList(MWAWEntry const &entry, PowerPoint3Parser
     int dim[4];
     for (int d=0; d<4; ++d) dim[d]=int(input->readLong(2));
     if (!isMacFile) {
-      std::swap<int>(dim[0],dim[1]);
-      std::swap<int>(dim[2],dim[3]);
+      std::swap(dim[0],dim[1]);
+      std::swap(dim[2],dim[3]);
     }
     frame.m_dimension=MWAWBox2i(MWAWVec2i(dim[1],dim[0]), MWAWVec2i(dim[3],dim[2]));
     f << "dim=" << frame.m_dimension << ",";
@@ -2233,8 +2233,8 @@ bool PowerPoint3Parser::readTextZone(MWAWEntry const &entry, PowerPoint3ParserIn
     int dim[4];
     for (int i=0; i<4; ++i) dim[i]=int(input->readLong(2));
     if (!isMacFile) {
-      std::swap<int>(dim[0],dim[1]);
-      std::swap<int>(dim[2],dim[3]);
+      std::swap(dim[0],dim[1]);
+      std::swap(dim[2],dim[3]);
     }
     tZone.m_box=MWAWBox2i(MWAWVec2i(dim[1],dim[0]),MWAWVec2i(dim[3],dim[2]));
     f << "dim=" << tZone.m_box << ",";
@@ -3544,7 +3544,7 @@ bool PowerPoint3Parser::sendFrame(PowerPoint3ParserInternal::Frame const &frame,
   case 3: {
     float angle[2] = { frame.m_angles[0], frame.m_angles[0]+frame.m_angles[1] };
     if (angle[1]<angle[0])
-      std::swap<float>(angle[0],angle[1]);
+      std::swap(angle[0],angle[1]);
     if (angle[1]>360) {
       int numLoop=int(angle[1]/360)-1;
       angle[0]-=float(numLoop*360);
-- 
2.9.3