diff options
author | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-09-16 11:00:45 +0200 |
---|---|---|
committer | Fridrich Štrba <fridrich.strba@bluewin.ch> | 2011-09-16 11:00:45 +0200 |
commit | 85a0bb2e54df2a6be8bc21f6c5bb74a1898d40e4 (patch) | |
tree | 0648c8934fb874b1b03b93d1769cdf97fe33e023 /src/lib | |
parent | 98cdde3823742e6e31032b7d989af21ee6416f4f (diff) |
Trying to make a bit order with integer types' width
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/VSD11Parser.cpp | 8 | ||||
-rw-r--r-- | src/lib/VSD6Parser.cpp | 8 | ||||
-rw-r--r-- | src/lib/VSDXCollector.h | 6 | ||||
-rw-r--r-- | src/lib/VSDXContentCollector.cpp | 16 | ||||
-rw-r--r-- | src/lib/VSDXContentCollector.h | 8 | ||||
-rw-r--r-- | src/lib/VSDXGeometryList.cpp | 4 | ||||
-rw-r--r-- | src/lib/VSDXGeometryList.h | 2 | ||||
-rw-r--r-- | src/lib/VSDXParser.cpp | 90 | ||||
-rw-r--r-- | src/lib/VSDXParser.h | 2 | ||||
-rw-r--r-- | src/lib/VSDXStyles.h | 18 | ||||
-rw-r--r-- | src/lib/VSDXStylesCollector.cpp | 6 | ||||
-rw-r--r-- | src/lib/VSDXStylesCollector.h | 6 | ||||
-rw-r--r-- | src/lib/VSDXTypes.h | 8 | ||||
-rw-r--r-- | src/lib/libvisio_utils.h | 2 |
14 files changed, 92 insertions, 92 deletions
diff --git a/src/lib/VSD11Parser.cpp b/src/lib/VSD11Parser.cpp index 1ee0df0..f791d64 100644 --- a/src/lib/VSD11Parser.cpp +++ b/src/lib/VSD11Parser.cpp @@ -159,10 +159,10 @@ void libvisio::VSD11Parser::readFillAndShadow(WPXInputStream *input) { unsigned char colourIndexFG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillFGTransparency = readU8(input); + unsigned char fillFGTransparency = readU8(input); unsigned char colourIndexBG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillBGTransparency = readU8(input); + unsigned char fillBGTransparency = readU8(input); unsigned char fillPattern = readU8(input); input->seek(1, WPX_SEEK_CUR); Colour shfgc; // Shadow Foreground Colour @@ -192,10 +192,10 @@ void libvisio::VSD11Parser::readFillStyle(WPXInputStream *input) { unsigned char colourIndexFG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillFGTransparency = readU8(input); + unsigned char fillFGTransparency = readU8(input); unsigned char colourIndexBG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillBGTransparency = readU8(input); + unsigned char fillBGTransparency = readU8(input); unsigned char fillPattern = readU8(input); input->seek(1, WPX_SEEK_CUR); Colour shfgc; // Shadow Foreground Colour diff --git a/src/lib/VSD6Parser.cpp b/src/lib/VSD6Parser.cpp index e52ddb7..d280ca6 100644 --- a/src/lib/VSD6Parser.cpp +++ b/src/lib/VSD6Parser.cpp @@ -141,10 +141,10 @@ void libvisio::VSD6Parser::readFillAndShadow(WPXInputStream *input) { unsigned char colourIndexFG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillFGTransparency = readU8(input); + unsigned char fillFGTransparency = readU8(input); unsigned char colourIndexBG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillBGTransparency = readU8(input); + unsigned char fillBGTransparency = readU8(input); unsigned char fillPattern = readU8(input); input->seek(1, WPX_SEEK_CUR); Colour shfgc; // Shadow Foreground Colour @@ -167,10 +167,10 @@ void libvisio::VSD6Parser::readFillStyle(WPXInputStream *input) { unsigned char colourIndexFG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillFGTransparency = readU8(input); + unsigned char fillFGTransparency = readU8(input); unsigned char colourIndexBG = readU8(input); input->seek(3, WPX_SEEK_CUR); - unsigned int fillBGTransparency = readU8(input); + unsigned char fillBGTransparency = readU8(input); unsigned char fillPattern = readU8(input); input->seek(1, WPX_SEEK_CUR); Colour shfgc; // Shadow Foreground Colour diff --git a/src/lib/VSDXCollector.h b/src/lib/VSDXCollector.h index 73cb1a4..09cd3ef 100644 --- a/src/lib/VSDXCollector.h +++ b/src/lib/VSDXCollector.h @@ -48,7 +48,7 @@ public: virtual void collectFillAndShadow(unsigned id, unsigned level, unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY) = 0; virtual void collectFillAndShadow(unsigned id, unsigned level, unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned shadowPattern, Colour shfgc) = 0; virtual void collectGeomList(unsigned id, unsigned level) = 0; - virtual void collectGeometry(unsigned id, unsigned level, unsigned geomFlags) = 0; + virtual void collectGeometry(unsigned id, unsigned level, unsigned char geomFlags) = 0; virtual void collectMoveTo(unsigned id, unsigned level, double x, double y) = 0; virtual void collectLineTo(unsigned id, unsigned level, double x, double y) = 0; virtual void collectArcTo(unsigned id, unsigned level, double x2, double y2, double bow) = 0; @@ -83,8 +83,8 @@ public: // Style collectors virtual void collectStyleSheet(unsigned id, unsigned level, unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle) = 0; virtual void collectLineStyle(unsigned id, unsigned level, double strokeWidth, Colour c, unsigned char linePattern, unsigned char lineCap) = 0; - virtual void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY) = 0; - virtual void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc) = 0; + virtual void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY) = 0; + virtual void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc) = 0; virtual void collectCharIXStyle(unsigned id , unsigned level, unsigned charCount, unsigned short fontID, Colour fontColour, unsigned langId, double fontSize, bool bold, bool italic, bool underline, bool doubleunderline, bool strikeout, bool doublestrikeout, bool allcaps, bool initcaps, bool smallcaps, bool superscript, bool subscript, WPXString fontFace) = 0; diff --git a/src/lib/VSDXContentCollector.cpp b/src/lib/VSDXContentCollector.cpp index aa46a00..44f8e7c 100644 --- a/src/lib/VSDXContentCollector.cpp +++ b/src/lib/VSDXContentCollector.cpp @@ -166,9 +166,9 @@ void libvisio::VSDXContentCollector::_flushText() for (unsigned j = 0; j < max; j++) { if (m_textStream[j] <= 0x20) - _appendUCS4(text, (unsigned int) 0x20); + _appendUCS4(text, (unsigned) 0x20); else - _appendUCS4(text, (unsigned int) m_textStream[j]); + _appendUCS4(text, (unsigned) m_textStream[j]); } m_textStream.erase(m_textStream.begin(), m_textStream.begin() + max); @@ -690,7 +690,7 @@ void libvisio::VSDXContentCollector::collectCharList(unsigned /* id */, unsigned _handleLevelChange(level); } -void libvisio::VSDXContentCollector::collectGeometry(unsigned /* id */, unsigned level, unsigned geomFlags) +void libvisio::VSDXContentCollector::collectGeometry(unsigned /* id */, unsigned level, unsigned char geomFlags) { _handleLevelChange(level); m_x = 0.0; m_y = 0.0; @@ -1238,9 +1238,9 @@ void libvisio::VSDXContentCollector::collectFont(unsigned short fontID, const st for (unsigned i = 0; i < textStream.size(); i++) { if (textStream[i] <= 0x20) - _appendUCS4(fontname, (unsigned int) 0x20); + _appendUCS4(fontname, (unsigned) 0x20); else - _appendUCS4(fontname, (unsigned int) textStream[i]); + _appendUCS4(fontname, (unsigned) textStream[i]); } } else if (format == VSD_TEXT_UTF16) @@ -1320,12 +1320,12 @@ void libvisio::VSDXContentCollector::collectLineStyle(unsigned /* id */, unsigne _handleLevelChange(level); } -void libvisio::VSDXContentCollector::collectFillStyle(unsigned /*id*/, unsigned level, unsigned char /*colourIndexFG*/, unsigned char /*colourIndexBG*/, unsigned char /*fillPattern*/, unsigned /*fillFGTransparency*/, unsigned /*fillBGTransparency*/, unsigned char /*shadowPattern*/, Colour /*shfgc*/, double /*shadowOffsetX*/, double /*shadowOffsetY*/) +void libvisio::VSDXContentCollector::collectFillStyle(unsigned /*id*/, unsigned level, unsigned char /*colourIndexFG*/, unsigned char /*colourIndexBG*/, unsigned char /*fillPattern*/, unsigned char /*fillFGTransparency*/, unsigned char /*fillBGTransparency*/, unsigned char /*shadowPattern*/, Colour /*shfgc*/, double /*shadowOffsetX*/, double /*shadowOffsetY*/) { _handleLevelChange(level); } -void libvisio::VSDXContentCollector::collectFillStyle(unsigned /*id*/, unsigned level, unsigned char /*colourIndexFG*/, unsigned char /*colourIndexBG*/, unsigned char /*fillPattern*/, unsigned /*fillFGTransparency*/, unsigned /*fillBGTransparency*/, unsigned char /*shadowPattern*/, Colour /*shfgc*/) +void libvisio::VSDXContentCollector::collectFillStyle(unsigned /*id*/, unsigned level, unsigned char /*colourIndexFG*/, unsigned char /*colourIndexBG*/, unsigned char /*fillPattern*/, unsigned char /*fillFGTransparency*/, unsigned char /*fillBGTransparency*/, unsigned char /*shadowPattern*/, Colour /*shfgc*/) { _handleLevelChange(level); } @@ -1736,7 +1736,7 @@ void libvisio::VSDXContentCollector::_appendUTF16LE(WPXString &text, WPXInputStr } } -void libvisio::VSDXContentCollector::_appendUCS4(WPXString &text, unsigned int ucs4Character) +void libvisio::VSDXContentCollector::_appendUCS4(WPXString &text, unsigned ucs4Character) { unsigned char first; int len; diff --git a/src/lib/VSDXContentCollector.h b/src/lib/VSDXContentCollector.h index 5a6531d..abc334e 100644 --- a/src/lib/VSDXContentCollector.h +++ b/src/lib/VSDXContentCollector.h @@ -66,7 +66,7 @@ public: void collectFillAndShadow(unsigned id, unsigned level, unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY); void collectFillAndShadow(unsigned id, unsigned level, unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned shadowPattern, Colour shfgc); void collectGeomList(unsigned id, unsigned level); - void collectGeometry(unsigned id, unsigned level, unsigned geomFlags); + void collectGeometry(unsigned id, unsigned level, unsigned char geomFlags); void collectMoveTo(unsigned id, unsigned level, double x, double y); void collectLineTo(unsigned id, unsigned level, double x, double y); void collectArcTo(unsigned id, unsigned level, double x2, double y2, double bow); @@ -101,8 +101,8 @@ public: // Style collectors void collectStyleSheet(unsigned id, unsigned level, unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle); void collectLineStyle(unsigned id, unsigned level, double strokeWidth, Colour c, unsigned char linePattern, unsigned char lineCap); - void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY); - void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc); + void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY); + void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc); void collectCharIXStyle(unsigned id , unsigned level, unsigned charCount, unsigned short fontID, Colour fontColour, unsigned langId, double fontSize, bool bold, bool italic, bool underline, bool doubleunderline, bool strikeout, bool doublestrikeout, bool allcaps, bool initcaps, bool smallcaps, bool superscript, bool subscript, WPXString fontFace); @@ -129,7 +129,7 @@ private: void _handleLevelChange(unsigned level); void _appendUTF16LE(WPXString &text, WPXInputStream *input); - void _appendUCS4(WPXString &text, unsigned int ucs4Character); + void _appendUCS4(WPXString &text, unsigned ucs4Character); void _handleForeignData(const WPXBinaryData &data); diff --git a/src/lib/VSDXGeometryList.cpp b/src/lib/VSDXGeometryList.cpp index 04909a7..259e465 100644 --- a/src/lib/VSDXGeometryList.cpp +++ b/src/lib/VSDXGeometryList.cpp @@ -45,7 +45,7 @@ public: private: unsigned m_id; unsigned m_level; - unsigned m_geomFlags; + unsigned char m_geomFlags; }; class VSDXMoveTo : public VSDXGeometryListElement @@ -345,7 +345,7 @@ libvisio::VSDXGeometryList::~VSDXGeometryList() clear(); } -void libvisio::VSDXGeometryList::addGeometry(unsigned id, unsigned level, unsigned geomFlags) +void libvisio::VSDXGeometryList::addGeometry(unsigned id, unsigned level, unsigned char geomFlags) { m_elements[id] = new VSDXGeometry(id, level, geomFlags); } diff --git a/src/lib/VSDXGeometryList.h b/src/lib/VSDXGeometryList.h index f17d94d..a00af5d 100644 --- a/src/lib/VSDXGeometryList.h +++ b/src/lib/VSDXGeometryList.h @@ -46,7 +46,7 @@ public: ~VSDXGeometryList(); VSDXGeometryList &operator=(const VSDXGeometryList &geomList); - void addGeometry(unsigned id, unsigned level, unsigned geomFlags); + void addGeometry(unsigned id, unsigned level, unsigned char geomFlags); void addMoveTo(unsigned id, unsigned level, double x, double y); void addLineTo(unsigned id, unsigned level, double x, double y); void addArcTo(unsigned id, unsigned level, double x2, double y2, double bow); diff --git a/src/lib/VSDXParser.cpp b/src/lib/VSDXParser.cpp index 31b7f3a..32e10f4 100644 --- a/src/lib/VSDXParser.cpp +++ b/src/lib/VSDXParser.cpp @@ -77,8 +77,8 @@ bool libvisio::VSDXParser::parse() m_input->seek(0x24, WPX_SEEK_SET); m_input->seek(8, WPX_SEEK_CUR); - unsigned int offset = readU32(m_input); - unsigned int length = readU32(m_input); + unsigned offset = readU32(m_input); + unsigned length = readU32(m_input); unsigned short format = readU16(m_input); bool compressed = ((format & 2) == 2); @@ -106,12 +106,12 @@ bool libvisio::VSDXParser::parse() bool libvisio::VSDXParser::parseDocument(WPXInputStream *input) { - const unsigned int SHIFT = 4; + const unsigned SHIFT = 4; -// unsigned int ptrType; -// unsigned int ptrOffset; -// unsigned int ptrLength; -// unsigned int ptrFormat; +// unsigned ptrType; +// unsigned ptrOffset; +// unsigned ptrLength; +// unsigned ptrFormat; std::vector<libvisio::Pointer> PtrList; Pointer ptr; @@ -119,9 +119,9 @@ bool libvisio::VSDXParser::parseDocument(WPXInputStream *input) input->seek(SHIFT, WPX_SEEK_SET); unsigned offset = readU32(input); input->seek(offset+SHIFT, WPX_SEEK_SET); - unsigned int pointerCount = readU32(input); + unsigned pointerCount = readU32(input); input->seek(SHIFT, WPX_SEEK_CUR); - for (unsigned int i = 0; i < pointerCount; i++) + for (unsigned i = 0; i < pointerCount; i++) { ptr.Type = readU32(input); input->seek(4, WPX_SEEK_CUR); // Skip dword @@ -135,7 +135,7 @@ bool libvisio::VSDXParser::parseDocument(WPXInputStream *input) else if (ptr.Type != 0) PtrList.push_back(ptr); } - for (unsigned int j = 0; j < PtrList.size(); j++) + for (unsigned j = 0; j < PtrList.size(); j++) { ptr = PtrList[j]; bool compressed = ((ptr.Format & 2) == 2); @@ -171,18 +171,18 @@ bool libvisio::VSDXParser::parseDocument(WPXInputStream *input) void libvisio::VSDXParser::handlePages(WPXInputStream *input, unsigned shift) { - unsigned int ptrType; - unsigned int ptrOffset; - unsigned int ptrLength; - unsigned int ptrFormat; + unsigned ptrType; + unsigned ptrOffset; + unsigned ptrLength; + unsigned ptrFormat; input->seek(shift, WPX_SEEK_CUR); - unsigned int offset = readU32(input); + unsigned offset = readU32(input); input->seek(offset+shift, WPX_SEEK_SET); - unsigned int pointerCount = readU32(input); + unsigned pointerCount = readU32(input); input->seek(4, WPX_SEEK_CUR); // Ignore 0x0 dword - for (unsigned int i = 0; i < pointerCount; i++) + for (unsigned i = 0; i < pointerCount; i++) { ptrType = readU32(input); input->seek(4, WPX_SEEK_CUR); // Skip dword @@ -260,17 +260,17 @@ void libvisio::VSDXParser::handleStencils(WPXInputStream *input, unsigned shift) { if (m_stencils.count() > 0) return; m_isStencilStarted = true; - unsigned int ptrType; - unsigned int ptrOffset; - unsigned int ptrLength; - unsigned int ptrFormat; + unsigned ptrType; + unsigned ptrOffset; + unsigned ptrLength; + unsigned ptrFormat; input->seek(shift, WPX_SEEK_CUR); - unsigned int offset = readU32(input); + unsigned offset = readU32(input); input->seek(offset+shift, WPX_SEEK_SET); - unsigned int pointerCount = readU32(input); + unsigned pointerCount = readU32(input); input->seek(4, WPX_SEEK_CUR); // Ignore 0x0 dword - for (unsigned int i = 0; i < pointerCount; i++) + for (unsigned i = 0; i < pointerCount; i++) { ptrType = readU32(input); input->seek(4, WPX_SEEK_CUR); // Skip dword @@ -302,18 +302,18 @@ void libvisio::VSDXParser::handleStencils(WPXInputStream *input, unsigned shift) void libvisio::VSDXParser::handleStencilPage(WPXInputStream *input, unsigned shift) { - unsigned int ptrType; - unsigned int ptrOffset; - unsigned int ptrLength; - unsigned int ptrFormat; + unsigned ptrType; + unsigned ptrOffset; + unsigned ptrLength; + unsigned ptrFormat; input->seek(shift, WPX_SEEK_CUR); - unsigned int offset = readU32(input); + unsigned offset = readU32(input); input->seek(offset+shift, WPX_SEEK_SET); - unsigned int pointerCount = readU32(input); + unsigned pointerCount = readU32(input); input->seek(4, WPX_SEEK_CUR); // Ignore 0x0 dword - for (unsigned int i = 0; i < pointerCount; i++) + for (unsigned i = 0; i < pointerCount; i++) { ptrType = readU32(input); input->seek(4, WPX_SEEK_CUR); // Skip dword @@ -349,18 +349,18 @@ void libvisio::VSDXParser::handleStencilPage(WPXInputStream *input, unsigned shi void libvisio::VSDXParser::handleStencilForeign(WPXInputStream *input, unsigned shift) { - unsigned int ptrType; - unsigned int ptrOffset; - unsigned int ptrLength; - unsigned int ptrFormat; + unsigned ptrType; + unsigned ptrOffset; + unsigned ptrLength; + unsigned ptrFormat; input->seek(shift, WPX_SEEK_CUR); - unsigned int offset = readU32(input); + unsigned offset = readU32(input); input->seek(offset+shift, WPX_SEEK_SET); - unsigned int pointerCount = readU32(input); + unsigned pointerCount = readU32(input); input->seek(4, WPX_SEEK_CUR); // Ignore 0x0 dword - for (unsigned int i = 0; i < pointerCount; i++) + for (unsigned i = 0; i < pointerCount; i++) { ptrType = readU32(input); input->seek(4, WPX_SEEK_CUR); // Skip dword @@ -383,7 +383,7 @@ void libvisio::VSDXParser::handleStencilForeign(WPXInputStream *input, unsigned unsigned pointerCount2 = readU32(&tmpInput); tmpInput.seek(4, WPX_SEEK_CUR); // Ignore 0x0 dword - for (unsigned int j = 0; j < pointerCount2; j++) + for (unsigned j = 0; j < pointerCount2; j++) { ptrType = readU32(&tmpInput); tmpInput.seek(4, WPX_SEEK_CUR); // Skip dword @@ -782,7 +782,7 @@ void libvisio::VSDXParser::readPage(WPXInputStream *input) void libvisio::VSDXParser::readGeometry(WPXInputStream *input) { - unsigned geomFlags = readU8(input); + unsigned char geomFlags = readU8(input); if (m_isStencilStarted) m_stencilShape.m_geometries.back().addGeometry(m_header.id, m_header.level, geomFlags); @@ -1341,14 +1341,14 @@ void libvisio::VSDXParser::readSplineKnot(WPXInputStream *input) void libvisio::VSDXParser::readColours(WPXInputStream *input) { input->seek(6, WPX_SEEK_SET); - unsigned int numColours = readU8(input); + unsigned numColours = readU8(input); Colour tmpColour; input->seek(1, WPX_SEEK_CUR); std::vector<Colour> colours; - for (unsigned int i = 0; i < numColours; i++) + for (unsigned i = 0; i < numColours; i++) { tmpColour.r = readU8(input); tmpColour.g = readU8(input); @@ -1360,12 +1360,12 @@ void libvisio::VSDXParser::readColours(WPXInputStream *input) m_collector->collectColours(colours); } -void libvisio::VSDXParser::readFont(WPXInputStream *input, unsigned int fontID) +void libvisio::VSDXParser::readFont(WPXInputStream *input, unsigned fontID) { input->seek(8, WPX_SEEK_CUR); std::vector<uint8_t> textStream; - for (unsigned int i = 0; i < 32; i++) + for (unsigned i = 0; i < 32; i++) { unsigned char curchar = readU8(input); unsigned char nextchar = readU8(input); @@ -1382,7 +1382,7 @@ void libvisio::VSDXParser::readFontIX(WPXInputStream *input) input->seek(6, WPX_SEEK_CUR); std::vector<uint8_t> textStream; - for (unsigned int i = 0; i < m_header.dataLength - 6; i++) + for (unsigned i = 0; i < m_header.dataLength - 6; i++) { unsigned char curchar = readU8(input); if (curchar == 0) diff --git a/src/lib/VSDXParser.h b/src/lib/VSDXParser.h index 8b96af2..6c0ebb9 100644 --- a/src/lib/VSDXParser.h +++ b/src/lib/VSDXParser.h @@ -78,7 +78,7 @@ protected: void readPageProps(WPXInputStream *input); void readShape(WPXInputStream *input); void readColours(WPXInputStream *input); - void readFont(WPXInputStream *input, unsigned int id); + void readFont(WPXInputStream *input, unsigned id); void readFontIX(WPXInputStream *input); void readCharList(WPXInputStream *input); void readPage(WPXInputStream *input); diff --git a/src/lib/VSDXStyles.h b/src/lib/VSDXStyles.h index ed80a41..5a80b4d 100644 --- a/src/lib/VSDXStyles.h +++ b/src/lib/VSDXStyles.h @@ -47,31 +47,31 @@ struct VSDXLineStyle ~VSDXLineStyle() {} double width; Colour colour; - unsigned short pattern; - unsigned short cap; + unsigned char pattern; + unsigned char cap; }; struct VSDXFillStyle { VSDXFillStyle(); - VSDXFillStyle(unsigned short fgcId, unsigned short bgcId, unsigned short p, unsigned fga, unsigned bga, Colour sfgc, unsigned short shp, double shX, double shY) + VSDXFillStyle(unsigned char fgcId, unsigned char bgcId, unsigned char p, unsigned char fga, unsigned char bga, Colour sfgc, unsigned char shp, double shX, double shY) : fgColourId(fgcId), bgColourId(bgcId), pattern(p), fgTransparency(fga), bgTransparency(bga), shadowFgColour(sfgc), shadowPattern(shp), shadowOffsetX(shX), shadowOffsetY(shY) {} VSDXFillStyle(const VSDXFillStyle &fillStyle) : fgColourId(fillStyle.fgColourId), bgColourId(fillStyle.bgColourId), pattern(fillStyle.pattern), fgTransparency(fillStyle.fgTransparency), bgTransparency(fillStyle.bgTransparency), shadowFgColour(fillStyle.shadowFgColour), shadowPattern(fillStyle.shadowPattern), shadowOffsetX(fillStyle.shadowOffsetX), shadowOffsetY(fillStyle.shadowOffsetY) {} ~VSDXFillStyle() {} - unsigned short fgColourId; + unsigned char fgColourId; // Colour fgColour; - unsigned short bgColourId; + unsigned char bgColourId; // Colour bgColour; - unsigned short pattern; + unsigned char pattern; - unsigned fgTransparency; - unsigned bgTransparency; + unsigned char fgTransparency; + unsigned char bgTransparency; Colour shadowFgColour; - unsigned short shadowPattern; + unsigned char shadowPattern; double shadowOffsetX; double shadowOffsetY; }; diff --git a/src/lib/VSDXStylesCollector.cpp b/src/lib/VSDXStylesCollector.cpp index 619335f..dff9d95 100644 --- a/src/lib/VSDXStylesCollector.cpp +++ b/src/lib/VSDXStylesCollector.cpp @@ -91,7 +91,7 @@ void libvisio::VSDXStylesCollector::collectCharList(unsigned /* id */, unsigned _handleLevelChange(level); } -void libvisio::VSDXStylesCollector::collectGeometry(unsigned /* id */, unsigned level, unsigned /* geomFlags */) +void libvisio::VSDXStylesCollector::collectGeometry(unsigned /* id */, unsigned level, unsigned char /* geomFlags */) { _handleLevelChange(level); } @@ -252,7 +252,7 @@ void libvisio::VSDXStylesCollector::collectLineStyle(unsigned /* id */, unsigned _handleLevelChange(level); } -void libvisio::VSDXStylesCollector::collectFillStyle(unsigned /*id*/, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY) +void libvisio::VSDXStylesCollector::collectFillStyle(unsigned /*id*/, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY) { if (m_fillStyle == 0) m_fillStyle = new VSDXFillStyle(); @@ -281,7 +281,7 @@ void libvisio::VSDXStylesCollector::collectCharIXStyle(unsigned /*id*/ , unsigne m_textStyle->format = f; } -void libvisio::VSDXStylesCollector::collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc) +void libvisio::VSDXStylesCollector::collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc) { collectFillStyle(id, level, colourIndexFG, colourIndexBG, fillPattern, fillFGTransparency, fillBGTransparency, shadowPattern, shfgc, m_shadowOffsetX, m_shadowOffsetY); } diff --git a/src/lib/VSDXStylesCollector.h b/src/lib/VSDXStylesCollector.h index 17b2651..d21d713 100644 --- a/src/lib/VSDXStylesCollector.h +++ b/src/lib/VSDXStylesCollector.h @@ -57,7 +57,7 @@ public: void collectFillAndShadow(unsigned id, unsigned level, unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY); void collectFillAndShadow(unsigned id, unsigned level, unsigned colourIndexFG, unsigned colourIndexBG, unsigned fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned shadowPattern, Colour shfgc); void collectGeomList(unsigned id, unsigned level); - void collectGeometry(unsigned id, unsigned level, unsigned geomFlags); + void collectGeometry(unsigned id, unsigned level, unsigned char geomFlags); void collectMoveTo(unsigned id, unsigned level, double x, double y); void collectLineTo(unsigned id, unsigned level, double x, double y); void collectArcTo(unsigned id, unsigned level, double x2, double y2, double bow); @@ -92,8 +92,8 @@ public: // Style collectors void collectStyleSheet(unsigned id, unsigned level, unsigned parentLineStyle, unsigned parentFillStyle, unsigned parentTextStyle); void collectLineStyle(unsigned id, unsigned level, double strokeWidth, Colour c, unsigned char linePattern, unsigned char lineCap); - void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY); - void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned fillFGTransparency, unsigned fillBGTransparency, unsigned char shadowPattern, Colour shfgc); + void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc, double shadowOffsetX, double shadowOffsetY); + void collectFillStyle(unsigned id, unsigned level, unsigned char colourIndexFG, unsigned char colourIndexBG, unsigned char fillPattern, unsigned char fillFGTransparency, unsigned char fillBGTransparency, unsigned char shadowPattern, Colour shfgc); void collectCharIXStyle(unsigned id , unsigned level, unsigned charCount, unsigned short fontID, Colour fontColour, unsigned langId, double fontSize, bool bold, bool italic, bool underline, bool doubleunderline, bool strikeout, bool doublestrikeout, bool allcaps, bool initcaps, bool smallcaps, bool superscript, bool subscript, WPXString fontFace); diff --git a/src/lib/VSDXTypes.h b/src/lib/VSDXTypes.h index 80bd8d5..a6fd4df 100644 --- a/src/lib/VSDXTypes.h +++ b/src/lib/VSDXTypes.h @@ -66,10 +66,10 @@ struct Colour Colour(unsigned red, unsigned green, unsigned blue, unsigned alpha) : r(red), g(green), b(blue), a(alpha) {} Colour() : r(0), g(0), b(0), a(0xff) {} - unsigned int r; - unsigned int g; - unsigned int b; - unsigned int a; + unsigned r; + unsigned g; + unsigned b; + unsigned a; }; struct NURBSData diff --git a/src/lib/libvisio_utils.h b/src/lib/libvisio_utils.h index c16ddfc..d2dec08 100644 --- a/src/lib/libvisio_utils.h +++ b/src/lib/libvisio_utils.h @@ -36,7 +36,7 @@ typedef unsigned char uint8_t; typedef unsigned short uint16_t; -typedef unsigned int uint32_t; +typedef unsigned uint32_t; typedef unsigned __int64 uint64_t; #else |