-rw-r--r-- | inputmethods/handwriting/qimpenchar.cpp | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/inputmethods/handwriting/qimpenchar.cpp b/inputmethods/handwriting/qimpenchar.cpp index b83b2a4..96a0502 100644 --- a/inputmethods/handwriting/qimpenchar.cpp +++ b/inputmethods/handwriting/qimpenchar.cpp @@ -342,6 +342,7 @@ bool QIMPenCharSet::load( const QString &fn, Domain d ) ds >> *pc; if ( d == User ) markDeleted( pc->character() ); // override system + if ( !pc->testFlag( QIMPenChar::Deleted ) ) addChar( pc ); } if ( file.status() == IO_Ok ) @@ -377,8 +378,21 @@ bool QIMPenCharSet::save( Domain d ) QIMPenCharIterator ci( chars ); for ( ; ci.current(); ++ci ) { QIMPenChar *pc = ci.current(); +/* + * If the Domain is System and the Char is marked System - OR + * the domain is User, the Char is User and it's not deleted - OR + * the domain is User, the Char is System and it is deleted - AND + * the character is not an automated Combined Character + * + * This is required to ensure that we don't save user defined chars that have been deleted, but + * we *DO* save System chars that have been deleted. There is still the issue of deleted combined + * chars but I'm not sure how to tackle that yet + * + */ + if ( ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) || - ( (d == User) && !pc->testFlag( QIMPenChar::System ) ) ) && + ( (d == User) && !pc->testFlag( QIMPenChar::System ) && !pc->testFlag( QIMPenChar::Deleted ) ) || + ( (d == User) && pc->testFlag( QIMPenChar::System ) && pc->testFlag( QIMPenChar::Deleted ) ) ) && ( !pc->testFlag (QIMPenChar::Combined ) ) ) { ds << *pc; } |