From f42a2fbcfc31a720802251de4b25e885774d24dc Mon Sep 17 00:00:00 2001 From: Ding-Yi Chen Date: Fri, 31 Jul 2009 07:33:09 +0000 Subject: [PATCH] Fixed Bug 512108 --- import.log | 1 + libchewing-0.3.2.phraseChoiceRearward.patch | 106 ++++++++++++-------- libchewing.spec | 7 +- 3 files changed, 70 insertions(+), 44 deletions(-) diff --git a/import.log b/import.log index f5f91a3..8ead5bd 100644 --- a/import.log +++ b/import.log @@ -11,3 +11,4 @@ libchewing-0_3_2-9_fc11:HEAD:libchewing-0.3.2-9.fc11.src.rpm:1242719923 libchewing-0_3_2-10_fc11:HEAD:libchewing-0.3.2-10.fc11.src.rpm:1242803240 libchewing-0_3_2-11_fc11:HEAD:libchewing-0.3.2-11.fc11.src.rpm:1245996227 libchewing-0_3_2-12_fc11:HEAD:libchewing-0.3.2-12.fc11.src.rpm:1246329909 +libchewing-0_3_2-14_fc11:HEAD:libchewing-0.3.2-14.fc11.src.rpm:1249025558 diff --git a/libchewing-0.3.2.phraseChoiceRearward.patch b/libchewing-0.3.2.phraseChoiceRearward.patch index 69e701f..8376d4b 100644 --- a/libchewing-0.3.2.phraseChoiceRearward.patch +++ b/libchewing-0.3.2.phraseChoiceRearward.patch @@ -1,7 +1,15 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c --- ./src/chewingio.c.phraseChoiceRearward 2008-12-02 00:29:20.000000000 +1000 -+++ ./src/chewingio.c 2009-06-26 15:58:08.000000000 +1000 -@@ -75,14 +75,14 @@ CHEWING_API int chewing_KBStr2Num( char ++++ ./src/chewingio.c 2009-07-31 17:17:06.000000000 +1000 +@@ -20,6 +20,7 @@ + #include + #include + #include ++#include + + #include "chewing-utf8-util.h" + #include "global.h" +@@ -75,14 +76,14 @@ CHEWING_API int chewing_KBStr2Num( char return KB_DEFAULT; } @@ -18,7 +26,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c #endif int addTerminateService( void (*callback)() ) -@@ -103,7 +103,7 @@ int addTerminateService( void (*callback +@@ -103,7 +104,7 @@ int addTerminateService( void (*callback CHEWING_API ChewingContext *chewing_new() { ChewingContext *ctx; @@ -27,7 +35,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c ChewingData *internal_data = ALC( ChewingData, 1 ); ChewingOutput *internal_output = ALC( ChewingOutput, 1 ); ctx = ALC( ChewingContext, 1 ); -@@ -159,7 +159,7 @@ CHEWING_API int chewing_Init( +@@ -159,7 +160,7 @@ CHEWING_API int chewing_Init( dbg_path = FAILSAFE_OUTPUT; fp_g = fopen( dbg_path, "w+" ); if ( ! fp_g ) { @@ -36,7 +44,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c "Failed to record debug message in file.\n" "--> Output to stderr\n" ); } -@@ -237,14 +237,14 @@ CHEWING_API void chewing_Terminate() +@@ -237,14 +238,14 @@ CHEWING_API void chewing_Terminate() if ( TerminateServices[ i ] ) { #ifdef ENABLE_DEBUG /* Can't output to debug file because it's about to close */ @@ -53,7 +61,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c /* XXX: should check if the services are really completed. */ bTerminateCompleted = 1; return; -@@ -403,7 +403,7 @@ CHEWING_API void chewing_set_ChiEngMode( +@@ -403,7 +404,7 @@ CHEWING_API void chewing_set_ChiEngMode( ctx->data->bChiSym = ( mode == CHINESE_MODE ? 1 : 0 ); } @@ -62,7 +70,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c { return ctx->data->bChiSym; } -@@ -413,7 +413,7 @@ CHEWING_API void chewing_set_ShapeMode( +@@ -413,7 +414,7 @@ CHEWING_API void chewing_set_ShapeMode( ctx->data->bFullShape = (mode == FULLSHAPE_MODE ? 1 : 0); } @@ -71,7 +79,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c { return ctx->data->bFullShape; } -@@ -435,7 +435,7 @@ static int DoSelect( ChewingData *pgdata +@@ -435,7 +436,7 @@ static int DoSelect( ChewingData *pgdata if ( pgdata->choiceInfo.isSymbol ) { SymbolChoice( pgdata, num ); } @@ -80,7 +88,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c /* change the select interval & selectStr & nSelect */ AddSelect( pgdata, num ); /* second, call choice module */ -@@ -489,7 +489,7 @@ CHEWING_API int chewing_handle_Space( Ch +@@ -489,7 +490,7 @@ CHEWING_API int chewing_handle_Space( Ch pgdata->chiSymbolBufLen = 0; pgdata->chiSymbolCursor = 0; keystrokeRtn = KEYSTROKE_COMMIT; @@ -89,7 +97,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c else if ( pgdata->bChiSym != CHINESE_MODE ) { /* see if buffer contains nothing */ if ( pgdata->chiSymbolBufLen == 0 ) { -@@ -507,11 +507,11 @@ CHEWING_API int chewing_handle_Space( Ch +@@ -507,11 +508,11 @@ CHEWING_API int chewing_handle_Space( Ch if ( rtn == SYMBOL_KEY_ERROR ) { keystrokeRtn = KEYSTROKE_IGNORE; /* @@ -103,7 +111,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c else { keystrokeRtn = KEYSTROKE_ABSORB; } -@@ -524,9 +524,9 @@ CHEWING_API int chewing_handle_Space( Ch +@@ -524,9 +525,9 @@ CHEWING_API int chewing_handle_Space( Ch /* Quick commit */ else { DEBUG_OUT( @@ -115,7 +123,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgo->nCommitStr = 1; pgdata->chiSymbolBufLen = 0; pgdata->chiSymbolCursor = 0; -@@ -643,7 +643,7 @@ CHEWING_API int chewing_handle_Enter( Ch +@@ -643,7 +644,7 @@ CHEWING_API int chewing_handle_Enter( Ch keystrokeRtn = KEYSTROKE_COMMIT; WriteChiSymbolToBuf( pgo->commitStr, nCommitStr, pgdata ); AutoLearnPhrase( pgdata ); @@ -124,7 +132,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgo->nCommitStr = nCommitStr; } -@@ -664,12 +664,12 @@ CHEWING_API int chewing_handle_Del( Chew +@@ -664,12 +665,12 @@ CHEWING_API int chewing_handle_Del( Chew } if ( ! pgdata->bSelect ) { @@ -141,7 +149,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c NONDECREASE_CURSOR ); } CallPhrasing( pgdata ); -@@ -696,7 +696,7 @@ CHEWING_API int chewing_handle_Backspace +@@ -696,7 +697,7 @@ CHEWING_API int chewing_handle_Backspace } else if ( pgdata->chiSymbolCursor > 0 ) { ChewingKillChar( @@ -150,7 +158,13 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgdata->chiSymbolCursor - 1, DECREASE_CURSOR ); } -@@ -740,6 +740,7 @@ CHEWING_API int chewing_handle_Down( Che +@@ -735,11 +736,12 @@ CHEWING_API int chewing_handle_Up( Chewi + + CHEWING_API int chewing_handle_Down( ChewingContext *ctx ) + { +- ChewingData *pgdata = ctx->data; ++ ChewingData *pgdata = ctx->data; + ChewingOutput *pgo = ctx->output; int toSelect = 0; int keystrokeRtn = KEYSTROKE_ABSORB; int key_buf_cursor; @@ -158,10 +172,12 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c CheckAndResetRange( pgdata ); -@@ -757,12 +758,21 @@ CHEWING_API int chewing_handle_Down( Che +@@ -756,13 +758,22 @@ CHEWING_API int chewing_handle_Down( Che + toSelect = 1; if ( toSelect ) { - if( ! pgdata->bSelect ) { +- if( ! pgdata->bSelect ) { ++ if( ! pgdata->bSelect ) { + cursor_orig=pgdata->chiSymbolCursor; ChoiceFirstAvail( pgdata ); } @@ -181,7 +197,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c else if ( pgdata->symbolKeyBuf[ key_buf_cursor ] ) { /* Open Symbol Choice List */ if ( ! pgdata->choiceInfo.isSymbol ) -@@ -782,11 +792,11 @@ CHEWING_API int chewing_handle_ShiftLeft +@@ -782,11 +793,11 @@ CHEWING_API int chewing_handle_ShiftLeft if ( ! ChewingIsEntering( pgdata ) ) { keystrokeRtn = KEYSTROKE_IGNORE; @@ -196,7 +212,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgdata->chiSymbolCursor > 0 && pgdata->PointEnd > -9 ) { if ( pgdata->PointStart == -1 ) -@@ -797,7 +807,7 @@ CHEWING_API int chewing_handle_ShiftLeft +@@ -797,7 +808,7 @@ CHEWING_API int chewing_handle_ShiftLeft pgdata->PointEnd--; } if ( pgdata->PointEnd == 0 ) @@ -205,7 +221,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c } } -@@ -822,8 +832,8 @@ CHEWING_API int chewing_handle_Left( Che +@@ -822,8 +833,8 @@ CHEWING_API int chewing_handle_Left( Che pgdata->choiceInfo.pageNo = pgdata->choiceInfo.nPage - 1; } else { @@ -216,7 +232,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgdata->chiSymbolCursor > 0 ) { CheckAndResetRange( pgdata ); pgdata->chiSymbolCursor--; -@@ -842,13 +852,13 @@ CHEWING_API int chewing_handle_ShiftRigh +@@ -842,13 +853,13 @@ CHEWING_API int chewing_handle_ShiftRigh if ( ! ChewingIsEntering( pgdata ) ) { keystrokeRtn = KEYSTROKE_IGNORE; @@ -234,7 +250,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgdata->PointEnd < 9 ) { if ( pgdata->PointStart == -1 ) pgdata->PointStart = pgdata->chiSymbolCursor; -@@ -858,7 +868,7 @@ CHEWING_API int chewing_handle_ShiftRigh +@@ -858,7 +869,7 @@ CHEWING_API int chewing_handle_ShiftRigh } pgdata->chiSymbolCursor++; if ( pgdata->PointEnd == 0 ) @@ -243,7 +259,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c } } -@@ -883,9 +893,9 @@ CHEWING_API int chewing_handle_Right( Ch +@@ -883,9 +894,9 @@ CHEWING_API int chewing_handle_Right( Ch pgdata->choiceInfo.pageNo = 0; } else { @@ -256,7 +272,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c CheckAndResetRange( pgdata ); pgdata->chiSymbolCursor++; } -@@ -974,11 +984,11 @@ CHEWING_API int chewing_handle_Home( Che +@@ -974,11 +985,11 @@ CHEWING_API int chewing_handle_Home( Che CheckAndResetRange( pgdata ); @@ -271,7 +287,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c } MakeOutputWithRtn( pgo, pgdata, keystrokeRtn ); return 0; -@@ -993,12 +1003,12 @@ CHEWING_API int chewing_handle_End( Chew +@@ -993,12 +1004,12 @@ CHEWING_API int chewing_handle_End( Chew CheckAndResetRange( pgdata ); if ( ! ChewingIsEntering( pgdata ) ) { @@ -289,7 +305,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c return 0; } -@@ -1013,9 +1023,9 @@ CHEWING_API int chewing_handle_PageUp( C +@@ -1013,9 +1024,9 @@ CHEWING_API int chewing_handle_PageUp( C if ( ! ChewingIsEntering( pgdata ) ) { keystrokeRtn = KEYSTROKE_IGNORE; } @@ -301,7 +317,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c MakeOutputWithRtn( pgo, pgdata, keystrokeRtn ); return 0; } -@@ -1031,9 +1041,9 @@ CHEWING_API int chewing_handle_PageDown( +@@ -1031,9 +1042,9 @@ CHEWING_API int chewing_handle_PageDown( if ( ! ChewingIsEntering( pgdata ) ) { keystrokeRtn = KEYSTROKE_IGNORE; } @@ -313,7 +329,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c MakeOutputWithRtn( pgo, pgdata, keystrokeRtn ); return 0; } -@@ -1107,7 +1117,7 @@ CHEWING_API int chewing_handle_Default( +@@ -1107,7 +1118,7 @@ CHEWING_API int chewing_handle_Default( DoSelect( pgdata, num ); goto End_keyproc; } @@ -322,7 +338,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c /* Otherwise, use 'j' and 'k' for paging in selection mode */ DEBUG_OUT( "\t\tchecking paging key, got '%c'\n", -@@ -1163,10 +1173,10 @@ CHEWING_API int chewing_handle_Default( +@@ -1163,10 +1174,10 @@ CHEWING_API int chewing_handle_Default( rtn = ZuinPhoInput( &( pgdata->zuinData ), key ); DEBUG_OUT( "\t\tChinese mode key, " @@ -335,7 +351,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c if ( rtn == ZUIN_KEY_ERROR ) rtn = SpecialSymbolInput( key, pgdata ); switch ( rtn ) { -@@ -1182,14 +1192,14 @@ CHEWING_API int chewing_handle_Default( +@@ -1182,14 +1193,14 @@ CHEWING_API int chewing_handle_Default( case ZUIN_KEY_ERROR: case ZUIN_IGNORE: DEBUG_OUT( @@ -353,7 +369,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c key ); /* see if buffer contains nothing */ -@@ -1207,7 +1217,7 @@ CHEWING_API int chewing_handle_Default( +@@ -1207,7 +1218,7 @@ CHEWING_API int chewing_handle_Default( if ( rtn == SYMBOL_KEY_ERROR ) { keystrokeRtn = KEYSTROKE_IGNORE; /* @@ -362,7 +378,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c * then it's wrong to commit it. */ bQuickCommit = 0; -@@ -1248,9 +1258,9 @@ End_keyproc: +@@ -1248,9 +1259,9 @@ End_keyproc: /* Quick commit */ else { DEBUG_OUT( @@ -374,7 +390,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgo->nCommitStr = 1; pgdata->chiSymbolBufLen = 0; pgdata->chiSymbolCursor = 0; -@@ -1309,12 +1319,12 @@ CHEWING_API int chewing_handle_CtrlNum( +@@ -1309,12 +1320,12 @@ CHEWING_API int chewing_handle_CtrlNum( cursor = PhoneSeqCursor( pgdata ); if ( ! pgdata->config.bAddPhraseForward ) { @@ -392,7 +408,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c cursor + newPhraseLen - 1 ) ) { /* Manually add phrase to the user phrase database. */ memcpy( addPhoneSeq, -@@ -1328,10 +1338,10 @@ CHEWING_API int chewing_handle_CtrlNum( +@@ -1328,10 +1339,10 @@ CHEWING_API int chewing_handle_CtrlNum( phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq ); @@ -407,7 +423,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c phraseState ); /* Clear the breakpoint between the New Phrase */ -@@ -1341,11 +1351,11 @@ CHEWING_API int chewing_handle_CtrlNum( +@@ -1341,11 +1352,11 @@ CHEWING_API int chewing_handle_CtrlNum( } } else { @@ -423,7 +439,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c cursor - newPhraseLen ) ) { /* Manually add phrase to the user phrase database. */ memcpy( addPhoneSeq, -@@ -1358,10 +1368,10 @@ CHEWING_API int chewing_handle_CtrlNum( +@@ -1358,10 +1369,10 @@ CHEWING_API int chewing_handle_CtrlNum( newPhraseLen, 1); phraseState = UserUpdatePhrase( addPhoneSeq, addWordSeq ); @@ -438,7 +454,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c phraseState ); /* Clear the breakpoint between the New Phrase */ -@@ -1414,10 +1424,10 @@ CHEWING_API int chewing_handle_Numlock( +@@ -1414,10 +1425,10 @@ CHEWING_API int chewing_handle_Numlock( ChewingOutput *pgo = ctx->output; int rtn, QuickCommit = 0; int keystrokeRtn = KEYSTROKE_ABSORB; @@ -451,7 +467,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c */ if ( pgdata->chiSymbolBufLen == 0 ) { QuickCommit = 1; -@@ -1428,7 +1438,7 @@ CHEWING_API int chewing_handle_Numlock( +@@ -1428,7 +1439,7 @@ CHEWING_API int chewing_handle_Numlock( keystrokeRtn = KEYSTROKE_IGNORE ; } else if ( QuickCommit ) { @@ -460,7 +476,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c pgo->nCommitStr = 1; pgdata->chiSymbolBufLen = 0; pgdata->chiSymbolCursor = 0; -@@ -1443,7 +1453,7 @@ CHEWING_API int chewing_handle_Numlock( +@@ -1443,7 +1454,7 @@ CHEWING_API int chewing_handle_Numlock( else { /* Otherwise, if we are selecting words, we use numeric keys * as selkey @@ -471,7 +487,7 @@ diff -up ./src/chewingio.c.phraseChoiceRearward ./src/chewingio.c if ( key > '0' && key < '9' ) diff -up ./src/choice.c.phraseChoiceRearward ./src/choice.c --- ./src/choice.c.phraseChoiceRearward 2008-12-02 00:29:20.000000000 +1000 -+++ ./src/choice.c 2009-06-26 15:59:23.000000000 +1000 ++++ ./src/choice.c 2009-07-31 17:16:57.000000000 +1000 @@ -71,22 +71,44 @@ static void ChangeSelectIntervalAndBreak } @@ -520,7 +536,7 @@ diff -up ./src/choice.c.phraseChoiceRearward ./src/choice.c + tail_tmp=begin; + } + -+ while(head<=head_tmp && tail_tmp>=tail){ ++ while(head<=head_tmp && tail_tmp<=tail){ + diff = tail_tmp - head_tmp; + pho_id = TreeFindPhrase( head_tmp, tail_tmp, phoneSeq ); if ( pho_id != -1 ) { @@ -559,7 +575,13 @@ diff -up ./src/choice.c.phraseChoiceRearward ./src/choice.c return 1; return 0; } -@@ -138,7 +166,7 @@ static void SetChoiceInfo( +@@ -133,12 +161,12 @@ static void SetChoiceInfo( + ChoiceInfo *pci,AvailInfo *pai, uint16 *phoneSeq, int cursor, + int candPerPage ) + { +- Word tempWord; ++ Word tempWord; + Phrase tempPhrase; int len; UserPhraseData *pUserPhraseData; uint16 userPhoneSeq[ MAX_PHONE_SEQ_LEN ]; diff --git a/libchewing.spec b/libchewing.spec index 752a0f6..d6390bd 100644 --- a/libchewing.spec +++ b/libchewing.spec @@ -1,7 +1,7 @@ Name: libchewing Version: 0.3.2 -Release: 13%{?dist} +Release: 14%{?dist} Summary: Intelligent phonetic input method library for Traditional Chinese Group: System Environment/Libraries @@ -98,6 +98,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/*.so %changelog +* Tue Jul 30 2009 Ding-Yi Chen - 0.3.2-14 +- Fix [Bug 512108] ibus-chewing crash the application + * Fri Jul 24 2009 Fedora Release Engineering - 0.3.2-13 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild @@ -109,7 +112,7 @@ rm -rf $RPM_BUILD_ROOT when repeatly press down key. * Wed May 20 2009 Ding-Yi Chen - 0.3.2-10 -- Need autoreconf and BuildRequires: pkgconfig to make changes in +- Need autoreconf and BuildRequires: pkgconfig to make changes in Makefile.am effective, thus actually fix [Bug 477960] libchewing multilib conflict. * Mon May 18 2009 Ding-Yi Chen - 0.3.2-9