You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
(4) |
Jun
(28) |
Jul
(15) |
Aug
(23) |
Sep
(2) |
Oct
(13) |
Nov
(26) |
Dec
(30) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(1) |
Feb
(2) |
Mar
(5) |
Apr
(4) |
May
(70) |
Jun
(32) |
Jul
(27) |
Aug
(25) |
Sep
(8) |
Oct
(16) |
Nov
(30) |
Dec
(30) |
2007 |
Jan
(17) |
Feb
(7) |
Mar
(6) |
Apr
(36) |
May
(19) |
Jun
(82) |
Jul
(99) |
Aug
(44) |
Sep
(60) |
Oct
(106) |
Nov
(47) |
Dec
(37) |
2008 |
Jan
(5) |
Feb
(5) |
Mar
(4) |
Apr
(16) |
May
(2) |
Jun
|
Jul
(20) |
Aug
(5) |
Sep
|
Oct
(95) |
Nov
(104) |
Dec
(23) |
2009 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(8) |
Oct
|
Nov
|
Dec
|
2010 |
Jan
|
Feb
|
Mar
|
Apr
(4) |
May
(1) |
Jun
(46) |
Jul
(5) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Fridrich S. <str...@us...> - 2010-06-10 11:57:21
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21266/src/lib Modified Files: WP6ContentListener.cpp Log Message: use the deletable information only if the fontPID is 0, not if the Font Descriptor Packet is corrupted Index: WP6ContentListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ContentListener.cpp,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- WP6ContentListener.cpp 10 Jun 2010 11:52:46 -0000 1.72 +++ WP6ContentListener.cpp 10 Jun 2010 11:57:13 -0000 1.73 @@ -712,12 +712,9 @@ { const WP6FontDescriptorPacket *fontDescriptorPacket = dynamic_cast<const WP6FontDescriptorPacket *>(WP6Listener::getPrefixDataPacket(fontPID)); - if (fontDescriptorPacket) - { + if (fontDescriptorPacket) { *(m_ps->m_fontName) = fontDescriptorPacket->getFontName(); } - else if (fontName.len()) - *(m_ps->m_fontName) = fontName; } else if (fontName.len()) *(m_ps->m_fontName) = fontName; |
From: Fridrich S. <str...@us...> - 2010-06-10 11:54:33
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20417/src/lib Modified Files: WP1FixedLengthGroup.cpp WP3FixedLengthGroup.cpp WP3VariableLengthGroup.cpp WP5FixedLengthGroup.cpp WP5VariableLengthGroup.cpp WP6EOLGroup.cpp WP6FixedLengthGroup.cpp WP6VariableLengthGroup.cpp WPXHeader.cpp Log Message: Avoid computing value for WPX_SEEK_CUR if one can do a more simple WPX_SEEK_SET Index: WP6VariableLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6VariableLengthGroup.cpp,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- WP6VariableLengthGroup.cpp 31 Mar 2008 13:36:29 -0000 1.39 +++ WP6VariableLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.40 @@ -98,7 +98,7 @@ input->seek(1, WPX_SEEK_CUR); uint16_t size = readU16(input, encryption); - if (input->seek((startPosition + size - 4 - input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 4), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -163,7 +163,7 @@ _readContents(input, encryption); - input->seek((startPosition + m_size - 4 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + m_size - 4), WPX_SEEK_SET); if (m_size != readU16(input, encryption)) { @@ -171,5 +171,5 @@ throw FileException(); } - input->seek((startPosition + m_size - 1 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + m_size - 1), WPX_SEEK_SET); } Index: WPXHeader.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXHeader.cpp,v retrieving revision 1.35 retrieving revision 1.36 diff -u -d -r1.35 -r1.36 --- WPXHeader.cpp 4 Dec 2007 10:28:03 -0000 1.35 +++ WPXHeader.cpp 10 Jun 2010 11:54:24 -0000 1.36 @@ -55,7 +55,7 @@ char fileMagic[4] = { 0, 0, 0, 0 }; /* check the magic */ - input->seek(WPX_HEADER_MAGIC_OFFSET - input->tell(), WPX_SEEK_CUR); + input->seek(WPX_HEADER_MAGIC_OFFSET, WPX_SEEK_SET); for (int i=0; i<3 && !input->atEOS(); i++) fileMagic[i] = (char)readU8(input, encryption); @@ -66,11 +66,11 @@ } /* get the document pointer */ - input->seek(WPX_HEADER_DOCUMENT_POINTER_OFFSET - input->tell(), WPX_SEEK_CUR); + input->seek(WPX_HEADER_DOCUMENT_POINTER_OFFSET, WPX_SEEK_SET); uint32_t documentOffset = readU32(input, encryption); /* get information on product types, file types, versions */ - input->seek(WPX_HEADER_PRODUCT_TYPE_OFFSET - input->tell(), WPX_SEEK_CUR); + input->seek(WPX_HEADER_PRODUCT_TYPE_OFFSET, WPX_SEEK_SET); uint8_t productType = readU8(input, encryption); uint8_t fileType = readU8(input, encryption); uint8_t majorVersion = readU8(input, encryption); Index: WP3FixedLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3FixedLengthGroup.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- WP3FixedLengthGroup.cpp 22 Nov 2007 12:20:23 -0000 1.12 +++ WP3FixedLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.13 @@ -70,7 +70,7 @@ try { int size = WP3_FIXED_LENGTH_FUNCTION_GROUP_SIZE[groupID-0xC0]; - if (input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 2), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -99,7 +99,7 @@ if (m_group >= 0xC0 && m_group <= 0xCF) // just an extra safety check { int size = WP3_FIXED_LENGTH_FUNCTION_GROUP_SIZE[m_group-0xC0]; - input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + size - 2), WPX_SEEK_SET); if (m_group != readU8(input, encryption)) { WPD_DEBUG_MSG(("WordPerfect: Possible corruption detected. Bailing out!\n")); Index: WP5FixedLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5FixedLengthGroup.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- WP5FixedLengthGroup.cpp 22 Nov 2007 12:20:32 -0000 1.17 +++ WP5FixedLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.18 @@ -70,7 +70,7 @@ try { int size = WP5_FIXED_LENGTH_FUNCTION_GROUP_SIZE[groupID-0xC0]; - if (input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 2), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -99,7 +99,7 @@ if (m_group >= 0xC0 && m_group <= 0xCF) // just an extra safety check { int size = WP5_FIXED_LENGTH_FUNCTION_GROUP_SIZE[m_group-0xC0]; - input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + size - 2), WPX_SEEK_SET); if (m_group != readU8(input, encryption)) { WPD_DEBUG_MSG(("WordPerfect: Possible corruption detected. Bailing out!\n")); Index: WP5VariableLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5VariableLengthGroup.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- WP5VariableLengthGroup.cpp 22 Nov 2007 12:20:35 -0000 1.24 +++ WP5VariableLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.25 @@ -78,7 +78,7 @@ uint8_t subGroup = readU8(input, encryption); uint16_t size = readU16(input, encryption); - if (input->seek((startPosition + size - 1 - input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 1), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -120,7 +120,7 @@ _readContents(input, encryption); - input->seek((startPosition + m_size - 5 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + m_size - 5), WPX_SEEK_SET); if (m_size != (readU16(input, encryption) + 4)) { @@ -133,5 +133,5 @@ throw FileException(); } - input->seek((startPosition + m_size - 1 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + m_size - 1), WPX_SEEK_SET); } Index: WP3VariableLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3VariableLengthGroup.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- WP3VariableLengthGroup.cpp 17 Oct 2008 15:05:19 -0000 1.17 +++ WP3VariableLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.18 @@ -91,7 +91,7 @@ return false; } - if (input->seek((startPosition + size - 1 - input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 1), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -135,7 +135,7 @@ _readContents(input, encryption); - input->seek((startPosition + m_size - 5 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + m_size - 5), WPX_SEEK_SET); if (m_size != (readU16(input, encryption, true) + 4)) { @@ -148,6 +148,6 @@ throw FileException(); } - input->seek((startPosition + m_size - 1 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + m_size - 1), WPX_SEEK_SET); } Index: WP1FixedLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP1FixedLengthGroup.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- WP1FixedLengthGroup.cpp 22 Nov 2007 12:20:17 -0000 1.11 +++ WP1FixedLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.12 @@ -93,7 +93,7 @@ try { int size = WP1_FUNCTION_GROUP_SIZE[groupID-0xC0]; - if (input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 2), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -126,7 +126,7 @@ _readContents(input, encryption); - input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + size - 2), WPX_SEEK_SET); if (m_group != readU8(input, encryption)) { WPD_DEBUG_MSG(("WordPerfect: Possible corruption detected. Bailing out!\n")); Index: WP6FixedLengthGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6FixedLengthGroup.cpp,v retrieving revision 1.31 retrieving revision 1.32 diff -u -d -r1.31 -r1.32 --- WP6FixedLengthGroup.cpp 30 Jan 2008 21:37:55 -0000 1.31 +++ WP6FixedLengthGroup.cpp 10 Jun 2010 11:54:24 -0000 1.32 @@ -76,7 +76,7 @@ try { uint32_t size = WP6_FIXED_LENGTH_FUNCTION_GROUP_SIZE[groupID-0xF0]; - if (input->seek((startPosition + size - 2 - (uint32_t)input->tell()), WPX_SEEK_CUR) || input->atEOS()) + if (input->seek((startPosition + size - 2), WPX_SEEK_SET) || input->atEOS()) { input->seek(startPosition, WPX_SEEK_SET); return false; @@ -105,7 +105,7 @@ if (m_group >= 0xF0 && m_group < 0xFF) // just an extra safety check { int size = WP6_FIXED_LENGTH_FUNCTION_GROUP_SIZE[m_group-0xF0]; - input->seek((startPosition + size - 2 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition + size - 2), WPX_SEEK_SET); if (m_group != readU8(input, encryption)) { WPD_DEBUG_MSG(("WordPerfect: Possible corruption detected: bailing out!\n")); Index: WP6EOLGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6EOLGroup.cpp,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- WP6EOLGroup.cpp 31 Jan 2008 16:03:18 -0000 1.61 +++ WP6EOLGroup.cpp 10 Jun 2010 11:54:24 -0000 1.62 @@ -239,7 +239,7 @@ if (startPosition2 + numBytesToSkip - 1 - input->tell() < 0) throw FileException(); - input->seek((startPosition2 + numBytesToSkip - 1 - input->tell()), WPX_SEEK_CUR); + input->seek((startPosition2 + numBytesToSkip - 1), WPX_SEEK_SET); } } |
From: Fridrich S. <str...@us...> - 2010-06-10 11:52:55
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19929/src/lib Modified Files: WP6ContentListener.cpp WP6ContentListener.h WP6DefaultInitialFontPacket.cpp WP6CharacterGroup.cpp WP6CharacterGroup.h WP6FontDescriptorPacket.cpp WP6FontDescriptorPacket.h WP6Listener.h WP6StylesListener.h Log Message: Try to use deletable font information if the prefix packet is not present Index: WP6FontDescriptorPacket.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6FontDescriptorPacket.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WP6FontDescriptorPacket.h 22 Nov 2007 12:20:40 -0000 1.13 +++ WP6FontDescriptorPacket.h 10 Jun 2010 11:52:46 -0000 1.14 @@ -36,6 +36,8 @@ void _readContents(WPXInputStream *input, WPXEncryption *encryption); const char *getFontName() const { return m_fontName.cstr(); } + static void _readFontName(WPXInputStream *input, WPXEncryption *encryption, WPXString &fontName, uint16_t fontNameLength); + private: WP6FontDescriptorPacket(const WP6FontDescriptorPacket&); WP6FontDescriptorPacket& operator=(const WP6FontDescriptorPacket&); Index: WP6DefaultInitialFontPacket.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6DefaultInitialFontPacket.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- WP6DefaultInitialFontPacket.cpp 22 Nov 2007 12:20:38 -0000 1.21 +++ WP6DefaultInitialFontPacket.cpp 10 Jun 2010 11:52:46 -0000 1.22 @@ -38,7 +38,7 @@ void WP6DefaultInitialFontPacket::parse(WP6Listener *listener) const { - listener->fontChange(getPointSize(), getInitialFontDescriptorPID()); + listener->fontChange(getPointSize(), getInitialFontDescriptorPID(), WPXString()); } void WP6DefaultInitialFontPacket::_readContents(WPXInputStream *input, WPXEncryption *encryption) Index: WP6ContentListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ContentListener.h,v retrieving revision 1.33 retrieving revision 1.34 diff -u -d -r1.33 -r1.34 --- WP6ContentListener.h 3 Dec 2008 13:40:34 -0000 1.33 +++ WP6ContentListener.h 10 Jun 2010 11:52:46 -0000 1.34 @@ -140,7 +140,7 @@ void startDocument() { WPXContentListener::startDocument(); }; void startSubDocument() { WPXContentListener::startSubDocument(); }; - void setDate(const uint16_t type, const uint16_t year, + void setDate(const uint16_t type, const uint16_t year, const uint8_t month, const uint8_t day, const uint8_t hour, const uint8_t minute, const uint8_t second, const uint8_t dayOfWeek, @@ -160,7 +160,7 @@ void characterColorChange(const uint8_t red, const uint8_t green, const uint8_t blue); void characterShadingChange(const uint8_t shading); void highlightChange(const bool isOn, const RGBSColor color); - void fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID); + void fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID, const WPXString &fontName); void attributeChange(const bool isOn, const uint8_t attribute); void spacingAfterParagraphChange(const double spacingRelative, const double spacingAbsolute); void pageMarginChange(const uint8_t /* side */, const uint16_t /* margin */) {} Index: WP6ContentListener.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6ContentListener.cpp,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- WP6ContentListener.cpp 3 May 2010 08:23:17 -0000 1.71 +++ WP6ContentListener.cpp 10 Jun 2010 11:52:46 -0000 1.72 @@ -694,7 +694,7 @@ } } -void WP6ContentListener::fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID) +void WP6ContentListener::fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID, const WPXString &fontName) { if (!isUndoOn()) { @@ -712,10 +712,15 @@ { const WP6FontDescriptorPacket *fontDescriptorPacket = dynamic_cast<const WP6FontDescriptorPacket *>(WP6Listener::getPrefixDataPacket(fontPID)); - if (fontDescriptorPacket) { + if (fontDescriptorPacket) + { *(m_ps->m_fontName) = fontDescriptorPacket->getFontName(); } + else if (fontName.len()) + *(m_ps->m_fontName) = fontName; } + else if (fontName.len()) + *(m_ps->m_fontName) = fontName; } } Index: WP6CharacterGroup.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6CharacterGroup.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- WP6CharacterGroup.h 22 Nov 2007 12:20:37 -0000 1.24 +++ WP6CharacterGroup.h 10 Jun 2010 11:52:46 -0000 1.25 @@ -72,6 +72,7 @@ uint16_t m_hash; uint16_t m_matchedFontIndex; uint16_t m_matchedFontPointSize; + WPXString m_fontName; }; class WP6CharacterGroup_FontSizeChangeSubGroup : public WP6VariableLengthGroup_SubGroup Index: WP6CharacterGroup.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6CharacterGroup.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- WP6CharacterGroup.cpp 7 Dec 2007 16:07:20 -0000 1.37 +++ WP6CharacterGroup.cpp 10 Jun 2010 11:52:46 -0000 1.38 @@ -29,6 +29,7 @@ #include "WP6Listener.h" #include "libwpd_internal.h" #include "WP6CommentAnnotationPacket.h" +#include "WP6FontDescriptorPacket.h" /************************************************************************* * WP6CharacterGroup_SetAlignmentCharacterSubGroup @@ -92,13 +93,19 @@ *************************************************************************/ WP6CharacterGroup_FontFaceChangeSubGroup::WP6CharacterGroup_FontFaceChangeSubGroup(WPXInputStream *input, WPXEncryption *encryption) : - m_oldMatchedPointSize(0), m_hash(0), m_matchedFontIndex(0), m_matchedFontPointSize(0) + m_oldMatchedPointSize(0), m_hash(0), m_matchedFontIndex(0), m_matchedFontPointSize(0), m_fontName() { m_oldMatchedPointSize = readU16(input, encryption); m_hash = readU16(input, encryption); m_matchedFontIndex = readU16(input, encryption); m_matchedFontPointSize = readU16(input, encryption); - WPD_DEBUG_MSG(("WordPerfect: Character Group Font Face Change subgroup info (old matched point size: %i, hash: %i, matched font index: %i, matched font point size: %i\n", m_oldMatchedPointSize, m_hash, m_matchedFontIndex, m_matchedFontPointSize)); + WPD_DEBUG_MSG(("WordPerfect: Character Group Font Face Change subgroup info (old matched point size: %i, hash: %i, matched font index: %i, matched font point size: %i)\n", m_oldMatchedPointSize, m_hash, m_matchedFontIndex, m_matchedFontPointSize)); + + input->seek(22, WPX_SEEK_CUR); + uint16_t tmpSizeDeletable = readU16(input, encryption); + WP6FontDescriptorPacket::_readFontName(input, encryption, m_fontName, tmpSizeDeletable); + + WPD_DEBUG_MSG(("WordPerfect: Character Group Font Face Change subgroup info (font name length: %i, font name: %s)\n", tmpSizeDeletable, m_fontName.cstr())); } void WP6CharacterGroup_FontFaceChangeSubGroup::parse(WP6Listener *listener, const uint8_t /* numPrefixIDs */, uint16_t const *prefixIDs) const @@ -106,7 +113,7 @@ WPD_DEBUG_MSG(("WordPerfect: FontFaceChangeSubGroup parsing\n")); if (!prefixIDs) return; - listener->fontChange(m_matchedFontPointSize, prefixIDs[0]); + listener->fontChange(m_matchedFontPointSize, prefixIDs[0], m_fontName); } /************************************************************************* @@ -125,7 +132,7 @@ WPD_DEBUG_MSG(("WordPerfect: FontSizeChangeSubGroup parsing\n")); if (!prefixIDs) return; - listener->fontChange(m_desiredFontPointSize, prefixIDs[0]); + listener->fontChange(m_desiredFontPointSize, prefixIDs[0], WPXString()); } /************************************************************************* Index: WP6Listener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6Listener.h,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- WP6Listener.h 3 Dec 2008 13:40:34 -0000 1.24 +++ WP6Listener.h 10 Jun 2010 11:52:46 -0000 1.25 @@ -66,7 +66,7 @@ virtual void characterColorChange(const uint8_t red, const uint8_t green, const uint8_t blue) = 0; virtual void characterShadingChange(const uint8_t shading) = 0; virtual void highlightChange(const bool isOn, const RGBSColor color) = 0; - virtual void fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID) = 0; + virtual void fontChange(const uint16_t matchedFontPointSize, const uint16_t fontPID, const WPXString &fontName) = 0; virtual void attributeChange(const bool isOn, const uint8_t attribute) = 0; virtual void spacingAfterParagraphChange(const double spacingRelative, const double spacingAbsolute) = 0; virtual void pageMarginChange(const uint8_t side, const uint16_t margin) = 0; Index: WP6FontDescriptorPacket.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6FontDescriptorPacket.cpp,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- WP6FontDescriptorPacket.cpp 22 Nov 2007 12:20:40 -0000 1.36 +++ WP6FontDescriptorPacket.cpp 10 Jun 2010 11:52:46 -0000 1.37 @@ -88,12 +88,16 @@ m_fontNameLength = readU16(input, encryption); + _readFontName(input, encryption, m_fontName, m_fontNameLength); +} - if (m_fontNameLength > ((std::numeric_limits<uint16_t>::max)() / 2)) - m_fontNameLength = ((std::numeric_limits<uint16_t>::max)() / 2); - if (m_fontNameLength) +void WP6FontDescriptorPacket::_readFontName(WPXInputStream *input, WPXEncryption *encryption, WPXString &fontName, uint16_t fontNameLength) +{ + if (fontNameLength > ((std::numeric_limits<uint16_t>::max)() / 2)) + fontNameLength = ((std::numeric_limits<uint16_t>::max)() / 2); + if (fontNameLength) { - for (uint16_t i=0; i<(m_fontNameLength/2); i++) + for (uint16_t i=0; i<(fontNameLength/2); i++) { uint16_t charWord = readU16(input, encryption); uint8_t characterSet = (uint8_t)((charWord >> 8) & 0x00FF); @@ -106,11 +110,11 @@ int len = extendedCharacterWP6ToUCS2(character, characterSet, &chars); for (int j = 0; j < len; j++) - appendUCS4(m_fontName, (uint32_t)chars[j]); + appendUCS4(fontName, (uint32_t)chars[j]); } - WPD_DEBUG_MSG(("WordPerfect: stripping font name (original: %s)\n", m_fontName.cstr())); - std::string stringValue(m_fontName.cstr()); + WPD_DEBUG_MSG(("WordPerfect: stripping font name (original: %s)\n", fontName.cstr())); + std::string stringValue(fontName.cstr()); std::string::size_type pos; for (unsigned k = 0; k < countElements(FONT_WEIGHT_STRINGS); k++) { @@ -134,9 +138,7 @@ while ((pos = stringValue.find("-", stringValue.size() - 1)) != std::string::npos) stringValue.replace(pos, strlen("-"), ""); - m_fontName = WPXString(stringValue.c_str()); - WPD_DEBUG_MSG(("WordPerfect: stripping font name (final: %s)\n", m_fontName.cstr())); + fontName = WPXString(stringValue.c_str()); + WPD_DEBUG_MSG(("WordPerfect: stripping font name (final: %s)\n", fontName.cstr())); } - WPD_DEBUG_MSG(("WordPerfect: Read Font (primary family id: %i, family member id: %i, font type: %i, font source file type: %i font name length: %i, font name: %s)\n", - (int) m_primaryFamilyId, (int) m_primaryFamilyMemberId, (int) m_fontType, (int) m_fontSourceFileType, (int) m_fontNameLength, m_fontName.cstr())); } Index: WP6StylesListener.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6StylesListener.h,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- WP6StylesListener.h 3 Dec 2008 13:40:34 -0000 1.29 +++ WP6StylesListener.h 10 Jun 2010 11:52:46 -0000 1.30 @@ -64,7 +64,7 @@ void characterColorChange(const uint8_t /* red */, const uint8_t /* green */, const uint8_t /* blue */) {} void characterShadingChange(const uint8_t /* shading */) {} void highlightChange(const bool /* isOn */, const RGBSColor /* color */) {} - void fontChange(const uint16_t /* matchedFontPointSize */, const uint16_t /* fontPID */) {} + void fontChange(const uint16_t /* matchedFontPointSize */, const uint16_t /* fontPID */, const WPXString &fontName) {} void attributeChange(const bool /* isOn */, const uint8_t /* attribute */) {} void lineSpacingChange(const double /* lineSpacing */) {} void spacingAfterParagraphChange(const double /* spacingRelative */, const double /* spacingAbsolute */) {} |
From: Fridrich S. <str...@us...> - 2010-06-09 16:30:40
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21621/src/lib Modified Files: WP1Parser.cpp WP3Parser.cpp WP5Parser.cpp WP6Parser.cpp Log Message: fix external subdocuments parsing Index: WP6Parser.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP6Parser.cpp,v retrieving revision 1.55 retrieving revision 1.56 diff -u -d -r1.55 -r1.56 --- WP6Parser.cpp 7 Dec 2007 16:07:20 -0000 1.55 +++ WP6Parser.cpp 9 Jun 2010 16:30:32 -0000 1.56 @@ -256,6 +256,8 @@ parseDocument(input, 0, &stylesListener); stylesListener.endSubDocument(); + input->seek(0, WPX_SEEK_SET); + WP6ContentListener listener(pageList, tableList, documentInterface); listener.startSubDocument(); parseDocument(input, 0, &listener); Index: WP3Parser.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP3Parser.cpp,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- WP3Parser.cpp 23 Oct 2008 09:16:27 -0000 1.23 +++ WP3Parser.cpp 9 Jun 2010 16:30:32 -0000 1.24 @@ -183,6 +183,8 @@ parseDocument(input, 0, &stylesListener); stylesListener.endSubDocument(); + input->seek(0, WPX_SEEK_SET); + WP3ContentListener listener(pageList, subDocuments, documentInterface); listener.startSubDocument(); parseDocument(input, 0, &listener); Index: WP5Parser.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5Parser.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -u -d -r1.43 -r1.44 --- WP5Parser.cpp 3 Dec 2008 13:40:34 -0000 1.43 +++ WP5Parser.cpp 9 Jun 2010 16:30:32 -0000 1.44 @@ -233,6 +233,8 @@ parseDocument(input, 0, &stylesListener); stylesListener.endSubDocument(); + input->seek(0, WPX_SEEK_SET); + WP5ContentListener listener(pageList, subDocuments, documentInterface); listener.startSubDocument(); parseDocument(input, 0, &listener); Index: WP1Parser.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP1Parser.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WP1Parser.cpp 15 Apr 2008 19:48:02 -0000 1.13 +++ WP1Parser.cpp 9 Jun 2010 16:30:32 -0000 1.14 @@ -255,6 +255,8 @@ parseDocument(input, 0, &stylesListener); stylesListener.endSubDocument(); + input->seek(0, WPX_SEEK_SET); + WP1ContentListener listener(pageList, subDocuments, documentInterface); listener.startSubDocument(); parseDocument(input, 0, &listener); |
From: Fridrich S. <str...@us...> - 2010-06-08 13:49:16
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv8994/filter Modified Files: OdgExporter.cxx OdgExporter.hxx Log Message: Adapting to recent changes in libwpg api Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- OdgExporter.cxx 7 Jun 2010 13:04:00 -0000 1.42 +++ OdgExporter.cxx 8 Jun 2010 13:49:08 -0000 1.43 @@ -279,7 +279,7 @@ mpHandler->endDocument(); } -void OdgExporter::setStyle(const ::WPXPropertyListVector& gradient, const ::WPXPropertyList & propList) +void OdgExporter::setStyle(const ::WPXPropertyList & propList, const ::WPXPropertyListVector& gradient) { mxStyle = propList; mxGradient = gradient; @@ -511,7 +511,7 @@ mBodyElements.push_back(new TagCloseElement("draw:path")); } -void OdgExporter::drawImageObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData) +void OdgExporter::drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData) { if (!propList["libwpg:mime-type"] && propList["libwpg:mime-type"]->getStr().len() <= 0) return; @@ -543,6 +543,10 @@ mBodyElements.push_back(new TagCloseElement("draw:frame")); } +void OdgExporter::drawTextLine(const ::WPXPropertyList &propList, const ::WPXString &str) +{ +} + void OdgExporter::writeGraphicsStyle() { #if 0 Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- OdgExporter.hxx 3 Jun 2010 10:48:53 -0000 1.19 +++ OdgExporter.hxx 8 Jun 2010 13:49:08 -0000 1.20 @@ -47,14 +47,15 @@ void startEmbeddedGraphics(const ::WPXPropertyList& /*propList*/) {} void endEmbeddedGraphics() {} - void setStyle(const ::WPXPropertyListVector& gradient, const ::WPXPropertyList &propList); + void setStyle(const ::WPXPropertyList &propList, const ::WPXPropertyListVector& gradient); void drawRectangle(const ::WPXPropertyList &propList); void drawEllipse(const ::WPXPropertyList &propList); void drawPolyline(const ::WPXPropertyListVector& vertices); void drawPolygon(const ::WPXPropertyListVector& vertices); void drawPath(const ::WPXPropertyListVector& path); - void drawImageObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData); + void drawGraphicObject(const ::WPXPropertyList &propList, const ::WPXBinaryData& binaryData); + void drawTextLine(const ::WPXPropertyList &propList, const ::WPXString& str); private: void writeGraphicsStyle(); |
From: Fridrich S. <str...@us...> - 2010-06-07 13:04:09
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27990/filter Modified Files: OdgExporter.cxx Log Message: Trying to generate correct elliptical arc in odg Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.41 retrieving revision 1.42 diff -u -d -r1.41 -r1.42 --- OdgExporter.cxx 4 Jun 2010 09:21:29 -0000 1.41 +++ OdgExporter.cxx 7 Jun 2010 13:04:00 -0000 1.42 @@ -441,6 +441,13 @@ qx = (qx < path[k]["svg:x2"]->getDouble()) ? path[k]["svg:x2"]->getDouble() : qx; qy = (qy < path[k]["svg:y2"]->getDouble()) ? path[k]["svg:y2"]->getDouble() : qy; } + if(path[k]["libwpg:path-action"]->getStr() == "A") + { + px = (px > path[k]["svg:x"]->getDouble()-2*path[k]["svg:rx"]->getDouble()) ? path[k]["svg:x"]->getDouble()-2*path[k]["svg:rx"]->getDouble() : px; + py = (py > path[k]["svg:y"]->getDouble()-2*path[k]["svg:ry"]->getDouble()) ? path[k]["svg:y"]->getDouble()-2*path[k]["svg:ry"]->getDouble() : py; + qx = (qx < path[k]["svg:x"]->getDouble()+2*path[k]["svg:rx"]->getDouble()) ? path[k]["svg:x"]->getDouble()+2*path[k]["svg:rx"]->getDouble() : qx; + qy = (qy < path[k]["svg:y"]->getDouble()+2*path[k]["svg:ry"]->getDouble()) ? path[k]["svg:y"]->getDouble()+2*path[k]["svg:ry"]->getDouble() : qy; + } } double vw = qx - px; double vh = qy - py; @@ -489,6 +496,13 @@ (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); sValue.append(sElement); } + else if (path[i]["libwpg:path-action"]->getStr() == "A") + { + sElement.sprintf("A%i %i %i %i %i %i %i", (unsigned)((path[i]["svg:rx"]->getDouble())*2540), + (int)((path[i]["svg:ry"]->getDouble())*2540), (path[i]["libwpg:rotate"] ? path[i]["libwpg:rotate"]->getInt() : 0), + 0, 0, (unsigned)((path[i]["svg:x"]->getDouble()-px)*2540), (unsigned)((path[i]["svg:y"]->getDouble()-py)*2540)); + sValue.append(sElement); + } else if (path[i]["libwpg:path-action"]->getStr() == "Z" && i >= (path.count() - 1)) sValue.append(" Z"); } |
From: Fridrich S. <str...@us...> - 2010-06-07 07:27:29
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv9397/src/lib Modified Files: WP5GraphicsInformationPacket.cpp Log Message: Don't add WPG1 header if the binary already has any WP header Index: WP5GraphicsInformationPacket.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WP5GraphicsInformationPacket.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- WP5GraphicsInformationPacket.cpp 18 Jul 2008 13:06:34 -0000 1.9 +++ WP5GraphicsInformationPacket.cpp 7 Jun 2010 07:27:21 -0000 1.10 @@ -68,15 +68,17 @@ #if 0 WPXString filename; filename.sprintf("binarydump%.4x.wpg", j); - FILE *f = fopen(filename.cstr(), "w"); + FILE *f = fopen(filename.cstr(), "wb"); if (f) { - - // Here we create a file header, since it looks like the embedded files do not contain it - fprintf(f, "%c%c%c%c", 0xff, 0x57, 0x50, 0x43); - fprintf(f, "%c%c%c%c", 0x10, 0, 0, 0); - fprintf(f, "%c%c%c%c", 0x01, 0x16, 0x01, 0); - fprintf(f, "%c%c%c%c", 0, 0, 0, 0); + if (tmpData[0]!=0xff || tmpData[1]!='W' || tmpData[2]!='P' || tmpData[3]!='C') + { + // Here we create a file header, since it looks like some embedded files do not contain it + fprintf(f, "%c%c%c%c", 0xff, 0x57, 0x50, 0x43); + fprintf(f, "%c%c%c%c", 0x10, 0x00, 0x00, 0x00); + fprintf(f, "%c%c%c%c", 0x01, 0x16, 0x01, 0x00); + fprintf(f, "%c%c%c%c", 0x00, 0x00, 0x00, 0x00); + } for (uint32_t l = 0; l < tmpImagesSizes[j]; l++) fprintf(f, "%c", tmpData[l]); |
From: Fridrich S. <str...@us...> - 2010-06-06 22:54:38
|
Update of /cvsroot/libwpd/libwpd2/src/test In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv17094/src/test Modified Files: test.cpp Log Message: fixing some distcheck errors Index: test.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/test/test.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- test.cpp 11 Nov 2008 10:26:29 -0000 1.6 +++ test.cpp 6 Jun 2010 22:54:30 -0000 1.7 @@ -67,8 +67,8 @@ void Test::testStream(void) { WPXInputStream* input = 0; - size_t numBytesRead; - uint32_t u32; + unsigned long numBytesRead; + unsigned long u32; /********************** * Test WPXFileStream * @@ -81,14 +81,14 @@ // test read() input->seek(0, WPX_SEEK_SET); CPPUNIT_ASSERT ( NULL == input->read(0, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (size_t) 0, numBytesRead ); - CPPUNIT_ASSERT_EQUAL ( (long int) 0 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (unsigned long)0, numBytesRead ); + CPPUNIT_ASSERT_EQUAL ( (long) 0 , input->tell() ); CPPUNIT_ASSERT ( NULL != input->read(1, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (long int) 1 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 1 , input->tell() ); input->seek(0, WPX_SEEK_SET); CPPUNIT_ASSERT ( NULL != input->read(50, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (long int) 8 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 8 , input->tell() ); // test readU*() input->seek(0, WPX_SEEK_SET); @@ -103,19 +103,19 @@ input->seek(0, WPX_SEEK_SET); u32 = readU32(input, 0); - CPPUNIT_ASSERT_EQUAL( (uint32_t) 0x04030201 , u32 ); + CPPUNIT_ASSERT_EQUAL( (unsigned long) 0x04030201 , u32 ); u32 = readU32(input, 0); - CPPUNIT_ASSERT_EQUAL( (uint32_t) 0x07060500 , u32 ); + CPPUNIT_ASSERT_EQUAL( (unsigned long) 0x07060500 , u32 ); // test seek(), tell(), atEOS() input->seek(1, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 1 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 1 , input->tell() ); input->seek(0, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 0 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 0 , input->tell() ); input->seek(8, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 8 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 8 , input->tell() ); input->seek(0, WPX_SEEK_SET); for (int i = 0; i < 8; i++) @@ -125,7 +125,7 @@ CPPUNIT_ASSERT_THROW ( readU8(input, 0), FileException ); input->seek(-1, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 0, input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 0, input->tell() ); input->seek(8, WPX_SEEK_SET); CPPUNIT_ASSERT_EQUAL ( true, input->atEOS() ); @@ -147,14 +147,14 @@ // test read() input->seek(0, WPX_SEEK_SET); CPPUNIT_ASSERT ( NULL == input->read(0, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (size_t) 0, numBytesRead ); - CPPUNIT_ASSERT_EQUAL ( (long int) 0 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (unsigned long) 0, numBytesRead ); + CPPUNIT_ASSERT_EQUAL ( (long) 0 , input->tell() ); CPPUNIT_ASSERT ( NULL != input->read(1, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (long int) 1 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 1 , input->tell() ); input->seek(0, WPX_SEEK_SET); CPPUNIT_ASSERT ( NULL != input->read(50, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (long int) 8 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 8 , input->tell() ); // test readU*() input->seek(0, WPX_SEEK_SET); @@ -169,19 +169,19 @@ input->seek(0, WPX_SEEK_SET); u32 = readU32(input, 0); - CPPUNIT_ASSERT_EQUAL( (uint32_t) 0x04030201 , u32 ); + CPPUNIT_ASSERT_EQUAL( (unsigned long) 0x04030201 , u32 ); u32 = readU32(input, 0); - CPPUNIT_ASSERT_EQUAL( (uint32_t) 0x07060500 , u32 ); + CPPUNIT_ASSERT_EQUAL( (unsigned long) 0x07060500 , u32 ); // test seek(), tell(), atEOS() input->seek(1, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 1 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 1 , input->tell() ); input->seek(0, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 0 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 0 , input->tell() ); input->seek(8, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 8 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 8 , input->tell() ); input->seek(0, WPX_SEEK_SET); for (int i = 0; i < 8; i++) @@ -191,7 +191,7 @@ CPPUNIT_ASSERT_THROW ( readU8(input, 0), FileException ); input->seek(-1, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 0, input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 0, input->tell() ); input->seek(8, WPX_SEEK_SET); CPPUNIT_ASSERT_EQUAL ( true, input->atEOS() ); @@ -214,14 +214,14 @@ // test read() input->seek(0, WPX_SEEK_SET); CPPUNIT_ASSERT ( NULL == input->read(0, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (size_t) 0, numBytesRead ); - CPPUNIT_ASSERT_EQUAL ( (long int) 0 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (unsigned long) 0, numBytesRead ); + CPPUNIT_ASSERT_EQUAL ( (long) 0 , input->tell() ); CPPUNIT_ASSERT ( NULL != input->read(1, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (long int) 1 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 1 , input->tell() ); input->seek(0, WPX_SEEK_SET); CPPUNIT_ASSERT ( NULL != input->read(50, numBytesRead) ); - CPPUNIT_ASSERT_EQUAL ( (long int) 8 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 8 , input->tell() ); // test readU*() input->seek(0, WPX_SEEK_SET); @@ -236,19 +236,19 @@ input->seek(0, WPX_SEEK_SET); u32 = readU32(input, 0); - CPPUNIT_ASSERT_EQUAL( (uint32_t) 0x04030201 , u32 ); + CPPUNIT_ASSERT_EQUAL( (unsigned long) 0x04030201 , u32 ); u32 = readU32(input, 0); - CPPUNIT_ASSERT_EQUAL( (uint32_t) 0x07060500 , u32 ); + CPPUNIT_ASSERT_EQUAL( (unsigned long) 0x07060500 , u32 ); // test seek(), tell(), atEOS() input->seek(1, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 1 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 1 , input->tell() ); input->seek(0, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 0 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 0 , input->tell() ); input->seek(8, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 8 , input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 8 , input->tell() ); input->seek(0, WPX_SEEK_SET); for (int i = 0; i < 8; i++) @@ -258,7 +258,7 @@ CPPUNIT_ASSERT_THROW ( readU8(input, 0), FileException ); input->seek(-1, WPX_SEEK_SET); - CPPUNIT_ASSERT_EQUAL ( (long int) 0, input->tell() ); + CPPUNIT_ASSERT_EQUAL ( (long) 0, input->tell() ); input->seek(8, WPX_SEEK_SET); CPPUNIT_ASSERT_EQUAL ( true, input->atEOS() ); |
From: Fridrich S. <str...@us...> - 2010-06-04 21:35:38
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21361/filter Modified Files: WordPerfectCollector.hxx Log Message: Adapting to the new callbacks in libwpd Index: WordPerfectCollector.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.hxx,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- WordPerfectCollector.hxx 3 Jun 2010 21:23:48 -0000 1.38 +++ WordPerfectCollector.hxx 4 Jun 2010 21:35:30 -0000 1.39 @@ -103,9 +103,11 @@ virtual void startDocument() {} virtual void endDocument() {} + virtual void definePageStyle(const WPXPropertyList&) {} virtual void openPageSpan(const WPXPropertyList &propList); virtual void closePageSpan() {} + virtual void defineSectionStyle(const WPXPropertyList&, const WPXPropertyListVector&) {} virtual void openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns); virtual void closeSection(); @@ -114,9 +116,11 @@ virtual void openFooter(const WPXPropertyList &propList); virtual void closeFooter(); + virtual void defineParagraphStyle(const WPXPropertyList&, const WPXPropertyListVector&) {} virtual void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops); virtual void closeParagraph(); + virtual void defineCharacterStyle(const WPXPropertyList&) {} virtual void openSpan(const WPXPropertyList &propList); virtual void closeSpan(); |
From: Fridrich S. <str...@us...> - 2010-06-04 21:33:44
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20920/src/lib Modified Files: WPXDocumentInterface.h Log Message: Add noop callbacks that allow us later to start to support named styles Index: WPXDocumentInterface.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXDocumentInterface.h,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WPXDocumentInterface.h 3 Jun 2010 21:23:19 -0000 1.13 +++ WPXDocumentInterface.h 4 Jun 2010 21:33:33 -0000 1.14 @@ -109,6 +109,8 @@ */ virtual void endDocument() = 0; + virtual void definePageStyle(const WPXPropertyList &propList) = 0; + /** Called when a new page span is opened. This will always be called before any actual content is placed into the document. @@ -151,6 +153,8 @@ */ virtual void closeFooter() = 0; + virtual void defineParagraphStyle(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops) = 0; + /** Called when a new paragraph is opened. This (or openListElement) will always be called before any text or span is placed into the document. \param propList Property list for the paragraph. May contain: @@ -174,6 +178,8 @@ */ virtual void closeParagraph() = 0; + virtual void defineCharacterStyle(const WPXPropertyList &propList) = 0; + /** Called when a text span is opened \param propList Property list for the span. May contain: @@ -195,6 +201,9 @@ Called when a text span is closed */ virtual void closeSpan() = 0; + + virtual void defineSectionStyle(const WPXPropertyList &propList, const WPXPropertyListVector &columns) = 0; + /** Called when a new section is opened \param propList Property list for the section. May contain: |
From: Fridrich S. <str...@us...> - 2010-06-04 21:33:43
|
Update of /cvsroot/libwpd/libwpd2/src/conv/html In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20920/src/conv/html Modified Files: HtmlDocumentGenerator.h Log Message: Add noop callbacks that allow us later to start to support named styles Index: HtmlDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/html/HtmlDocumentGenerator.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- HtmlDocumentGenerator.h 3 Jun 2010 21:23:19 -0000 1.8 +++ HtmlDocumentGenerator.h 4 Jun 2010 21:33:33 -0000 1.9 @@ -42,6 +42,7 @@ virtual void startDocument(); virtual void endDocument(); + virtual void definePageStyle(const WPXPropertyList&) {} virtual void openPageSpan(const WPXPropertyList & /* propList */) {} virtual void closePageSpan() {} virtual void openHeader(const WPXPropertyList &propList); @@ -49,10 +50,15 @@ virtual void openFooter(const WPXPropertyList &propList); virtual void closeFooter(); + virtual void defineSectionStyle(const WPXPropertyList&, const WPXPropertyListVector&) {} virtual void openSection(const WPXPropertyList & /* propList */, const WPXPropertyListVector & /* columns */) {} virtual void closeSection() {} + + virtual void defineParagraphStyle(const WPXPropertyList&, const WPXPropertyListVector&) {} virtual void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops); virtual void closeParagraph(); + + virtual void defineCharacterStyle(const WPXPropertyList&) {} virtual void openSpan(const WPXPropertyList &propList); virtual void closeSpan(); |
From: Fridrich S. <str...@us...> - 2010-06-04 21:33:42
|
Update of /cvsroot/libwpd/libwpd2/src/conv/raw In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20920/src/conv/raw Modified Files: RawDocumentGenerator.cpp RawDocumentGenerator.h Log Message: Add noop callbacks that allow us later to start to support named styles Index: RawDocumentGenerator.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/raw/RawDocumentGenerator.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- RawDocumentGenerator.cpp 3 Jun 2010 21:23:19 -0000 1.5 +++ RawDocumentGenerator.cpp 4 Jun 2010 21:33:33 -0000 1.6 @@ -171,6 +171,11 @@ _D(("endDocument()\n"), LC_START_DOCUMENT); } +void RawDocumentGenerator::definePageStyle(const WPXPropertyList &propList) +{ + __iprintf("definePageStyle(%s)\n", getPropString(propList).cstr()); +} + void RawDocumentGenerator::openPageSpan(const WPXPropertyList &propList) { _U(("openPageSpan(%s)\n", getPropString(propList).cstr()), @@ -209,6 +214,11 @@ LC_OPEN_HEADER_FOOTER); } +void RawDocumentGenerator::defineParagraphStyle(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops) +{ + __iprintf("defineParagraphStyle(%s, tab-stops: %s)\n", getPropString(propList).cstr(), getPropString(tabStops).cstr()); +} + void RawDocumentGenerator::openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops) { _U(("openParagraph(%s, tab-stops: %s)\n", getPropString(propList).cstr(), getPropString(tabStops).cstr()), @@ -220,6 +230,11 @@ _D(("closeParagraph()\n"), LC_OPEN_PARAGRAPH); } +void RawDocumentGenerator::defineCharacterStyle(const WPXPropertyList &propList) +{ + __iprintf("defineCharacterStyle(%s)\n", getPropString(propList).cstr()); +} + void RawDocumentGenerator::openSpan(const WPXPropertyList &propList) { _U(("openSpan(%s)\n", getPropString(propList).cstr()), LC_OPEN_SPAN); @@ -230,6 +245,11 @@ _D(("closeSpan()\n"), LC_OPEN_SPAN); } +void RawDocumentGenerator::defineSectionStyle(const WPXPropertyList &propList, const WPXPropertyListVector &columns) +{ + __iprintf("defineSectionStyle(%s, columns: %s)\n", getPropString(propList).cstr(), getPropString(columns).cstr()); +} + void RawDocumentGenerator::openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns) { _U(("openSection(%s, columns: %s)\n", getPropString(propList).cstr(), getPropString(columns).cstr()), LC_OPEN_SECTION); Index: RawDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/raw/RawDocumentGenerator.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- RawDocumentGenerator.h 3 Jun 2010 21:23:19 -0000 1.5 +++ RawDocumentGenerator.h 4 Jun 2010 21:33:33 -0000 1.6 @@ -61,6 +61,7 @@ virtual void startDocument(); virtual void endDocument(); + virtual void definePageStyle(const WPXPropertyList &propList); virtual void openPageSpan(const WPXPropertyList &propList); virtual void closePageSpan(); virtual void openHeader(const WPXPropertyList &propList); @@ -68,10 +69,15 @@ virtual void openFooter(const WPXPropertyList &propList); virtual void closeFooter(); + virtual void defineParagraphStyle(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops); virtual void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops); virtual void closeParagraph(); + + virtual void defineCharacterStyle(const WPXPropertyList &propList); virtual void openSpan(const WPXPropertyList &propList); virtual void closeSpan(); + + virtual void defineSectionStyle(const WPXPropertyList &propList, const WPXPropertyListVector &columns); virtual void openSection(const WPXPropertyList &propList, const WPXPropertyListVector &columns); virtual void closeSection(); |
From: Fridrich S. <str...@us...> - 2010-06-04 21:33:41
|
Update of /cvsroot/libwpd/libwpd2/src/conv/text In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv20920/src/conv/text Modified Files: TextDocumentGenerator.h Log Message: Add noop callbacks that allow us later to start to support named styles Index: TextDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/text/TextDocumentGenerator.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- TextDocumentGenerator.h 3 Jun 2010 21:23:19 -0000 1.4 +++ TextDocumentGenerator.h 4 Jun 2010 21:33:33 -0000 1.5 @@ -39,6 +39,7 @@ virtual void startDocument() {} virtual void endDocument() {} + virtual void definePageStyle(const WPXPropertyList&) {} virtual void openPageSpan(const WPXPropertyList & /* propList */) {} virtual void closePageSpan() {} virtual void openHeader(const WPXPropertyList & /* propList */) {} @@ -46,10 +47,15 @@ virtual void openFooter(const WPXPropertyList & /* propList */) {} virtual void closeFooter() {} + virtual void defineSectionStyle(const WPXPropertyList&, const WPXPropertyListVector&) {} virtual void openSection(const WPXPropertyList & /* propList */, const WPXPropertyListVector & /* columns */) {} virtual void closeSection() {} + + virtual void defineParagraphStyle(const WPXPropertyList&, const WPXPropertyListVector&) {} virtual void openParagraph(const WPXPropertyList & /* propList */, const WPXPropertyListVector & /* tabStops */) {} virtual void closeParagraph(); + + virtual void defineCharacterStyle(const WPXPropertyList&) {} virtual void openSpan(const WPXPropertyList & /* propList */) {} virtual void closeSpan() {} |
From: Fridrich S. <str...@us...> - 2010-06-04 15:18:00
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv12684/src/lib Modified Files: WPXProperty.cpp WPXProperty.h WPXPropertyList.cpp Log Message: Implement WPXDoubleProperty as a non-abstract base type to hold generic floating point values Index: WPXPropertyList.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXPropertyList.cpp,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- WPXPropertyList.cpp 3 Dec 2008 12:16:00 -0000 1.13 +++ WPXPropertyList.cpp 4 Jun 2010 15:17:52 -0000 1.14 @@ -144,8 +144,10 @@ m_mapImpl->insert(name, WPXPropertyFactory::newPercentProp(val)); else if (units == WPX_POINT) m_mapImpl->insert(name, WPXPropertyFactory::newPointProp(val)); - else + else if (units == WPX_TWIP) m_mapImpl->insert(name, WPXPropertyFactory::newTwipProp(val)); + else if (units == WPX_GENERIC) + m_mapImpl->insert(name, WPXPropertyFactory::newDoubleProp(val)); } void WPXPropertyList::remove(const char * name) Index: WPXProperty.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXProperty.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- WPXProperty.cpp 3 Dec 2008 13:40:34 -0000 1.19 +++ WPXProperty.cpp 4 Jun 2010 15:17:52 -0000 1.20 @@ -67,6 +67,8 @@ WPXDoubleProperty(const double val); virtual int getInt() const; virtual double getDouble() const; + virtual WPXString getStr() const; + virtual WPXProperty * clone() const; private: double m_val; @@ -104,6 +106,14 @@ virtual WPXProperty * clone() const; }; +class WPXGenericProperty : public WPXDoubleProperty +{ +public: + WPXGenericProperty(const double val); + virtual WPXString getStr() const; + virtual WPXProperty * clone() const; +}; + WPXProperty::~WPXProperty() { } @@ -195,6 +205,17 @@ return m_val; } +WPXString WPXDoubleProperty::getStr() const +{ + WPXString str = doubleToString(getDouble()); + return str; +} + +WPXProperty * WPXDoubleProperty::clone() const +{ + return new WPXDoubleProperty(getDouble()); +} + WPXInchProperty::WPXInchProperty(const double val) : WPXDoubleProperty(val) { @@ -283,6 +304,11 @@ return static_cast<WPXProperty *>(new WPXBoolProperty(val)); } +WPXProperty * WPXPropertyFactory::newDoubleProp(const double val) +{ + return static_cast<WPXProperty *>(new WPXDoubleProperty(val)); +} + WPXProperty * WPXPropertyFactory::newInchProp(const double val) { return static_cast<WPXProperty *>(new WPXInchProperty(val)); Index: WPXProperty.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXProperty.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- WPXProperty.h 3 Dec 2008 12:16:00 -0000 1.14 +++ WPXProperty.h 4 Jun 2010 15:17:52 -0000 1.15 @@ -27,7 +27,7 @@ #define WPXPROPERTY_H #include "WPXString.h" -enum WPXUnit { WPX_INCH, WPX_PERCENT, WPX_POINT, WPX_TWIP }; +enum WPXUnit { WPX_INCH, WPX_PERCENT, WPX_POINT, WPX_TWIP, WPX_GENERIC }; class WPXProperty { @@ -46,6 +46,7 @@ static WPXProperty * newStringProp(const char *str); static WPXProperty * newIntProp(const int val); static WPXProperty * newBoolProp(const bool val); + static WPXProperty * newDoubleProp(const double val); static WPXProperty * newInchProp(const double val); static WPXProperty * newPercentProp(const double val); static WPXProperty * newPointProp(const double val); |
From: Fridrich S. <str...@us...> - 2010-06-04 09:21:37
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv366/filter Modified Files: OdgExporter.cxx Log Message: Empty gradient array means that object is not filled Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.40 retrieving revision 1.41 diff -u -d -r1.40 -r1.41 --- OdgExporter.cxx 3 Jun 2010 10:48:53 -0000 1.40 +++ OdgExporter.cxx 4 Jun 2010 09:21:29 -0000 1.41 @@ -610,12 +610,14 @@ if(mxStyle["libwpg:stroke-solid"] && mxStyle["libwpg:stroke-solid"]->getInt()) pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "solid"); +#if 0 else { pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "dash"); sValue.sprintf("Dash_%i", miDashIndex-1); pStyleGraphicsPropertiesElement->addAttribute("draw:stroke-dash", sValue); } +#endif } else pStyleGraphicsPropertiesElement->addAttribute("draw:stroke", "none"); @@ -633,11 +635,14 @@ } if(mxStyle["draw:fill"] && mxStyle["draw:fill"]->getStr() == "gradient") - { - pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "gradient"); - sValue.sprintf("Gradient_%i", miGradientIndex-1); - pStyleGraphicsPropertiesElement->addAttribute("draw:fill-gradient-name", sValue); - } + if (mxGradient.count() >= 2) + { + pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "gradient"); + sValue.sprintf("Gradient_%i", miGradientIndex-1); + pStyleGraphicsPropertiesElement->addAttribute("draw:fill-gradient-name", sValue); + } + else + pStyleGraphicsPropertiesElement->addAttribute("draw:fill", "none"); mGraphicsAutomaticStyles.push_back(pStyleGraphicsPropertiesElement); mGraphicsAutomaticStyles.push_back(new TagCloseElement("style:graphic-properties")); |
From: Fridrich S. <str...@us...> - 2010-06-03 21:23:55
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18672/filter Modified Files: WordPerfectCollector.cxx WordPerfectCollector.hxx Log Message: addapting to API changes in libwpd Index: WordPerfectCollector.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.cxx,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- WordPerfectCollector.cxx 3 Jun 2010 10:48:53 -0000 1.72 +++ WordPerfectCollector.cxx 3 Jun 2010 21:23:47 -0000 1.73 @@ -1229,9 +1229,9 @@ mWriterDocumentStates.top().mbInFrame = false; } -void WordPerfectCollector::insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &object) +void WordPerfectCollector::insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &data) { - if (!object.size()) + if (!data.size()) return; if (!mWriterDocumentStates.top().mbInFrame) // Embedded objects without a frame simply don't make sense for us return; @@ -1247,10 +1247,10 @@ libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT; - if (!libwpg::WPGraphics::isSupported(const_cast<WPXInputStream *>(object.getDataStream()))) + if (!libwpg::WPGraphics::isSupported(const_cast<WPXInputStream *>(data.getDataStream()))) fileFormat = libwpg::WPG_WPG1; - if (libwpg::WPGraphics::parse(const_cast<WPXInputStream *>(object.getDataStream()), &exporter, fileFormat) && !tmpContentElements.empty()) + if (libwpg::WPGraphics::parse(const_cast<WPXInputStream *>(data.getDataStream()), &exporter, fileFormat) && !tmpContentElements.empty()) { mpCurrentContentElements->push_back(new TagOpenElement("draw:object")); for (std::vector<DocumentElement *>::const_iterator iter = tmpContentElements.begin(); iter != tmpContentElements.end(); iter++) @@ -1265,7 +1265,7 @@ mpCurrentContentElements->push_back(new TagOpenElement("office:binary-data")); - WPXString binaryBase64Data = object.getBase64Data(); + WPXString binaryBase64Data = data.getBase64Data(); mpCurrentContentElements->push_back(new CharDataElement(binaryBase64Data.cstr())); Index: WordPerfectCollector.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.hxx,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- WordPerfectCollector.hxx 3 Jun 2010 10:48:53 -0000 1.37 +++ WordPerfectCollector.hxx 3 Jun 2010 21:23:48 -0000 1.38 @@ -154,7 +154,8 @@ virtual void openFrame(const WPXPropertyList & propList); virtual void closeFrame(); - virtual void insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &object); + virtual void insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &data); + virtual void insertEquation(const WPXPropertyList & /* propList */, const WPXString & /* data */) {} protected: void _resetDocumentState(); |
From: Fridrich S. <str...@us...> - 2010-06-03 21:23:28
|
Update of /cvsroot/libwpd/libwpd2/src/conv/raw In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18545/src/conv/raw Modified Files: RawDocumentGenerator.cpp RawDocumentGenerator.h Log Message: Adding a NOOP callback for a future posibility of adding an equation in mathml or latex of whatever style Index: RawDocumentGenerator.cpp =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/raw/RawDocumentGenerator.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- RawDocumentGenerator.cpp 29 Oct 2008 19:58:54 -0000 1.4 +++ RawDocumentGenerator.cpp 3 Jun 2010 21:23:19 -0000 1.5 @@ -247,8 +247,7 @@ void RawDocumentGenerator::insertText(const WPXString &text) { - WPXString textUTF8(text); - __iprintf("insertText(text: %s)\n", textUTF8.cstr()); + __iprintf("insertText(text: %s)\n", text.cstr()); } void RawDocumentGenerator::insertLineBreak() @@ -392,7 +391,12 @@ _D(("closeFrame()\n"), LC_OPEN_FRAME); } -void RawDocumentGenerator::insertBinaryObject(const WPXPropertyList & propList, const WPXBinaryData & /* object */) +void RawDocumentGenerator::insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData & /* data */) { __iprintf("insertBinaryObject(%s)\n", getPropString(propList).cstr()); } + +void RawDocumentGenerator::insertEquation(const WPXPropertyList &propList, const WPXString &data) +{ + __iprintf("insertEquation(%s, text: %s)\n", getPropString(propList).cstr(), data.cstr()); +} Index: RawDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/raw/RawDocumentGenerator.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- RawDocumentGenerator.h 29 Oct 2008 19:58:54 -0000 1.4 +++ RawDocumentGenerator.h 3 Jun 2010 21:23:19 -0000 1.5 @@ -108,7 +108,8 @@ virtual void openFrame(const WPXPropertyList &propList); virtual void closeFrame(); - virtual void insertBinaryObject(const WPXPropertyList & propList, const WPXBinaryData &object); + virtual void insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &data); + virtual void insertEquation(const WPXPropertyList &propList, const WPXString &data); private: int m_indent; |
From: Fridrich S. <str...@us...> - 2010-06-03 21:23:27
|
Update of /cvsroot/libwpd/libwpd2/src/conv/text In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18545/src/conv/text Modified Files: TextDocumentGenerator.h Log Message: Adding a NOOP callback for a future posibility of adding an equation in mathml or latex of whatever style Index: TextDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/text/TextDocumentGenerator.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- TextDocumentGenerator.h 29 Oct 2008 19:58:54 -0000 1.3 +++ TextDocumentGenerator.h 3 Jun 2010 21:23:19 -0000 1.4 @@ -87,6 +87,7 @@ virtual void closeFrame() {} virtual void insertBinaryObject(const WPXPropertyList & /* propList */, const WPXBinaryData & /* object */) {} + virtual void insertEquation(const WPXPropertyList & /* propList */, const WPXString & /* data */) {} private: unsigned int m_currentListLevel; |
From: Fridrich S. <str...@us...> - 2010-06-03 21:23:27
|
Update of /cvsroot/libwpd/libwpd2/src/conv/html In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18545/src/conv/html Modified Files: HtmlDocumentGenerator.h Log Message: Adding a NOOP callback for a future posibility of adding an equation in mathml or latex of whatever style Index: HtmlDocumentGenerator.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/conv/html/HtmlDocumentGenerator.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- HtmlDocumentGenerator.h 10 Sep 2009 20:01:25 -0000 1.7 +++ HtmlDocumentGenerator.h 3 Jun 2010 21:23:19 -0000 1.8 @@ -89,7 +89,8 @@ virtual void openFrame(const WPXPropertyList & /* propList */) {} virtual void closeFrame() {} - virtual void insertBinaryObject(const WPXPropertyList & /* propList */, const WPXBinaryData & /* object */) {} + virtual void insertBinaryObject(const WPXPropertyList & /* propList */, const WPXBinaryData & /* data */) {} + virtual void insertEquation(const WPXPropertyList & /* propList */, const WPXString & /* data */) {} private: bool m_ignore; |
From: Fridrich S. <str...@us...> - 2010-06-03 21:23:27
|
Update of /cvsroot/libwpd/libwpd2/src/lib In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18545/src/lib Modified Files: WPXDocumentInterface.h Log Message: Adding a NOOP callback for a future posibility of adding an equation in mathml or latex of whatever style Index: WPXDocumentInterface.h =================================================================== RCS file: /cvsroot/libwpd/libwpd2/src/lib/WPXDocumentInterface.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- WPXDocumentInterface.h 4 Nov 2008 09:57:58 -0000 1.12 +++ WPXDocumentInterface.h 3 Jun 2010 21:23:19 -0000 1.13 @@ -416,6 +416,13 @@ \param data Reference to the binary object */ virtual void insertBinaryObject(const WPXPropertyList &propList, const WPXBinaryData &data) = 0; + /** + Called when a mathml object should be inserted + \param propList Defines a set of properties for the object. + \li \c libwpd:mimetype The mimetype of the object + \param data Reference to the string containing the equation representation + */ + virtual void insertEquation(const WPXPropertyList &propList, const WPXString &data) = 0; }; #endif /* WPXDOCUMENTINTERFACEIMPL_H */ |
From: Fridrich S. <str...@us...> - 2010-06-03 10:49:03
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11909/filter Modified Files: FilterInternal.hxx OdgExporter.cxx OdgExporter.hxx WordPerfectCollector.cxx WordPerfectCollector.hxx Log Message: Putting the right elements into the right streams for ODG Index: WordPerfectCollector.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.cxx,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- WordPerfectCollector.cxx 3 Jun 2010 08:55:39 -0000 1.71 +++ WordPerfectCollector.cxx 3 Jun 2010 10:48:53 -0000 1.72 @@ -75,7 +75,7 @@ { } -WordPerfectCollector::WordPerfectCollector(WPXInputStream *pInput, const char * password, DocumentHandler *pHandler, const bool isFlatXML) : +WordPerfectCollector::WordPerfectCollector(WPXInputStream *pInput, const char * password, DocumentHandler *pHandler, const OdfStreamType streamType) : mpInput(pInput), mpHandler(pHandler), mbUsed(false), @@ -87,7 +87,7 @@ mpCurrentPageSpan(NULL), miNumPageStyles(0), miObjectNumber(0), - mbIsFlatXML(isFlatXML), + mxStreamType(streamType), mpPassword(password) { mWriterDocumentStates.push(WriterDocumentState()); @@ -304,7 +304,7 @@ docContentPropList.insert("xmlns:script", "urn:oasis:names:tc:opendocument:xmlns:script:1.0"); docContentPropList.insert("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0"); docContentPropList.insert("office:version", "1.0"); - if (mbIsFlatXML) + if (mxStreamType == ODF_FLAT_XML) { docContentPropList.insert("office:mimetype", "application/vnd.oasis.opendocument.text"); mpHandler->startElement("office:document", docContentPropList); @@ -399,7 +399,7 @@ pHandler->endElement("office:text"); pHandler->endElement("office:body"); - if (mbIsFlatXML) + if (mxStreamType == ODF_FLAT_XML) pHandler->endElement("office:document"); else pHandler->endElement("office:document-content"); @@ -1243,7 +1243,7 @@ #ifdef USE_LIBWPG std::vector<DocumentElement *> tmpContentElements; InternalHandler tmpHandler(&tmpContentElements); - OdgExporter exporter(&tmpHandler, ODG_FLAT_XML); + OdgExporter exporter(&tmpHandler, ODF_FLAT_XML); libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT; Index: WordPerfectCollector.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.hxx,v retrieving revision 1.36 retrieving revision 1.37 diff -u -d -r1.36 -r1.37 --- WordPerfectCollector.hxx 3 Dec 2008 13:00:31 -0000 1.36 +++ WordPerfectCollector.hxx 3 Jun 2010 10:48:53 -0000 1.37 @@ -31,6 +31,7 @@ #ifndef _WORDPERFECTCOLLECTOR_H #define _WORDPERFECTCOLLECTOR_H #include "SectionStyle.hxx" +#include "FilterInternal.hxx" #include <libwpd/libwpd.h> #include <vector> @@ -93,7 +94,7 @@ class WordPerfectCollector : public WPXDocumentInterface { public: - WordPerfectCollector(WPXInputStream *pInput, const char * password, DocumentHandler *pHandler, const bool isFlatXML = false); + WordPerfectCollector(WPXInputStream *pInput, const char * password, DocumentHandler *pHandler, const OdfStreamType streamType); virtual ~WordPerfectCollector(); bool filter(); @@ -225,7 +226,7 @@ // table state TableStyle *mpCurrentTableStyle; - const bool mbIsFlatXML; + const OdfStreamType mxStreamType; const char * mpPassword; }; Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.39 retrieving revision 1.40 diff -u -d -r1.39 -r1.40 --- OdgExporter.cxx 3 Jun 2010 09:30:44 -0000 1.39 +++ OdgExporter.cxx 3 Jun 2010 10:48:53 -0000 1.40 @@ -35,7 +35,7 @@ #define M_PI 3.14159265358979323846 #endif -OdgExporter::OdgExporter(DocumentHandler *pHandler, const OdgStreamType streamType): +OdgExporter::OdgExporter(DocumentHandler *pHandler, const OdfStreamType streamType): mpHandler(pHandler), miGradientIndex(1), miDashIndex(1), @@ -82,13 +82,19 @@ mfWidth = 0.0; mfHeight = 0.0; + if (propList["svg:width"]) + mfWidth = propList["svg:width"]->getDouble(); + + if (propList["svg:height"]) + mfHeight = propList["svg:height"]->getDouble(); + mpHandler->startDocument(); TagOpenElement tmpOfficeDocumentContent( - (mxStreamType == ODG_FLAT_XML) ? "office:document" : ( - (mxStreamType == ODG_CONTENT_XML) ? "office:document-content" : ( - (mxStreamType == ODG_STYLES_XML) ? "office:document-styles" : ( - (mxStreamType == ODG_SETTINGS_XML) ? "office:document-settings" : ( - (mxStreamType == ODG_META_XML) ? "office:document-meta" : "office:document" ))))); + (mxStreamType == ODF_FLAT_XML) ? "office:document" : ( + (mxStreamType == ODF_CONTENT_XML) ? "office:document-content" : ( + (mxStreamType == ODF_STYLES_XML) ? "office:document-styles" : ( + (mxStreamType == ODF_SETTINGS_XML) ? "office:document-settings" : ( + (mxStreamType == ODF_META_XML) ? "office:document-meta" : "office:document" ))))); tmpOfficeDocumentContent.addAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0"); tmpOfficeDocumentContent.addAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0"); tmpOfficeDocumentContent.addAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0"); @@ -99,11 +105,11 @@ tmpOfficeDocumentContent.addAttribute("xmlns:config", "urn:oasis:names:tc:opendocument:xmlns:config:1.0"); tmpOfficeDocumentContent.addAttribute("xmlns:ooo", "http://openoffice.org/2004/office"); tmpOfficeDocumentContent.addAttribute("office:version", "1.0"); - if (mxStreamType == ODG_FLAT_XML) + if (mxStreamType == ODF_FLAT_XML) tmpOfficeDocumentContent.addAttribute("office:mimetype", "application/vnd.oasis.opendocument.graphics"); tmpOfficeDocumentContent.write(mpHandler); - if ((mxStreamType == ODG_FLAT_XML) || (mxStreamType == ODG_SETTINGS_XML)) + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_SETTINGS_XML)) { TagOpenElement("office:settings").write(mpHandler); @@ -128,8 +134,6 @@ configItemOpenElement.addAttribute("config:name", "VisibleAreaWidth"); configItemOpenElement.addAttribute("config:type", "int"); configItemOpenElement.write(mpHandler); - if (propList["svg:width"]) - mfWidth = propList["svg:width"]->getDouble(); WPXString sWidth; sWidth.sprintf("%li", (unsigned long)(2540 * mfWidth)); mpHandler->characters(sWidth); mpHandler->endElement("config:config-item"); @@ -137,8 +141,6 @@ configItemOpenElement.addAttribute("config:name", "VisibleAreaHeight"); configItemOpenElement.addAttribute("config:type", "int"); configItemOpenElement.write(mpHandler); - if (propList["svg:height"]) - mfHeight = propList["svg:height"]->getDouble(); WPXString sHeight; sHeight.sprintf("%li", (unsigned long)(2540 * mfHeight)); mpHandler->characters(sHeight); mpHandler->endElement("config:config-item"); @@ -151,7 +153,7 @@ void OdgExporter::endGraphics() { - if ((mxStreamType == ODG_FLAT_XML) || (mxStreamType == ODG_STYLES_XML)) + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_STYLES_XML)) { TagOpenElement("office:styles").write(mpHandler); @@ -171,17 +173,23 @@ } - if ((mxStreamType == ODG_FLAT_XML) || (mxStreamType == ODG_CONTENT_XML)) + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_CONTENT_XML) || (mxStreamType == ODF_STYLES_XML)) { TagOpenElement("office:automatic-styles").write(mpHandler); + } + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_CONTENT_XML)) + { // writing out the graphics automatic styles for (std::vector<DocumentElement *>::iterator iterGraphicsAutomaticStyles = mGraphicsAutomaticStyles.begin(); iterGraphicsAutomaticStyles != mGraphicsAutomaticStyles.end(); iterGraphicsAutomaticStyles++) { (*iterGraphicsAutomaticStyles)->write(mpHandler); } + } + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_STYLES_XML)) + { TagOpenElement tmpStylePageLayoutOpenElement("style:page-layout"); tmpStylePageLayoutOpenElement.addAttribute("style:name", "PM0"); tmpStylePageLayoutOpenElement.write(mpHandler); @@ -216,10 +224,15 @@ mpHandler->endElement("style:drawing-page-properties"); mpHandler->endElement("style:style"); + } + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_CONTENT_XML) || (mxStreamType == ODF_STYLES_XML)) + { mpHandler->endElement("office:automatic-styles"); + } - + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_STYLES_XML)) + { TagOpenElement("office:master-styles").write(mpHandler); TagOpenElement tmpStyleMasterPageOpenElement("style:master-page"); @@ -231,7 +244,10 @@ mpHandler->endElement("style:master-page"); mpHandler->endElement("office:master-styles"); - + } + + if ((mxStreamType == ODF_FLAT_XML) || (mxStreamType == ODF_CONTENT_XML)) + { TagOpenElement("office:body").write(mpHandler); TagOpenElement("office:drawing").write(mpHandler); @@ -254,11 +270,11 @@ } mpHandler->endElement( - (mxStreamType == ODG_FLAT_XML) ? "office:document" : ( - (mxStreamType == ODG_CONTENT_XML) ? "office:document-content" : ( - (mxStreamType == ODG_STYLES_XML) ? "office:document-styles" : ( - (mxStreamType == ODG_SETTINGS_XML) ? "office:document-settings" : ( - (mxStreamType == ODG_META_XML) ? "office:document-meta" : "office:document" ))))); + (mxStreamType == ODF_FLAT_XML) ? "office:document" : ( + (mxStreamType == ODF_CONTENT_XML) ? "office:document-content" : ( + (mxStreamType == ODF_STYLES_XML) ? "office:document-styles" : ( + (mxStreamType == ODF_SETTINGS_XML) ? "office:document-settings" : ( + (mxStreamType == ODF_META_XML) ? "office:document-meta" : "office:document" ))))); mpHandler->endDocument(); } Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- OdgExporter.hxx 3 Jun 2010 08:55:39 -0000 1.18 +++ OdgExporter.hxx 3 Jun 2010 10:48:53 -0000 1.19 @@ -33,12 +33,11 @@ #include <libwpg/libwpg.h> #include "DocumentElement.hxx" #include "DocumentHandler.hxx" - -enum OdgStreamType { ODG_FLAT_XML, ODG_CONTENT_XML, ODG_STYLES_XML, ODG_SETTINGS_XML, ODG_META_XML }; +#include "FilterInternal.hxx" class OdgExporter : public libwpg::WPGPaintInterface { public: - OdgExporter(DocumentHandler *pHandler, const OdgStreamType streamType); + OdgExporter(DocumentHandler *pHandler, const OdfStreamType streamType); ~OdgExporter(); void startGraphics(const ::WPXPropertyList &propList); @@ -81,7 +80,7 @@ double mfWidth; double mfHeight; - const OdgStreamType mxStreamType; + const OdfStreamType mxStreamType; }; #endif // __ODGEXPORTER_HXX__ Index: FilterInternal.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/FilterInternal.hxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- FilterInternal.hxx 3 Dec 2008 13:00:31 -0000 1.5 +++ FilterInternal.hxx 3 Jun 2010 10:48:53 -0000 1.6 @@ -19,6 +19,9 @@ * For further information visit http://libwpd.sourceforge.net * */ +#ifndef __FILTERINTERNAL_HXX__ +#define __FILTERINTERNAL_HXX__ + #include <stdio.h> #ifdef DEBUG #define WRITER_DEBUG_MSG(M) printf M @@ -26,6 +29,10 @@ #define WRITER_DEBUG_MSG(M) #endif +enum OdfStreamType { ODF_FLAT_XML, ODF_CONTENT_XML, ODF_STYLES_XML, ODF_SETTINGS_XML, ODF_META_XML }; + const double fDefaultSideMargin = 1.0; // inches const double fDefaultPageWidth = 8.5f; // inches (OOo required default: we will handle this later) const double fDefaultPageHeight = 11.0; // inches + +#endif |
From: Fridrich S. <str...@us...> - 2010-06-03 10:49:01
|
Update of /cvsroot/libwpd/writerperfect/cmdline In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv11909/cmdline Modified Files: OutputFileHelper.cxx OutputFileHelper.hxx wpd2odt.cxx wpg2odg.cxx Log Message: Putting the right elements into the right streams for ODG Index: wpg2odg.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/wpg2odg.cxx,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- wpg2odg.cxx 3 Jun 2010 09:30:44 -0000 1.19 +++ wpg2odg.cxx 3 Jun 2010 10:48:52 -0000 1.20 @@ -31,7 +31,7 @@ const char manifestStr[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\">" - " <manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.drawing\" manifest:version=\"1.2\" manifest:full-path=\"/\"/>" + " <manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.graphics\" manifest:version=\"1.0\" manifest:full-path=\"/\"/>" " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"content.xml\"/>" " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"settings.xml\"/>" " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"styles.xml\"/>" @@ -55,7 +55,7 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char * /* password */, DocumentHandler *handler, OdgStreamType streamType) + bool _convertDocument(WPXInputStream *input, const char * /* password */, DocumentHandler *handler, OdfStreamType streamType) { OdgExporter exporter(handler, streamType); return libwpg::WPGraphics::parse(input, &exporter); @@ -112,19 +112,19 @@ return 1; } - if (szOutFile && !helper.writeConvertedContent("settings.xml", szInputFile, ODG_SETTINGS_XML)) + if (szOutFile && !helper.writeConvertedContent("settings.xml", szInputFile, ODF_SETTINGS_XML)) { fprintf(stderr, "ERROR : Couldn't write document settings\n"); return 1; } - if (szOutFile && !helper.writeConvertedContent("styles.xml", szInputFile, ODG_STYLES_XML)) + if (szOutFile && !helper.writeConvertedContent("styles.xml", szInputFile, ODF_STYLES_XML)) { fprintf(stderr, "ERROR : Couldn't write document styles\n"); return 1; } - if (!helper.writeConvertedContent("content.xml", szInputFile, szOutFile ? ODG_CONTENT_XML : ODG_FLAT_XML)) + if (!helper.writeConvertedContent("content.xml", szInputFile, szOutFile ? ODF_CONTENT_XML : ODF_FLAT_XML)) { fprintf(stderr, "ERROR : Couldn't write document content\n"); return 1; Index: OutputFileHelper.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/OutputFileHelper.cxx,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- OutputFileHelper.cxx 3 Jun 2010 09:30:44 -0000 1.6 +++ OutputFileHelper.cxx 3 Jun 2010 10:48:52 -0000 1.7 @@ -180,7 +180,7 @@ #endif } -bool OutputFileHelper::writeConvertedContent(const char *childFileName, const char *inFileName, const OdgStreamType streamType) +bool OutputFileHelper::writeConvertedContent(const char *childFileName, const char *inFileName, const OdfStreamType streamType) { WPXFileStream input(inFileName); @@ -208,7 +208,7 @@ else pHandler = new StdOutHandler(); - bool bRetVal = _convertDocument(&input, m_impl->mpPassword, pHandler, m_impl->mpOutfile ? streamType : ODG_FLAT_XML); + bool bRetVal = _convertDocument(&input, m_impl->mpPassword, pHandler, m_impl->mpOutfile ? streamType : ODF_FLAT_XML); #ifdef USE_GSF_OUTPUT if (pContentChild) Index: wpd2odt.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/wpd2odt.cxx,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- wpd2odt.cxx 3 Jun 2010 09:30:44 -0000 1.22 +++ wpd2odt.cxx 3 Jun 2010 10:48:52 -0000 1.23 @@ -142,7 +142,7 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const OdgStreamType streamType) + bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const OdfStreamType streamType) { WordPerfectCollector collector(input, password, handler, streamType); return collector.filter(); @@ -216,7 +216,7 @@ return 1; } - if (!helper.writeConvertedContent("content.xml", szInputFile, ODG_CONTENT_XML)) + if (!helper.writeConvertedContent("content.xml", szInputFile, szOutFile ? ODF_CONTENT_XML : ODF_FLAT_XML)) { fprintf(stderr, "ERROR : Couldn't write document content\n"); return 1; Index: OutputFileHelper.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/OutputFileHelper.hxx,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- OutputFileHelper.hxx 3 Jun 2010 09:30:44 -0000 1.3 +++ OutputFileHelper.hxx 3 Jun 2010 10:48:52 -0000 1.4 @@ -34,11 +34,11 @@ bool writeChildFile(const char *childFileName, const char *str); bool writeChildFile(const char *childFileName, const char *str, const char compression_level); - bool writeConvertedContent(const char *childFileName, const char *inFileName, const OdgStreamType streamType); + bool writeConvertedContent(const char *childFileName, const char *inFileName, const OdfStreamType streamType); private: virtual bool _isSupportedFormat(WPXInputStream *input, const char *password) = 0; - virtual bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const OdgStreamType streamType) = 0; + virtual bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const OdfStreamType streamType) = 0; OutputFileHelperImpl* m_impl; }; |
From: Fridrich S. <str...@us...> - 2010-06-03 09:30:53
|
Update of /cvsroot/libwpd/writerperfect/cmdline In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21309/cmdline Modified Files: FemtoZip.cxx OutputFileHelper.cxx OutputFileHelper.hxx wpd2odt.cxx wpg2odg.cxx Log Message: Some more code of separating different streams Index: wpg2odg.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/wpg2odg.cxx,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- wpg2odg.cxx 24 Apr 2008 07:21:59 -0000 1.18 +++ wpg2odg.cxx 3 Jun 2010 09:30:44 -0000 1.19 @@ -31,9 +31,10 @@ const char manifestStr[] = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>" "<manifest:manifest xmlns:manifest=\"urn:oasis:names:tc:opendocument:xmlns:manifest:1.0\">" - " <manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.drawing\" manifest:full-path=\"/\"/>" + " <manifest:file-entry manifest:media-type=\"application/vnd.oasis.opendocument.drawing\" manifest:version=\"1.2\" manifest:full-path=\"/\"/>" " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"content.xml\"/>" -// " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"styles.xml\"/>" + " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"settings.xml\"/>" + " <manifest:file-entry manifest:media-type=\"text/xml\" manifest:full-path=\"styles.xml\"/>" "</manifest:manifest>"; class OdgOutputFileHelper : public OutputFileHelper @@ -54,9 +55,9 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char * /* password */, DocumentHandler *handler, bool isFlatXML) + bool _convertDocument(WPXInputStream *input, const char * /* password */, DocumentHandler *handler, OdgStreamType streamType) { - OdgExporter exporter(handler, isFlatXML); + OdgExporter exporter(handler, streamType); return libwpg::WPGraphics::parse(input, &exporter); } }; @@ -111,13 +112,19 @@ return 1; } - if (szOutFile && !helper.writeConvertedContent("styles.xml", szInputFile)) + if (szOutFile && !helper.writeConvertedContent("settings.xml", szInputFile, ODG_SETTINGS_XML)) + { + fprintf(stderr, "ERROR : Couldn't write document settings\n"); + return 1; + } + + if (szOutFile && !helper.writeConvertedContent("styles.xml", szInputFile, ODG_STYLES_XML)) { fprintf(stderr, "ERROR : Couldn't write document styles\n"); return 1; } - if (!helper.writeConvertedContent("content.xml", szInputFile)) + if (!helper.writeConvertedContent("content.xml", szInputFile, szOutFile ? ODG_CONTENT_XML : ODG_FLAT_XML)) { fprintf(stderr, "ERROR : Couldn't write document content\n"); return 1; Index: OutputFileHelper.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/OutputFileHelper.cxx,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- OutputFileHelper.cxx 22 Nov 2007 12:23:39 -0000 1.5 +++ OutputFileHelper.cxx 3 Jun 2010 09:30:44 -0000 1.6 @@ -180,7 +180,7 @@ #endif } -bool OutputFileHelper::writeConvertedContent(const char *childFileName, const char *inFileName) +bool OutputFileHelper::writeConvertedContent(const char *childFileName, const char *inFileName, const OdgStreamType streamType) { WPXFileStream input(inFileName); @@ -190,7 +190,6 @@ input.seek(0, WPX_SEEK_SET); DocumentHandler *pHandler; - bool tmpIsFlatXML = true; #ifdef USE_GSF_OUTPUT GsfOutput *pContentChild = NULL; if (m_impl->mpOutfile) @@ -205,12 +204,11 @@ return false; pHandler = new DiskDocumentHandler(m_impl->mpOutfile); #endif - tmpIsFlatXML = false; } else pHandler = new StdOutHandler(); - bool bRetVal = _convertDocument(&input, m_impl->mpPassword, pHandler, tmpIsFlatXML); + bool bRetVal = _convertDocument(&input, m_impl->mpPassword, pHandler, m_impl->mpOutfile ? streamType : ODG_FLAT_XML); #ifdef USE_GSF_OUTPUT if (pContentChild) Index: wpd2odt.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/wpd2odt.cxx,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- wpd2odt.cxx 28 Nov 2007 21:14:49 -0000 1.21 +++ wpd2odt.cxx 3 Jun 2010 09:30:44 -0000 1.22 @@ -142,9 +142,9 @@ return true; } - bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, bool isFlatXML) + bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const OdgStreamType streamType) { - WordPerfectCollector collector(input, password, handler, isFlatXML); + WordPerfectCollector collector(input, password, handler, streamType); return collector.filter(); } }; @@ -216,7 +216,7 @@ return 1; } - if (!helper.writeConvertedContent("content.xml", szInputFile)) + if (!helper.writeConvertedContent("content.xml", szInputFile, ODG_CONTENT_XML)) { fprintf(stderr, "ERROR : Couldn't write document content\n"); return 1; Index: FemtoZip.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/FemtoZip.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FemtoZip.cxx 15 Aug 2008 12:18:31 -0000 1.2 +++ FemtoZip.cxx 3 Jun 2010 09:30:44 -0000 1.3 @@ -249,7 +249,7 @@ FemtoZipEntry* entry = entryList; while(entry && (errorCode == FemtoZip::NoError)) { - FZ_DEBUG(("central directory: entry for %s", entry->name)); + FZ_DEBUG(("central directory: entry for %s\n", entry->name)); size_t namelen = strlen(entry->name); /* Index: OutputFileHelper.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/cmdline/OutputFileHelper.hxx,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- OutputFileHelper.hxx 22 Nov 2007 12:23:40 -0000 1.2 +++ OutputFileHelper.hxx 3 Jun 2010 09:30:44 -0000 1.3 @@ -20,6 +20,8 @@ #ifndef _OUTPUTFILEHELPER_HXX #define _OUTPUTFILEHELPER_HXX +#include <OdgExporter.hxx> + class DocumentHandler; class WPXInputStream; class OutputFileHelperImpl; @@ -32,11 +34,11 @@ bool writeChildFile(const char *childFileName, const char *str); bool writeChildFile(const char *childFileName, const char *str, const char compression_level); - bool writeConvertedContent(const char *childFileName, const char *inFileName); + bool writeConvertedContent(const char *childFileName, const char *inFileName, const OdgStreamType streamType); private: virtual bool _isSupportedFormat(WPXInputStream *input, const char *password) = 0; - virtual bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const bool isFlatXML) = 0; + virtual bool _convertDocument(WPXInputStream *input, const char *password, DocumentHandler *handler, const OdgStreamType streamType) = 0; OutputFileHelperImpl* m_impl; }; |
From: Fridrich S. <str...@us...> - 2010-06-03 09:30:52
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv21309/filter Modified Files: OdgExporter.cxx Log Message: Some more code of separating different streams Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.38 retrieving revision 1.39 diff -u -d -r1.38 -r1.39 --- OdgExporter.cxx 3 Jun 2010 08:55:38 -0000 1.38 +++ OdgExporter.cxx 3 Jun 2010 09:30:44 -0000 1.39 @@ -251,10 +251,16 @@ mpHandler->endElement("draw:page"); mpHandler->endElement("office:drawing"); mpHandler->endElement("office:body"); - mpHandler->endElement("office:document"); - - mpHandler->endDocument(); } + + mpHandler->endElement( + (mxStreamType == ODG_FLAT_XML) ? "office:document" : ( + (mxStreamType == ODG_CONTENT_XML) ? "office:document-content" : ( + (mxStreamType == ODG_STYLES_XML) ? "office:document-styles" : ( + (mxStreamType == ODG_SETTINGS_XML) ? "office:document-settings" : ( + (mxStreamType == ODG_META_XML) ? "office:document-meta" : "office:document" ))))); + + mpHandler->endDocument(); } void OdgExporter::setStyle(const ::WPXPropertyListVector& gradient, const ::WPXPropertyList & propList) |
From: Fridrich S. <str...@us...> - 2010-06-03 08:55:47
|
Update of /cvsroot/libwpd/writerperfect/filter In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv10473 Modified Files: OdgExporter.cxx OdgExporter.hxx WordPerfectCollector.cxx Log Message: trying to separate ODG streams Index: WordPerfectCollector.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/WordPerfectCollector.cxx,v retrieving revision 1.70 retrieving revision 1.71 diff -u -d -r1.70 -r1.71 --- WordPerfectCollector.cxx 14 Apr 2010 08:39:12 -0000 1.70 +++ WordPerfectCollector.cxx 3 Jun 2010 08:55:39 -0000 1.71 @@ -1243,7 +1243,7 @@ #ifdef USE_LIBWPG std::vector<DocumentElement *> tmpContentElements; InternalHandler tmpHandler(&tmpContentElements); - OdgExporter exporter(&tmpHandler, true); + OdgExporter exporter(&tmpHandler, ODG_FLAT_XML); libwpg::WPGFileFormat fileFormat = libwpg::WPG_AUTODETECT; Index: OdgExporter.cxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.cxx,v retrieving revision 1.37 retrieving revision 1.38 diff -u -d -r1.37 -r1.38 --- OdgExporter.cxx 3 Jun 2010 08:02:55 -0000 1.37 +++ OdgExporter.cxx 3 Jun 2010 08:55:38 -0000 1.38 @@ -35,14 +35,14 @@ #define M_PI 3.14159265358979323846 #endif -OdgExporter::OdgExporter(DocumentHandler *pHandler, const bool isFlatXML): +OdgExporter::OdgExporter(DocumentHandler *pHandler, const OdgStreamType streamType): mpHandler(pHandler), miGradientIndex(1), miDashIndex(1), miGraphicsStyleIndex(1), mfWidth(0.0), mfHeight(0.0), - mbIsFlatXML(isFlatXML) + mxStreamType(streamType) { } @@ -83,7 +83,12 @@ mfHeight = 0.0; mpHandler->startDocument(); - TagOpenElement tmpOfficeDocumentContent("office:document"); + TagOpenElement tmpOfficeDocumentContent( + (mxStreamType == ODG_FLAT_XML) ? "office:document" : ( + (mxStreamType == ODG_CONTENT_XML) ? "office:document-content" : ( + (mxStreamType == ODG_STYLES_XML) ? "office:document-styles" : ( + (mxStreamType == ODG_SETTINGS_XML) ? "office:document-settings" : ( + (mxStreamType == ODG_META_XML) ? "office:document-meta" : "office:document" ))))); tmpOfficeDocumentContent.addAttribute("xmlns:office", "urn:oasis:names:tc:opendocument:xmlns:office:1.0"); tmpOfficeDocumentContent.addAttribute("xmlns:style", "urn:oasis:names:tc:opendocument:xmlns:style:1.0"); tmpOfficeDocumentContent.addAttribute("xmlns:text", "urn:oasis:names:tc:opendocument:xmlns:text:1.0"); @@ -94,152 +99,162 @@ tmpOfficeDocumentContent.addAttribute("xmlns:config", "urn:oasis:names:tc:opendocument:xmlns:config:1.0"); tmpOfficeDocumentContent.addAttribute("xmlns:ooo", "http://openoffice.org/2004/office"); tmpOfficeDocumentContent.addAttribute("office:version", "1.0"); - if (mbIsFlatXML) + if (mxStreamType == ODG_FLAT_XML) tmpOfficeDocumentContent.addAttribute("office:mimetype", "application/vnd.oasis.opendocument.graphics"); tmpOfficeDocumentContent.write(mpHandler); - TagOpenElement("office:settings").write(mpHandler); + if ((mxStreamType == ODG_FLAT_XML) || (mxStreamType == ODG_SETTINGS_XML)) + { + TagOpenElement("office:settings").write(mpHandler); - TagOpenElement configItemSetOpenElement("config:config-item-set"); - configItemSetOpenElement.addAttribute("config:name", "ooo:view-settings"); - configItemSetOpenElement.write(mpHandler); + TagOpenElement configItemSetOpenElement("config:config-item-set"); + configItemSetOpenElement.addAttribute("config:name", "ooo:view-settings"); + configItemSetOpenElement.write(mpHandler); - TagOpenElement configItemOpenElement("config:config-item"); + TagOpenElement configItemOpenElement("config:config-item"); - configItemOpenElement.addAttribute("config:name", "VisibleAreaTop"); - configItemOpenElement.addAttribute("config:type", "int"); - configItemOpenElement.write(mpHandler); - mpHandler->characters("0"); - mpHandler->endElement("config:config-item"); + configItemOpenElement.addAttribute("config:name", "VisibleAreaTop"); + configItemOpenElement.addAttribute("config:type", "int"); + configItemOpenElement.write(mpHandler); + mpHandler->characters("0"); + mpHandler->endElement("config:config-item"); - configItemOpenElement.addAttribute("config:name", "VisibleAreaLeft"); - configItemOpenElement.addAttribute("config:type", "int"); - configItemOpenElement.write(mpHandler); - mpHandler->characters("0"); - mpHandler->endElement("config:config-item"); + configItemOpenElement.addAttribute("config:name", "VisibleAreaLeft"); + configItemOpenElement.addAttribute("config:type", "int"); + configItemOpenElement.write(mpHandler); + mpHandler->characters("0"); + mpHandler->endElement("config:config-item"); - configItemOpenElement.addAttribute("config:name", "VisibleAreaWidth"); - configItemOpenElement.addAttribute("config:type", "int"); - configItemOpenElement.write(mpHandler); - if (propList["svg:width"]) - mfWidth = propList["svg:width"]->getDouble(); - WPXString sWidth; sWidth.sprintf("%li", (unsigned long)(2540 * mfWidth)); - mpHandler->characters(sWidth); - mpHandler->endElement("config:config-item"); + configItemOpenElement.addAttribute("config:name", "VisibleAreaWidth"); + configItemOpenElement.addAttribute("config:type", "int"); + configItemOpenElement.write(mpHandler); + if (propList["svg:width"]) + mfWidth = propList["svg:width"]->getDouble(); + WPXString sWidth; sWidth.sprintf("%li", (unsigned long)(2540 * mfWidth)); + mpHandler->characters(sWidth); + mpHandler->endElement("config:config-item"); - configItemOpenElement.addAttribute("config:name", "VisibleAreaHeight"); - configItemOpenElement.addAttribute("config:type", "int"); - configItemOpenElement.write(mpHandler); - if (propList["svg:height"]) - mfHeight = propList["svg:height"]->getDouble(); - WPXString sHeight; sHeight.sprintf("%li", (unsigned long)(2540 * mfHeight)); - mpHandler->characters(sHeight); - mpHandler->endElement("config:config-item"); + configItemOpenElement.addAttribute("config:name", "VisibleAreaHeight"); + configItemOpenElement.addAttribute("config:type", "int"); + configItemOpenElement.write(mpHandler); + if (propList["svg:height"]) + mfHeight = propList["svg:height"]->getDouble(); + WPXString sHeight; sHeight.sprintf("%li", (unsigned long)(2540 * mfHeight)); + mpHandler->characters(sHeight); + mpHandler->endElement("config:config-item"); - mpHandler->endElement("config:config-item-set"); + mpHandler->endElement("config:config-item-set"); - mpHandler->endElement("office:settings"); + mpHandler->endElement("office:settings"); + } } void OdgExporter::endGraphics() { - TagOpenElement("office:styles").write(mpHandler); - - for (std::vector<DocumentElement *>::const_iterator iterGraphicsStrokeDashStyles = mGraphicsStrokeDashStyles.begin(); - iterGraphicsStrokeDashStyles != mGraphicsStrokeDashStyles.end(); iterGraphicsStrokeDashStyles++) + if ((mxStreamType == ODG_FLAT_XML) || (mxStreamType == ODG_STYLES_XML)) { - (*iterGraphicsStrokeDashStyles)->write(mpHandler); - } + TagOpenElement("office:styles").write(mpHandler); - for (std::vector<DocumentElement *>::const_iterator iterGraphicsGradientStyles = mGraphicsGradientStyles.begin(); - iterGraphicsGradientStyles != mGraphicsGradientStyles.end(); iterGraphicsGradientStyles++) - { - (*iterGraphicsGradientStyles)->write(mpHandler); - } - - mpHandler->endElement("office:styles"); + for (std::vector<DocumentElement *>::const_iterator iterGraphicsStrokeDashStyles = mGraphicsStrokeDashStyles.begin(); + iterGraphicsStrokeDashStyles != mGraphicsStrokeDashStyles.end(); iterGraphicsStrokeDashStyles++) + { + (*iterGraphicsStrokeDashStyles)->write(mpHandler); + } + + for (std::vector<DocumentElement *>::const_iterator iterGraphicsGradientStyles = mGraphicsGradientStyles.begin(); + iterGraphicsGradientStyles != mGraphicsGradientStyles.end(); iterGraphicsGradientStyles++) + { + (*iterGraphicsGradientStyles)->write(mpHandler); + } - TagOpenElement("office:automatic-styles").write(mpHandler); + mpHandler->endElement("office:styles"); + } - // writing out the graphics automatic styles - for (std::vector<DocumentElement *>::iterator iterGraphicsAutomaticStyles = mGraphicsAutomaticStyles.begin(); - iterGraphicsAutomaticStyles != mGraphicsAutomaticStyles.end(); iterGraphicsAutomaticStyles++) + + if ((mxStreamType == ODG_FLAT_XML) || (mxStreamType == ODG_CONTENT_XML)) { - (*iterGraphicsAutomaticStyles)->write(mpHandler); - } + TagOpenElement("office:automatic-styles").write(mpHandler); - TagOpenElement tmpStylePageLayoutOpenElement("style:page-layout"); - tmpStylePageLayoutOpenElement.addAttribute("style:name", "PM0"); - tmpStylePageLayoutOpenElement.write(mpHandler); + // writing out the graphics automatic styles + for (std::vector<DocumentElement *>::iterator iterGraphicsAutomaticStyles = mGraphicsAutomaticStyles.begin(); + iterGraphicsAutomaticStyles != mGraphicsAutomaticStyles.end(); iterGraphicsAutomaticStyles++) + { + (*iterGraphicsAutomaticStyles)->write(mpHandler); + } - TagOpenElement tmpStylePageLayoutPropertiesOpenElement("style:page-layout-properties"); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-top", "0in"); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-bottom", "0in"); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-left", "0in"); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-right", "0in"); - WPXString sValue; - sValue = doubleToString(mfWidth); sValue.append("in"); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-width", sValue); - sValue = doubleToString(mfHeight); sValue.append("in"); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-height", sValue); - tmpStylePageLayoutPropertiesOpenElement.addAttribute("style:print-orientation", "portrait"); - tmpStylePageLayoutPropertiesOpenElement.write(mpHandler); + TagOpenElement tmpStylePageLayoutOpenElement("style:page-layout"); + tmpStylePageLayoutOpenElement.addAttribute("style:name", "PM0"); + tmpStylePageLayoutOpenElement.write(mpHandler); - mpHandler->endElement("style:page-layout-properties"); + TagOpenElement tmpStylePageLayoutPropertiesOpenElement("style:page-layout-properties"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-top", "0in"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-bottom", "0in"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-left", "0in"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:margin-right", "0in"); + WPXString sValue; + sValue = doubleToString(mfWidth); sValue.append("in"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-width", sValue); + sValue = doubleToString(mfHeight); sValue.append("in"); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("fo:page-height", sValue); + tmpStylePageLayoutPropertiesOpenElement.addAttribute("style:print-orientation", "portrait"); + tmpStylePageLayoutPropertiesOpenElement.write(mpHandler); - mpHandler->endElement("style:page-layout"); + mpHandler->endElement("style:page-layout-properties"); - TagOpenElement tmpStyleStyleOpenElement("style:style"); - tmpStyleStyleOpenElement.addAttribute("style:name", "dp1"); - tmpStyleStyleOpenElement.addAttribute("style:family", "drawing-page"); - tmpStyleStyleOpenElement.write(mpHandler); + mpHandler->endElement("style:page-layout"); - TagOpenElement tmpStyleDrawingPagePropertiesOpenElement("style:drawing-page-properties"); - // tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:background-size", "border"); - tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:fill", "none"); - tmpStyleDrawingPagePropertiesOpenElement.write(mpHandler); + TagOpenElement tmpStyleStyleOpenElement("style:style"); + tmpStyleStyleOpenElement.addAttribute("style:name", "dp1"); + tmpStyleStyleOpenElement.addAttribute("style:family", "drawing-page"); + tmpStyleStyleOpenElement.write(mpHandler); - mpHandler->endElement("style:drawing-page-properties"); + TagOpenElement tmpStyleDrawingPagePropertiesOpenElement("style:drawing-page-properties"); + // tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:background-size", "border"); + tmpStyleDrawingPagePropertiesOpenElement.addAttribute("draw:fill", "none"); + tmpStyleDrawingPagePropertiesOpenElement.write(mpHandler); - mpHandler->endElement("style:style"); + mpHandler->endElement("style:drawing-page-properties"); + + mpHandler->endElement("style:style"); - mpHandler->endElement("office:automatic-styles"); + mpHandler->endElement("office:automatic-styles"); - TagOpenElement("office:master-styles").write(mpHandler); + TagOpenElement("office:master-styles").write(mpHandler); - TagOpenElement tmpStyleMasterPageOpenElement("style:master-page"); - tmpStyleMasterPageOpenElement.addAttribute("style:name", "Default"); - tmpStyleMasterPageOpenElement.addAttribute("style:page-layout-name", "PM0"); - tmpStyleMasterPageOpenElement.addAttribute("draw:style-name", "dp1"); - tmpStyleMasterPageOpenElement.write(mpHandler); + TagOpenElement tmpStyleMasterPageOpenElement("style:master-page"); + tmpStyleMasterPageOpenElement.addAttribute("style:name", "Default"); + tmpStyleMasterPageOpenElement.addAttribute("style:page-layout-name", "PM0"); + tmpStyleMasterPageOpenElement.addAttribute("draw:style-name", "dp1"); + tmpStyleMasterPageOpenElement.write(mpHandler); - mpHandler->endElement("style:master-page"); + mpHandler->endElement("style:master-page"); - mpHandler->endElement("office:master-styles"); + mpHandler->endElement("office:master-styles"); - TagOpenElement("office:body").write(mpHandler); + TagOpenElement("office:body").write(mpHandler); - TagOpenElement("office:drawing").write(mpHandler); + TagOpenElement("office:drawing").write(mpHandler); - TagOpenElement tmpDrawPageOpenElement("draw:page"); - tmpDrawPageOpenElement.addAttribute("draw:name", "page1"); - tmpDrawPageOpenElement.addAttribute("draw:style-name", "dp1"); - tmpDrawPageOpenElement.addAttribute("draw:master-page-name", "Default"); - tmpDrawPageOpenElement.write(mpHandler); + TagOpenElement tmpDrawPageOpenElement("draw:page"); + tmpDrawPageOpenElement.addAttribute("draw:name", "page1"); + tmpDrawPageOpenElement.addAttribute("draw:style-name", "dp1"); + tmpDrawPageOpenElement.addAttribute("draw:master-page-name", "Default"); + tmpDrawPageOpenElement.write(mpHandler); - for (std::vector<DocumentElement *>::const_iterator bodyIter = mBodyElements.begin(); - bodyIter != mBodyElements.end(); bodyIter++) - { - (*bodyIter)->write(mpHandler); - } + for (std::vector<DocumentElement *>::const_iterator bodyIter = mBodyElements.begin(); + bodyIter != mBodyElements.end(); bodyIter++) + { + (*bodyIter)->write(mpHandler); + } - mpHandler->endElement("draw:page"); - mpHandler->endElement("office:drawing"); - mpHandler->endElement("office:body"); - mpHandler->endElement("office:document"); + mpHandler->endElement("draw:page"); + mpHandler->endElement("office:drawing"); + mpHandler->endElement("office:body"); + mpHandler->endElement("office:document"); - mpHandler->endDocument(); + mpHandler->endDocument(); + } } void OdgExporter::setStyle(const ::WPXPropertyListVector& gradient, const ::WPXPropertyList & propList) Index: OdgExporter.hxx =================================================================== RCS file: /cvsroot/libwpd/writerperfect/filter/OdgExporter.hxx,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- OdgExporter.hxx 7 Sep 2009 09:51:04 -0000 1.17 +++ OdgExporter.hxx 3 Jun 2010 08:55:39 -0000 1.18 @@ -34,9 +34,11 @@ #include "DocumentElement.hxx" #include "DocumentHandler.hxx" +enum OdgStreamType { ODG_FLAT_XML, ODG_CONTENT_XML, ODG_STYLES_XML, ODG_SETTINGS_XML, ODG_META_XML }; + class OdgExporter : public libwpg::WPGPaintInterface { public: - OdgExporter(DocumentHandler *pHandler, const bool isFlatXML = false); + OdgExporter(DocumentHandler *pHandler, const OdgStreamType streamType); ~OdgExporter(); void startGraphics(const ::WPXPropertyList &propList); @@ -79,7 +81,7 @@ double mfWidth; double mfHeight; - const bool mbIsFlatXML; + const OdgStreamType mxStreamType; }; #endif // __ODGEXPORTER_HXX__ |