diff -r f902e87c146f -r 748ec5531811 textrendering/textformatting/tbox/FRMPAGE.CPP --- a/textrendering/textformatting/tbox/FRMPAGE.CPP Wed Jun 09 11:40:52 2010 +0300 +++ b/textrendering/textformatting/tbox/FRMPAGE.CPP Tue Aug 31 17:01:26 2010 +0300 @@ -21,6 +21,11 @@ #include "FRMCONST.H" #include +#include "OstTraceDefinitions.h" +#ifdef OST_TRACE_COMPILER_IN_USE +#include "FRMPAGETraces.h" +#endif + #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS #include "FRMCONST_INTERNAL.H" #include "FRMCONST_PARTNER.H" @@ -91,6 +96,10 @@ @param aPrinterDevice The printer device. */ EXPORT_C void CTextPaginator::SetPrinterDevice(CPrinterDevice* aPrinterDevice) { + if (!iLayout) + { + OstTrace0( TRACE_FATAL, CTEXTPAGINATOR_SETPRINTERDEVICE, "EFDocumentToPaginateNotSet" ); + } __ASSERT_ALWAYS(iLayout,FormPanic(EFDocumentToPaginateNotSet)); iPrinterDevice=aPrinterDevice; iLayout->SetImageDeviceMap(aPrinterDevice); @@ -168,6 +177,10 @@ Note: SetDocumentL() must have been called beforehand, or a panic occurs. */ EXPORT_C void CTextPaginator::PaginateCompleteDocumentL() { + if (!iLayout) + { + OstTrace0( TRACE_FATAL, CTEXTPAGINATOR_PAGINATECOMPLETEDOCUMENTL, "EFDocumentToPaginateNotSet" ); + } __ASSERT_ALWAYS(iLayout,FormPanic(EFDocumentToPaginateNotSet)); if (iPageList->Count()==0) iPageList->AppendL(iLayDoc->LdDocumentLength()); @@ -196,7 +209,15 @@ @return A count of the current number of pages. */ EXPORT_C TInt CTextPaginator::AppendTextL(TInt& aCumulativeDocPos) { + if (!iLayout) + { + OstTrace0( TRACE_FATAL, CTEXTPAGINATOR_APPENDTEXTL, "EFDocumentToPaginateNotSet" ); + } __ASSERT_ALWAYS(iLayout,FormPanic(EFDocumentToPaginateNotSet)); + if (aCumulativeDocPos>=iLayout->DocumentLength()) + { + OstTrace0( TRACE_FATAL, DUP1_CTEXTPAGINATOR_APPENDTEXTL, "EFInvalidDocPos" ); + } __ASSERT_ALWAYS(aCumulativeDocPosDocumentLength(),FormPanic(EFInvalidDocPos)); iMode=EFPaginateIncrementally; @@ -227,7 +248,9 @@ TRAPD(err,CopyTempPageListL()); if (err) + { LeaveL(err); + } return iPageList->Count(); } @@ -457,6 +480,10 @@ // Copies temp page list to one that external user sees // { + if (iTempPageList->Count()<1 && iMode!=EFPaginateIncrementally) + { + OstTrace0( TRACE_DUMP, CTEXTPAGINATOR_COPYTEMPPAGELISTL, "EFPageListEmpty" ); + } __ASSERT_DEBUG(iTempPageList->Count()>=1||iMode==EFPaginateIncrementally,FormPanic(EFPageListEmpty)); TRAPD(err,iPageList->ResizeL(iTempPageList->Count())); if (err) @@ -486,6 +513,8 @@ if (iObserver) iObserver->NotifyError(aErr); + OstTrace1( TRACE_FATAL, CTEXTPAGINATOR_LEAVEL, "CTextPaginator::LeaveL;aErr=%d", aErr ); + User::Leave(aErr); }