From koffice-devel Wed Aug 27 21:13:27 2003 From: Nicolas Goutte Date: Wed, 27 Aug 2003 21:13:27 +0000 To: koffice-devel Subject: [PATCH] OOWriter: OASIS is not version 1 X-MARC-Message: https://marc.info/?l=koffice-devel&m=106201904703783 MIME-Version: 1 Content-Type: multipart/mixed; boundary="--------------Boundary-00=_FYQAUPRDY6O76AX3CGW6" --------------Boundary-00=_FYQAUPRDY6O76AX3CGW6 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable The attached patch is for koffice/filter/kword/oowriter It only writes that the OO document is version 1.0 if there is no (oASIS)= =20 extension. The reason behind the patch is that section 1.8.1 of the OO file format=20 specifiaction allow the XML document to be read by a validating parser if= =20 there is a version number known by the reading program. Avoid writing a=20 version number means that it is not allowed to use a validating parser. This patch is not commited. Have a nice day! --------------Boundary-00=_FYQAUPRDY6O76AX3CGW6 Content-Type: text/x-diff; charset="us-ascii"; name="patch_oowriter.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="patch_oowriter.diff" Index: ExportFilter.cc =================================================================== RCS file: /home/kde/koffice/filters/kword/oowriter/ExportFilter.cc,v retrieving revision 1.19 diff -u -r1.19 ExportFilter.cc --- ExportFilter.cc 22 Aug 2003 15:56:21 -0000 1.19 +++ ExportFilter.cc 27 Aug 2003 21:07:46 -0000 @@ -54,7 +54,7 @@ m_paperBorderTop(0.0),m_paperBorderLeft(0.0), m_paperBorderBottom(0.0),m_paperBorderRight(0.0), m_zip(NULL), m_pictureNumber(0), m_automaticParagraphStyleNumber(0), m_automaticTextStyleNumber(0), - m_footnoteNumber(0) + m_footnoteNumber(0),m_version1(true) { } @@ -172,7 +172,13 @@ //zipWriteData(" xmlns:form=\"http://openoffice.org/2000/form\""); //zipWriteData(" xmlns:script=\"http://openoffice.org/2000/script\""); - zipWriteData(" office:class=\"text\" office:version=\"1.0\""); + zipWriteData(" office:class=\"text\""); + + if (m_version1) + { + // We have not used any extension compared to version 1.0 + zipWriteData("office:version=\"1.0\""); + } zipWriteData(">\n"); } @@ -747,6 +753,7 @@ { props += "fo:text-align=\"left\" "; props += "style:text-auto-align=\"true\" "; // OASIS extension + m_version1=false; // OASIS means non-version 1.0 styleKey += "A"; } else Index: ExportFilter.h =================================================================== RCS file: /home/kde/koffice/filters/kword/oowriter/ExportFilter.h,v retrieving revision 1.9 diff -u -r1.9 ExportFilter.h --- ExportFilter.h 13 Jun 2003 18:50:13 -0000 1.9 +++ ExportFilter.h 27 Aug 2003 21:07:49 -0000 @@ -127,5 +127,7 @@ QMap m_mapTextStyleKeys; // Map of keys to automatic text styles QMap m_mapParaStyleKeys; // Map of keys to automatic paragraph styles + + bool m_version1; // Document is version 1.0 (without any extension.) }; #endif // _EXPORTFILTER_H --------------Boundary-00=_FYQAUPRDY6O76AX3CGW6 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ koffice-devel mailing list koffice-devel@mail.kde.org http://mail.kde.org/mailman/listinfo/koffice-devel --------------Boundary-00=_FYQAUPRDY6O76AX3CGW6--