author | brad <brad> | 2004-06-17 11:45:51 (UTC) |
---|---|---|
committer | brad <brad> | 2004-06-17 11:45:51 (UTC) |
commit | 9875d0391f21f4d7518dba946455d844f04c1668 (patch) (unidiff) | |
tree | b53e0415e0f238e21cb8cc1a19175b9d4799bcaa /inputmethods | |
parent | 4386dec4cc1b5ef3272b9aba352dfa6fba6a4e06 (diff) | |
download | opie-9875d0391f21f4d7518dba946455d844f04c1668.zip opie-9875d0391f21f4d7518dba946455d844f04c1668.tar.gz opie-9875d0391f21f4d7518dba946455d844f04c1668.tar.bz2 |
Fix inability to delete system characters.
It appears this has never previously worked correctly.
Reported by : A.Pearce@salford.ac.uk
-rw-r--r-- | inputmethods/handwriting/qimpenchar.cpp | 20 |
1 files changed, 17 insertions, 3 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 | |||
@@ -343,5 +343,6 @@ bool QIMPenCharSet::load( const QString &fn, Domain d ) | |||
343 | if ( d == User ) | 343 | if ( d == User ) |
344 | markDeleted( pc->character() ); // override system | 344 | markDeleted( pc->character() ); // override system |
345 | addChar( pc ); | 345 | if ( !pc->testFlag( QIMPenChar::Deleted ) ) |
346 | addChar( pc ); | ||
346 | } | 347 | } |
347 | if ( file.status() == IO_Ok ) | 348 | if ( file.status() == IO_Ok ) |
@@ -378,6 +379,19 @@ bool QIMPenCharSet::save( Domain d ) | |||
378 | for ( ; ci.current(); ++ci ) { | 379 | for ( ; ci.current(); ++ci ) { |
379 | QIMPenChar *pc = ci.current(); | 380 | QIMPenChar *pc = ci.current(); |
380 | if ( ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) || | 381 | /* |
381 | ( (d == User) && !pc->testFlag( QIMPenChar::System ) ) ) && | 382 | * If the Domain is System and the Char is marked System - OR |
383 | * the domain is User, the Char is User and it's not deleted - OR | ||
384 | * the domain is User, the Char is System and it is deleted - AND | ||
385 | * the character is not an automated Combined Character | ||
386 | * | ||
387 | * This is required to ensure that we don't save user defined chars that have been deleted, but | ||
388 | * we *DO* save System chars that have been deleted. There is still the issue of deleted combined | ||
389 | * chars but I'm not sure how to tackle that yet | ||
390 | * | ||
391 | */ | ||
392 | |||
393 | if ( ( ( (d == System) && pc->testFlag( QIMPenChar::System ) ) || | ||
394 | ( (d == User) && !pc->testFlag( QIMPenChar::System ) && !pc->testFlag( QIMPenChar::Deleted ) ) || | ||
395 | ( (d == User) && pc->testFlag( QIMPenChar::System ) && pc->testFlag( QIMPenChar::Deleted ) ) ) && | ||
382 | ( !pc->testFlag (QIMPenChar::Combined ) ) ) { | 396 | ( !pc->testFlag (QIMPenChar::Combined ) ) ) { |
383 | ds << *pc; | 397 | ds << *pc; |