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

List:       koffice-devel
Subject:    koffice/filters/kword/rtf/import
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2003-11-20 23:12:29
[Download RAW message or body]

CVS commit by goutte: 

Style names must be XML-compliant.
(So they too need to be transformed to Unicode, similar to what is done to
font names.)
CCMAIL:koffice-devel@kde.org


  M +8 -8      rtfimport.cpp   1.88
  M +2 -2      rtfimport.h   1.36


--- koffice/filters/kword/rtf/import/rtfimport.cpp  #1.87:1.88
@@ -626,5 +626,5 @@ KoFilter::ConversionStatus RTFImport::co
                 {
                 mainDoc.addNode( "FOLLOWING" );
-                mainDoc.setAttribute( "name", (const char *)styleSheet[k].name );
+                mainDoc.setAttribute( "name", CheckAndEscapeXmlText( \
styleSheet[k].name ));  mainDoc.closeNode( "FOLLOWING");
                     break;
@@ -1254,11 +1254,11 @@ void RTFImport::parseStyleSheet( RTFProp
     {
         // Semicolons separate styles
-        if (strchr( token.text, ';' ) == 0L)
-            style.name += token.text;
+        if (strchr( token.text, ';' ) == 0L) // ### TODO: is this allowed with \
multi-byte Asian characters? +            style.name += textCodec->toUnicode( \
token.text );  else
         {
             // Add style to style sheet
-            *strchr( token.text, ';' ) = 0;
-            style.name  += token.text;
+            *strchr( token.text, ';' ) = 0; // ### TODO: is this allowed with \
multi-byte Asian characters? +            style.name  += textCodec->toUnicode( \
token.text );  style.format = state.format;
             style.layout = state.layout;
@@ -2189,9 +2189,9 @@ void RTFImport::addFormat( DomNode &node
  * @param frameBreak paragraph is always the last in a frame if true
  */
-void RTFImport::addLayout( DomNode &node, QCString &name, RTFLayout &layout, bool \
frameBreak ) +void RTFImport::addLayout( DomNode &node, const QString &name, \
RTFLayout &layout, bool frameBreak )  {
     // Style name and alignment
     node.addNode( "NAME" );
-      node.setAttribute( "value", name );
+      node.setAttribute( "value", CheckAndEscapeXmlText(name) );
     node.closeNode( "NAME" );
     node.addNode( "FLOW" );
@@ -2318,5 +2318,5 @@ void RTFImport::addParagraph( DomNode &n
 
     // Search for style in style sheet
-    QCString name = "Standard";
+    QString name ( "Standard" );
     RTFFormat *format = &state.format;
     int s = state.layout.style;

--- koffice/filters/kword/rtf/import/rtfimport.h  #1.35:1.36
@@ -144,5 +144,5 @@ struct RTFFormat
 struct RTFStyle
 {
-    QCString name;
+    QString name;
     RTFFormat format;
     RTFLayout layout;
@@ -266,5 +266,5 @@ public:
     void addAnchor( const char *instance );
     void addFormat( DomNode &node, KWFormat &format, RTFFormat *baseFormat );
-    void addLayout( DomNode &node, QCString &name, RTFLayout &layout, bool \
frameBreak ); +    void addLayout( DomNode &node, const QString &name, RTFLayout \
&layout, bool frameBreak );  void addParagraph( DomNode &node, bool frameBreak );
     void addVariable(const DomNode& spec, int type, const QString& key, const \
RTFFormat* fmt=0);


_______________________________________________
koffice-devel mailing list
koffice-devel@mail.kde.org
https://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