[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:       2005-01-20 14:33:08
Message-ID: 20050120143308.97AB41CE8A () office ! kde ! org
[Download RAW message or body]

CVS commit by goutte: 

- add a dummy text state (I forgot to commit it before)
- make better English error messages if the filter cannot find \rtf


  M +7 -3      rtfimport.cpp   1.132
  M +5 -0      rtfimport.h   1.55


--- koffice/filters/kword/rtf/import/rtfimport.cpp  #1.131:1.132
@@ -352,5 +352,5 @@ KoFilter::ConversionStatus RTFImport::co
         {
             KMessageBox::error( 0L,
-                i18n("The file cannot be loaded, as it does not seem to a RTF document!"),
+                i18n("The file cannot be loaded, as it seems not to be a RTF document!"),
                 i18n("KWord's RTF Import Filter "), 0 );
         }
@@ -369,5 +369,5 @@ KoFilter::ConversionStatus RTFImport::co
         {
             KMessageBox::error( 0L,
-                i18n("The document cannot be loaded, as it does not seem to follow the RTF syntax!"),
+                i18n("The document cannot be loaded, as it seems not to follow the RTF syntax!"),
                 i18n("KWord's RTF Import Filter "), 0 );
         }
@@ -1962,4 +1962,5 @@ void RTFImport::parseGroup( RTFProperty 
 void RTFImport::skipGroup( RTFProperty * )
 {
+    kdDebug(30515) << "Skip Group: " << token.type << endl;
     state.ignoreGroup = true;
 }
@@ -1979,5 +1980,8 @@ void RTFImport::changeDestination( RTFPr
     destination.name     = property->name;
     destination.destproc = property->cwproc;
+    if ( property->offset )
     destination.target   = (RTFTextState*) ( (char *)this + property->offset );
+    else
+        destination.target = &m_dummyTextState;
 
     state.brace0 = true;

--- koffice/filters/kword/rtf/import/rtfimport.h  #1.54:1.55
@@ -525,4 +525,9 @@ public:
     RTFTextState firstPageHeader, oddPagesHeader, evenPagesHeader;
     RTFTextState firstPageFooter, oddPagesFooter, evenPagesFooter;
+    /**
+     * Dummy text state for destinations without own RTFTextState
+     * @note this is mainly to avoid dangling or NULL pointers
+     */
+    RTFTextState m_dummyTextState;
     QMap<int,QString> fontTable;
     QValueList<RTFStyle> styleSheet;


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

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