Diffstat (limited to 'inputmethods/handwriting/qimpenchar.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | inputmethods/handwriting/qimpenchar.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/inputmethods/handwriting/qimpenchar.cpp b/inputmethods/handwriting/qimpenchar.cpp index 152bfec..0c37e5c 100644 --- a/inputmethods/handwriting/qimpenchar.cpp +++ b/inputmethods/handwriting/qimpenchar.cpp @@ -364,7 +364,8 @@ bool QIMPenCharSet::save( Domain d ) QString tmpFn = fn + ".new"; QFile file( tmpFn ); if ( file.open( IO_WriteOnly|IO_Raw ) ) { - QDataStream ds( &file ); + QByteArray buf; + QDataStream ds( buf, IO_WriteOnly ); ds << QString( "QPT 1.1" ); ds << csTitle; ds << desc; @@ -372,13 +373,15 @@ bool QIMPenCharSet::save( Domain d ) QIMPenCharIterator ci( chars ); for ( ; ci.current(); ++ci ) { QIMPenChar *pc = ci.current(); - if ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) || - ( (d == User) && !pc->testFlag( QIMPenChar::System ) ) ) { + if ( ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) || + ( (d == User) && !pc->testFlag( QIMPenChar::System ) ) ) && + ( !pc->testFlag (QIMPenChar::Combined ) ) ) { ds << *pc; } - if ( file.status() != IO_Ok ) - break; } + + file.writeBlock( buf ); + file.close(); if ( file.status() == IO_Ok ) ok = TRUE; } |