diff -r 3e3bd14de94e -r c00b160ac7eb usbclasses/pictbridgeengine/src/dpsoperation.cpp --- a/usbclasses/pictbridgeengine/src/dpsoperation.cpp Wed Jun 09 10:48:05 2010 +0300 +++ b/usbclasses/pictbridgeengine/src/dpsoperation.cpp Mon Jun 21 16:49:27 2010 +0300 @@ -117,9 +117,15 @@ // jobConfig TInt count = iReqParam.iJobConfig.Count(); + TInt ret = KErrNone; + elemsP[0].iElement = EDpsJobConfig; elemsP[0].iNum = count; - aElements.Append(elemsP[0]); + if ( (ret = aElements.Append(elemsP[0])) != KErrNone ) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } for (TInt i = 0; i < count; i++) { argsP[i].iElement = iReqParam.iJobConfig[i].iElement; @@ -127,11 +133,14 @@ argsP[i].iContent.AppendNumUC(iReqParam.iJobConfig[i].iContent, EHex); // we have to append the low bytes (0000) argsP[i].iContent.Append(KDpsLowZero); - aArgs.Append(argsP[i]); + if ( (ret = aArgs.Append(argsP[i])) != KErrNone ) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } IF_DEBUG(Print(_L("the element is %d"), argsP[i].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[i].iContent))); } - // printInfo for (TInt j = 0; j < imageCount; j++) { @@ -141,7 +150,12 @@ argsP[count].iElement = EDpsArgFileID; argsP[count].iContent.AppendNumFixedWidth(objectHandles[j], EHex, KFullWordWidth); - aArgs.Append(argsP[count]); + if ( (ret = aArgs.Append(argsP[count])) != KErrNone ) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } + IF_DEBUG(Print(_L("the element is %d"), argsP[count].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[count].iContent))); @@ -152,7 +166,11 @@ { argsP[count].iElement = EDpsArgFileName; argsP[count].iContent.Copy(iReqParam.iPrintInfo[j].iFile); - aArgs.Append(argsP[count]); + if ( (ret = aArgs.Append(argsP[count])) != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } IF_DEBUG(Print(_L("the element is %d"), argsP[count].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[count].iContent))); @@ -164,7 +182,11 @@ { argsP[count].iElement = EDpsArgDate; argsP[count].iContent.Copy(iReqParam.iPrintInfo[j].iDate); - aArgs.Append(argsP[count]); + if ( (ret = aArgs.Append(argsP[count])) != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } IF_DEBUG(Print(_L("the element is %d"), argsP[count].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[count].iContent))); k++; count++; @@ -174,7 +196,11 @@ argsP[count].iElement = EDpsArgCopies; argsP[count].iContent.AppendNumFixedWidthUC( iReqParam.iPrintInfo[j].iCopies, EDecimal, KCopyFileWidth); - aArgs.Append(argsP[count]); + if ( (ret = aArgs.Append(argsP[count])) != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } IF_DEBUG(Print(_L("the element is %d"), argsP[count].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[count].iContent))); k++; count++; @@ -183,7 +209,11 @@ { argsP[count].iElement = EDpsArgPrtPID; argsP[count].iContent.AppendNumUC(iReqParam.iPrintInfo[j].iPrtPID); - aArgs.Append(argsP[count]); + if ( (ret = aArgs.Append(argsP[count])) != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } IF_DEBUG(Print(_L("the element is %d"), argsP[count].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[count].iContent))); k++; count++; @@ -192,14 +222,22 @@ { argsP[count].iElement = EDpsArgCopyID; argsP[count].iContent.AppendNumUC(iReqParam.iPrintInfo[j].iCopyID); - aArgs.Append(argsP[count]); + if ( (ret = aArgs.Append(argsP[count])) != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } IF_DEBUG(Print(_L("the element is %d"), argsP[count].iElement)); IF_DEBUG(Print(_L("the content is %S"), &(argsP[count].iContent))); k++; count++; } elemsP[j + 1].iNum = k; - aElements.Append(elemsP[j + 1]); + if ( (ret = aElements.Append(elemsP[j + 1])) != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } } delete[] objectHandles; @@ -257,9 +295,13 @@ arg.iElement = EDpsArgAbortStyle; arg.iContent.AppendNumUC(iReqParam.iAbortStyle, EHex); arg.iContent.Append(KDpsLowZero); - aArgs.Append(arg); + TInt ret = aArgs.Append(arg); + if (ret != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + } IF_DEBUG(Print(_L("<<>>TDpsGetCapability::FillRepArgs"))); CDpsXmlParser* XmlPar = aTrader->Parser(); + TInt ret = KErrNone; + if (aArgs.Count()) { if (EDpsArgPaperTypes == aArgs[0].iElement || @@ -428,12 +488,18 @@ { TDpsAttribute attrib; XmlPar->GetAttribute(attrib); - iRepParam.iContent.Append(attrib); + ret = iRepParam.iContent.Append(attrib); } else { - iRepParam.iContent.Append(0); - } + ret = iRepParam.iContent.Append(0); + } + + if (ret != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } } TUint32 value; TLex8 converter; @@ -466,16 +532,21 @@ TInt major = value >> KShiftLength; paperType.iMajor = (TDpsPaperTypeMajor)major; paperType.iMinor = (TDpsPaperTypeMinor)(value & KDpsMinorMask); - iRepParam.iPaperType.Append(paperType); + ret = iRepParam.iPaperType.Append(paperType); } else { // remove the extra zeros value = value >> KShiftLength; - iRepParam.iContent.Append(value); + ret = iRepParam.iContent.Append(value); IF_DEBUG(Print(_L("the value is %x"), value)); } + if (ret != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return ret; + } } iRepParam.iCap = aArgs[0].iElement; @@ -543,7 +614,12 @@ { return error; } - iRepParam.iDpsVersions.Append(version); + error = iRepParam.iDpsVersions.Append(version); + if (error != KErrNone) + { + IF_DEBUG(Print(_L("*** append error"))); + return error; + } } break;