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

List:       kde-commits
Subject:    koffice/filters/kword/rtf/import
From:       Nicolas Goutte <nicolasg () snafu ! de>
Date:       2004-12-12 23:06:07
Message-ID: 20041212230607.67EC71BB78 () office ! kde ! org
[Download RAW message or body]

CVS commit by goutte: 

Use the possibilities offered by C++ to avoid as much type casts as possible
for the "destination target"


  M +6 -6      rtfimport.cpp   1.131
  M +3 -1      rtfimport.h   1.54


--- koffice/filters/kword/rtf/import/rtfimport.cpp  #1.130:1.131
@@ -1865,5 +1865,5 @@ void RTFImport::parseFootNote( RTFProper
         footnotes.append(newTextState);
         fnnum++;
-        destination.target=(char*)newTextState;
+        destination.target = newTextState;
 
         QCString str;
@@ -1891,5 +1891,5 @@ void RTFImport::parseRichText( RTFProper
         // Save and change rich text destination
         RTFTextState *oldState = textState;
-        textState = (RTFTextState *)destination.target;
+        textState = destination.target;
         destination.target = oldState;
         destination.group = "Text";
@@ -1940,5 +1940,5 @@ void RTFImport::parseRichText( RTFProper
 
         // Restore rich text destination
-        textState = (RTFTextState *)destination.target;
+        textState = destination.target;
     }
 }
@@ -1948,9 +1948,9 @@ void RTFImport::parsePlainText( RTFPrope
     if (token.type == RTFTokenizer::OpenGroup)
     {
-        ((DomNode *)destination.target)->clear();
+        destination.target->node.clear();
     }
     else if (token.type == RTFTokenizer::PlainText)
     {
-        ((DomNode *)destination.target)->addTextNode( token.text, textCodec );
+        destination.target->node.addTextNode( token.text, textCodec );
     }
 }
@@ -1979,5 +1979,5 @@ void RTFImport::changeDestination( RTFPr
     destination.name     = property->name;
     destination.destproc = property->cwproc;
-    destination.target   = (char *)this + property->offset;
+    destination.target   = (RTFTextState*) ( (char *)this + property->offset );
 
     state.brace0 = true;

--- koffice/filters/kword/rtf/import/rtfimport.h  #1.53:1.54
@@ -57,4 +57,6 @@ struct RTFField
 };
 
+struct RTFTextState;
+
 /// RTF destination
 struct RTFDestination
@@ -63,5 +65,5 @@ struct RTFDestination
     const char *name;
     void (RTFImport::*destproc)( RTFProperty * );
-    void *target;
+    RTFTextState* target;
 };
 


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

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