[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice-devel
Subject:    [PATCH] OOWriter: OASIS is not version 1
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2003-08-27 21:13:27
[Download RAW message or body]

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) 
extension.

The reason behind the patch is that section 1.8.1 of the OO file format 
specifiaction allow the XML document to be read by a validating parser if 
there is a version number known by the reading program. Avoid writing a 
version number means that it is not allowed to use a validating parser.

This patch is not commited.

Have a nice day!
["patch_oowriter.diff" (text/x-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<QString,QString> m_mapTextStyleKeys; // Map of keys to automatic text styles
     QMap<QString,QString> m_mapParaStyleKeys; // Map of keys to automatic paragraph styles
+
+    bool m_version1; // Document is version 1.0 (without any extension.)
 };
 #endif // _EXPORTFILTER_H


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
http://mail.kde.org/mailman/listinfo/koffice-devel


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic