-rw-r--r-- | inputmethods/handwriting/qimpenchar.cpp | 13 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpenchar.h | 2 | ||||
-rw-r--r-- | inputmethods/handwriting/qimpencombining.cpp | 1 |
3 files changed, 10 insertions, 6 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 @@ -363,23 +363,26 @@ bool QIMPenCharSet::save( Domain d ) QString fn = filename( 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; ds << (Q_INT8)csType; 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; } diff --git a/inputmethods/handwriting/qimpenchar.h b/inputmethods/handwriting/qimpenchar.h index 9a5f687..efd6f16 100644 --- a/inputmethods/handwriting/qimpenchar.h +++ b/inputmethods/handwriting/qimpenchar.h @@ -59,9 +59,9 @@ public: void setFlag( int f ) { flags |= f; } void clearFlag( int f ) { flags &= ~f; } bool testFlag( int f ) { return flags & f; } - enum Flags { System=0x01, Deleted=0x02, CombineRight=0x04, Data=0x08 }; + enum Flags { System=0x01, Deleted=0x02, CombineRight=0x04, Data=0x08, Combined=0x10 }; // Correspond to codes in template files. Do not change values. enum Mode { ModeBase=0x4000, Caps=0x4001, Shortcut=0x4002, CapsLock=0x4003, Punctuation=0x4004, Symbol=0x4005, Extended=0x4006 }; diff --git a/inputmethods/handwriting/qimpencombining.cpp b/inputmethods/handwriting/qimpencombining.cpp index 30459e7..2e01ac2 100644 --- a/inputmethods/handwriting/qimpencombining.cpp +++ b/inputmethods/handwriting/qimpencombining.cpp @@ -71,8 +71,9 @@ void QIMPenCombining::addCombined( QIMPenCharSet *cs ) QIMPenChar *accentPc = cit.current(); if ( accentPc->character() == combiningSymbols[i] ) { QIMPenChar *combined = combine( pc, accentPc ); combined->setCharacter( combiningChars[charIdx][i+1] ); + combined->setFlag( QIMPenChar::Combined ); cs->addChar( combined ); } } } |