diff options
Diffstat (limited to 'external/libmwaw/0001-fix-build-with-msvc.patch.1')
-rw-r--r-- | external/libmwaw/0001-fix-build-with-msvc.patch.1 | 148 |
1 files changed, 100 insertions, 48 deletions
diff --git a/external/libmwaw/0001-fix-build-with-msvc.patch.1 b/external/libmwaw/0001-fix-build-with-msvc.patch.1 index 95b5e0cbeb0b..ab6035811ce5 100644 --- a/external/libmwaw/0001-fix-build-with-msvc.patch.1 +++ b/external/libmwaw/0001-fix-build-with-msvc.patch.1 @@ -1,54 +1,106 @@ -From 01495bf788fe32723f222599e34ba1779ca3d594 Mon Sep 17 00:00:00 2001 +From ae8f006018f6cfc79b86f327116f6ceed71692f9 Mon Sep 17 00:00:00 2001 From: David Tardon <dtardon@redhat.com> -Date: Fri, 24 Jun 2016 14:01:14 +0200 -Subject: [PATCH] fix build with msvc +Date: Wed, 23 Nov 2016 09:06:35 +0100 +Subject: [PATCH] fix build with MSVC --- - src/lib/CricketDrawParser.cxx | 4 ++-- - src/lib/FreeHandParser.cxx | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) + src/lib/PowerPoint3Parser.cxx | 30 +++++++++++++++--------------- + 1 file changed, 15 insertions(+), 15 deletions(-) -diff --git a/src/lib/CricketDrawParser.cxx b/src/lib/CricketDrawParser.cxx -index f04be91..9fe5a32 100644 ---- a/src/lib/CricketDrawParser.cxx -+++ b/src/lib/CricketDrawParser.cxx -@@ -930,12 +930,12 @@ bool CricketDrawParser::readShape() - MWAWBox2f box(shape.m_vertices[0], shape.m_vertices[2]); - int angle[2] = { shape.m_angles[0], shape.m_angles[1] }; - if (box.min()[1]>box.max()[1]) { -- std::swap<float>(box.min()[1],box.max()[1]); -+ std::swap(box.min()[1],box.max()[1]); - angle[0]=180-shape.m_angles[1]; - angle[1]=180-shape.m_angles[0]; - } - if (angle[1]<=angle[0]) -- std::swap<int>(angle[0],angle[1]); -+ std::swap(angle[0],angle[1]); - if (angle[1]>360) { - int numLoop=int(angle[1]/360)-1; - angle[0]-=numLoop*360; -diff --git a/src/lib/FreeHandParser.cxx b/src/lib/FreeHandParser.cxx -index 78d8b08..e97e6e3 100644 ---- a/src/lib/FreeHandParser.cxx -+++ b/src/lib/FreeHandParser.cxx -@@ -999,7 +999,7 @@ bool FreeHandParser::checkHeader(MWAWHeader *header, bool strict) - getPageSpan().setFormOrientation(MWAWPageSpan::LANDSCAPE); - for (int j=0; j<4; ++j) { - if (j==1) continue; -- std::swap<float>(dim[2*j],dim[2*j+1]); -+ std::swap(dim[2*j],dim[2*j+1]); - } - val &= 0xFFDF; - } -@@ -1016,7 +1016,7 @@ bool FreeHandParser::checkHeader(MWAWHeader *header, bool strict) - f << "landscape,"; - getPageSpan().setFormOrientation(MWAWPageSpan::LANDSCAPE); - for (int j=0; j<4; ++j) -- std::swap<float>(dim[2*j],dim[2*j+1]); -+ std::swap(dim[2*j],dim[2*j+1]); - } - if (val&2) f << "crop[mark],"; - if (val&4) f << "center[mark],"; +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.7.4 +2.9.3 |