mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
fix crasher due to uninited var; add static util method
This commit is contained in:
parent
4c1e3a69ac
commit
f5f014d9ae
1 changed files with 14 additions and 10 deletions
|
@ -24,13 +24,15 @@
|
||||||
#include "symgamdl.h"
|
#include "symgamdl.h"
|
||||||
#include "symutil.h"
|
#include "symutil.h"
|
||||||
#include "xwords.hrh"
|
#include "xwords.hrh"
|
||||||
|
#include "xwords.rsg"
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* TGameInfoBuf
|
* TGameInfoBuf
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
TGameInfoBuf::TGameInfoBuf( const CurGameInfo* aGi,
|
TGameInfoBuf::TGameInfoBuf( const CurGameInfo* aGi,
|
||||||
CDesC16ArrayFlat* aDictList )
|
CDesC16ArrayFlat* aDictList )
|
||||||
: iDictList(aDictList)
|
: iDictList(aDictList),
|
||||||
|
iDictIndex(0)
|
||||||
{
|
{
|
||||||
TInt i;
|
TInt i;
|
||||||
|
|
||||||
|
@ -46,9 +48,7 @@ TGameInfoBuf::TGameInfoBuf( const CurGameInfo* aGi,
|
||||||
TBuf8<32> tmp( aGi->dictName );
|
TBuf8<32> tmp( aGi->dictName );
|
||||||
TBuf16<32> dictName;
|
TBuf16<32> dictName;
|
||||||
dictName.Copy( tmp );
|
dictName.Copy( tmp );
|
||||||
TInt found = iDictList->Find( dictName,
|
(void)iDictList->Find( dictName, iDictIndex ); /*iDictIndex ref passed*/
|
||||||
iDictIndex ); /* iDictIndex ref passed */
|
|
||||||
XP_ASSERT( found == 0 );
|
|
||||||
}
|
}
|
||||||
} /* TGameInfoBuf::TGameInfoBuf */
|
} /* TGameInfoBuf::TGameInfoBuf */
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ TGameInfoBuf::CopyToL( MPFORMAL CurGameInfo* aGi )
|
||||||
* CXWGameInfoDlg
|
* CXWGameInfoDlg
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
CXWGameInfoDlg::CXWGameInfoDlg( MPFORMAL TGameInfoBuf* aGib, TBool aNewGame )
|
CXWGameInfoDlg::CXWGameInfoDlg( MPFORMAL TGameInfoBuf* aGib, TBool aNewGame )
|
||||||
: iGib(aGib), iIsNewGame(aNewGame)
|
: iIsNewGame(aNewGame), iGib(aGib)
|
||||||
{
|
{
|
||||||
MPASSIGN( this->mpool, mpool );
|
MPASSIGN( this->mpool, mpool );
|
||||||
}
|
}
|
||||||
|
@ -85,7 +85,7 @@ CXWGameInfoDlg::~CXWGameInfoDlg()
|
||||||
void
|
void
|
||||||
CXWGameInfoDlg::PreLayoutDynInitL()
|
CXWGameInfoDlg::PreLayoutDynInitL()
|
||||||
{
|
{
|
||||||
TInt i;
|
XP_U16 i;
|
||||||
CEikChoiceList* list;
|
CEikChoiceList* list;
|
||||||
|
|
||||||
/* This likely belongs in its own method */
|
/* This likely belongs in its own method */
|
||||||
|
@ -104,12 +104,10 @@ CXWGameInfoDlg::PreLayoutDynInitL()
|
||||||
|
|
||||||
list = static_cast<CEikChoiceList*>(Control(ESelDictChoice));
|
list = static_cast<CEikChoiceList*>(Control(ESelDictChoice));
|
||||||
list->SetArrayL( iGib->iDictList );
|
list->SetArrayL( iGib->iDictList );
|
||||||
list->SetArrayExternalOwnership( ETrue );
|
|
||||||
list->SetCurrentItem( iGib->iDictIndex );
|
list->SetCurrentItem( iGib->iDictIndex );
|
||||||
|
|
||||||
iCurPlayerShown = 0;
|
iCurPlayerShown = 0;
|
||||||
LoadPlayerInfo( iCurPlayerShown );
|
LoadPlayerInfo( iCurPlayerShown );
|
||||||
|
|
||||||
} /* PreLayoutDynInitL */
|
} /* PreLayoutDynInitL */
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -190,8 +188,6 @@ CXWGameInfoDlg::OkToExitL( TInt aKeyCode )
|
||||||
list = static_cast<CEikChoiceList*>(Control(ENPlayersList));
|
list = static_cast<CEikChoiceList*>(Control(ENPlayersList));
|
||||||
iGib->iNPlayers = list->CurrentItem() + 1;
|
iGib->iNPlayers = list->CurrentItem() + 1;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
return ETrue;
|
return ETrue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -265,3 +261,11 @@ CXWGameInfoDlg::MakeNumListL( TInt aFirst, TInt aLast )
|
||||||
|
|
||||||
return list;
|
return list;
|
||||||
} /* MakeNumListL */
|
} /* MakeNumListL */
|
||||||
|
|
||||||
|
/* static*/ TBool
|
||||||
|
CXWGameInfoDlg::DoGameInfoDlgL( MPFORMAL TGameInfoBuf* aGib, TBool aNewGame )
|
||||||
|
{
|
||||||
|
CXWGameInfoDlg* me =
|
||||||
|
new(ELeave)CXWGameInfoDlg( MPPARM(mpool) aGib, aNewGame );
|
||||||
|
return me->ExecuteLD( R_XWORDS_NEWGAME_DLG );
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue