author | treke <treke> | 2003-12-23 15:35:21 (UTC) |
---|---|---|
committer | treke <treke> | 2003-12-23 15:35:21 (UTC) |
commit | 0a613593f2e57c2805d1eef47c16b9fcb8c94a08 (patch) (side-by-side diff) | |
tree | 070fe1957d0900ba3364142fe7ecccbf53c3f847 /inputmethods | |
parent | 127c50cc446de489c702400ebc5fc4874f6311b2 (diff) | |
download | opie-0a613593f2e57c2805d1eef47c16b9fcb8c94a08.zip opie-0a613593f2e57c2805d1eef47c16b9fcb8c94a08.tar.gz opie-0a613593f2e57c2805d1eef47c16b9fcb8c94a08.tar.bz2 |
Patch from Brad Campbell to fix opie-handwritings writing of data files
-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 @@ -366,3 +366,4 @@ bool QIMPenCharSet::save( Domain d ) if ( file.open( IO_WriteOnly|IO_Raw ) ) { - QDataStream ds( &file ); + QByteArray buf; + QDataStream ds( buf, IO_WriteOnly ); ds << QString( "QPT 1.1" ); @@ -374,9 +375,11 @@ bool QIMPenCharSet::save( Domain d ) 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 ) 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 @@ -62,3 +62,3 @@ public: - 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. 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 @@ -74,2 +74,3 @@ void QIMPenCombining::addCombined( QIMPenCharSet *cs ) combined->setCharacter( combiningChars[charIdx][i+1] ); + combined->setFlag( QIMPenChar::Combined ); cs->addChar( combined ); |