src/hbutils/document/hbdocumentloader_p.cpp
branchGCC_SURGE
changeset 15 f378acbc9cfb
parent 7 923ff622b8b9
--- a/src/hbutils/document/hbdocumentloader_p.cpp	Thu Jul 15 14:03:49 2010 +0100
+++ b/src/hbutils/document/hbdocumentloader_p.cpp	Thu Jul 22 16:36:53 2010 +0100
@@ -138,8 +138,6 @@
     QDataStream stream( dstDevice );
     stream << sectionsPositionList;
     stream << sectionsMetaDataPos;
-
-
 #ifdef DEBUG_TIMES
     debugPrintX("MYTRACE: DocML create binary, end: %d", debugTime.elapsed());
 #endif
@@ -155,7 +153,10 @@
 #else
     bool result(true);
 
+    const bool originalTextMode = device->isTextModeEnabled();
+
     if (binarysyntax->isBinary(device)) {
+        device->setTextModeEnabled( false );    
         binarysyntax->setActions(actions);
 #ifdef DEBUG_TIMES
         debugTime.restart();
@@ -166,6 +167,7 @@
         debugPrintX("MYTRACE: DocML load binary, end: %d", debugTime.elapsed());
 #endif
     } else {
+        device->setTextModeEnabled( true );    
         syntax->setActions(actions);
 #ifdef DEBUG_TIMES
         debugTime.restart();
@@ -176,6 +178,7 @@
         debugPrintX("MYTRACE: DocML load plain text, end: %d", debugTime.elapsed());
 #endif
     }
+    device->setTextModeEnabled( originalTextMode );    
     return result;
 #endif
 }