void CWsSpriteManager::CalcFloatingSpriteRgn( TRegion& aResultRgn, const TRect& aDefaultRect ) { aResultRgn.Clear(); for (TInt i=0 ; i<iFloatingSprites.Count() && !aResultRgn.CheckError(); i++) { CWsSpriteBase* sprite = iFloatingSprites[i]; if ( sprite->CanBeSeen() && ( sprite->IsActive() || sprite->IsActivated() ) ) { aResultRgn.AddRect( sprite->Rect() ); } } aResultRgn.Tidy(); if ( aResultRgn.CheckError() && iFloatingSprites.Count() > 0 ) { aResultRgn.Clear(); aResultRgn.AddRect( aDefaultRect ); } }
TBool CDataWrapperBase::GetRegionFromConfig(const TDesC& aSectName, const TDesC& aKeyName, TRegion& aResult) { TBuf<KMaxTestExecuteCommandLength> tempStore; TRect rect; aResult.Clear(); TBool moreData=ETrue; for ( TInt index=0; moreData; ) { tempStore.Format(KFormatFieldNumber, &aKeyName, ++index); moreData=GetRectFromConfig(aSectName, tempStore, rect); if ( moreData ) { aResult.AddRect(rect); } } return aResult.Count()>0; }