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

List:       koffice-devel
Subject:    koffice/filters/kword/rtf/export
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2003-08-31 15:02:53
[Download RAW message or body]

CVS commit by goutte: 

Document properties:
- remove \operator as KWord only knows the author, not the operator
  (It could be the author's secretary.)
- change KWord's abstract from \subject to \doccomm (as multiple line comment.)
- add creation time \creatim.
- sort these keywords by the order of the RTF specification.

(Other small change s/QFont/QFontInfo/ ; same as in OOWriter export filter.)
CCMAIL:koffice-devel@kde.org


  M +34 -14    ExportFilter.cc   2.74


--- koffice/filters/kword/rtf/export/ExportFilter.cc  #2.73:2.74
@@ -33,4 +33,5 @@
 #include <qregexp.h>
 #include <qcolor.h>
+#include <qdatetime.h>
 
 #include <klocale.h>
@@ -690,5 +691,5 @@ void RTFWorker::writeFontData(void)
         count++, it++)
     {
-        QFont info(*it);
+        QFontInfo info(*it);
         QString strLower(info.family().lower());
         *m_streamOut << "{\\f" << count;
@@ -837,14 +838,4 @@ bool RTFWorker::doFullDocumentInfo(const
         m_textDocInfo += docInfo.fullName;
         m_textDocInfo += "}";
-        m_textDocInfo += "{\\operator ";
-        m_textDocInfo += docInfo.fullName;
-        m_textDocInfo += "}";
-    }
-
-    if ( !docInfo.abstract.isEmpty() )
-    {
-        m_textDocInfo += "{\\subject ";
-        m_textDocInfo += docInfo.abstract;
-        m_textDocInfo += "}";
     }
 
@@ -860,6 +851,35 @@ bool RTFWorker::doFullDocumentInfo(const
     m_textDocInfo += "{\\comment ";
     m_textDocInfo += "Generated by KWord's RTF Export Filter";
-    m_textDocInfo += revision.mid(10).replace('$',""); // has a leading and a trailing space.
+    m_textDocInfo += revision.mid(10).remove('$'); // has a leading and a trailing space.
+    m_textDocInfo += "}";
+
+    if ( !docInfo.abstract.isEmpty() )
+    {
+        m_textDocInfo += "{\\doccomm ";
+        m_textDocInfo += docInfo.abstract;
+        m_textDocInfo += "}";
+    }
+
+    QDateTime now;
+    now=QDateTime::currentDateTime(Qt::UTC);
+    if (now.isValid())
+    {
+        m_textDocInfo += "{\\creatim ";
+        const QDate nowDate(now.date());
+        m_textDocInfo += "\\yr";
+        m_textDocInfo += QString::number(nowDate.year());
+        m_textDocInfo += "\\mo";
+        m_textDocInfo += QString::number(nowDate.month());
+        m_textDocInfo += "\\dy";
+        m_textDocInfo += QString::number(nowDate.day());
+        const QTime nowTime(now.time());
+        m_textDocInfo += "\\hr";
+        m_textDocInfo += QString::number(nowTime.hour());
+        m_textDocInfo += "\\min";
+        m_textDocInfo += QString::number(nowTime.minute());
+        m_textDocInfo += "\\sec";
+        m_textDocInfo += QString::number(nowTime.second());
     m_textDocInfo += "}";
+    }
 
     m_textDocInfo += "}";


_______________________________________________
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