Version 4.0.2.1, tag libreoffice-4.0.2.1
[LibreOffice.git] / libwps / libwps.msvc.warnings.patch
blob5d41d5e793ec32a1f26bd8d60ed0303f04ad136a
1 fix MSVC warnings:
3 * various C4946 reinterpret_cast between related classes
4 * silly C4305 truncation from double to float
5 * C4806: no value of type 'bool' promoted to type 'int'
6 can equal the given constant (real bug?)
7 * C4701: pot. uninitialized variable 'ucs4Character'
9 diff -ru wps.old/src/lib/WPS4.cpp wps/src/lib/WPS4.cpp
10 --- wps.old/src/lib/WPS4.cpp 2012-05-31 14:14:13.000000000 +0200
11 +++ wps/src/lib/WPS4.cpp 2012-10-29 14:13:08.241600000 +0100
12 @@ -116,7 +116,7 @@
13 return;
16 - WPS4Parser *mnParser = reinterpret_cast<WPS4Parser *>(m_parser);
17 + WPS4Parser *mnParser = dynamic_cast<WPS4Parser *>(m_parser);
18 mnParser->send(m_entry, subDocumentType);
21 diff -ru wps.old/src/lib/WPS4Text.cpp wps/src/lib/WPS4Text.cpp
22 --- wps.old/src/lib/WPS4Text.cpp 2012-05-31 14:14:13.000000000 +0200
23 +++ wps/src/lib/WPS4Text.cpp 2012-10-29 14:22:16.004400000 +0100
24 @@ -212,7 +212,7 @@
25 //! operator<< for font properties
26 std::ostream &operator<<(std::ostream &o, Font const &ft)
28 - o << reinterpret_cast<WPSFont const &>(ft) << ",";
29 + o << dynamic_cast<WPSFont const &>(ft) << ",";
31 if (ft.m_special)
33 @@ -822,7 +822,7 @@
34 WPSEntry ent = m_state->m_dosLinkList[id].m_pos;
35 ent.setType("TEXT");
36 ent.setId(WPS4TextInternal::Z_DLink);
37 - WPSPosition pos_(Vec2f(),Vec2f(3.0,0.2));
38 + WPSPosition pos_(Vec2f(),Vec2f(3.0f,0.2f));
39 pos_.setRelativePosition(WPSPosition::Paragraph, WPSPosition::XCenter);
40 pos_.m_wrapping = WPSPosition::WNone;
41 WPXPropertyList extras;
42 @@ -1729,7 +1729,7 @@
43 int underlinePos = libwps::readU8(m_input);
44 if (underlinePos)
46 - if (!what & 0x20) f << "undFl,";
47 + if (!(what & 0x20)) f << "undFl,";
48 what &= 0xdf;
49 attributes |= WPS_UNDERLINE_BIT;
51 diff -ru wps.old/src/lib/WPS8.cpp wps/src/lib/WPS8.cpp
52 --- wps.old/src/lib/WPS8.cpp 2012-05-31 14:14:13.000000000 +0200
53 +++ wps/src/lib/WPS8.cpp 2012-10-29 14:19:31.206000000 +0100
54 @@ -94,7 +94,7 @@
57 long actPos = m_input->tell();
58 - WPS8Parser *mnParser = reinterpret_cast<WPS8Parser *>(m_parser);
59 + WPS8Parser *mnParser = dynamic_cast<WPS8Parser *>(m_parser);
60 if (type == libwps::DOC_NOTE)
61 mnParser->sendNote(m_input, m_id, m_type == Endnote);
62 else
63 @@ -337,7 +337,7 @@
64 uint16_t high_surrogate = 0;
65 bool fail = false;
66 uint16_t readVal;
67 - uint32_t ucs4Character;
68 + uint32_t ucs4Character(0);
69 while (true)
71 if (input->atEOS())