Update contrib.
2 * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
4 * This component and the accompanying materials are made available
5 * under the terms of "Eclipse Public License v1.0"
6 * which accompanies this distribution, and is available
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
28 CTrapCleanup* cleanup=CTrapCleanup::New();
31 TFileName theFileName = _L("c:\\etext\\incp\\dunk.pml");
35 CRichText* richTextDoc;
36 TRAPD(ret, myParser=CParser::NewL());
37 TRAP(ret, richTextDoc = myParser->ParseL(theFileName));
39 // *********** insert test code here ****************
42 /* TInt para=richTextDoc->CountParas();
43 TInt length=richTextDoc->DocumentLength();
44 CParaFormat* myformat;
45 TRAP(ret,myformat=CParaFormat::NewL());
46 TCharFormat charFormat; CPicture* picture; TPtrC view;
47 TRAP(ret,richTextDoc->SenseParaFormatL(length,myformat));
48 TRAP(ret,richTextDoc->SenseChars(0,view,charFormat,picture));
49 TRAP(ret,richTextDoc->SenseChars(10,view,charFormat,picture));
50 richTextDoc->Delete(4,6);
51 //TRAP(ret,richTextDoc->InsertL(richTextDoc->DocumentLength(),EParagraphDelimiter));
54 // make rich text reader & read rich text doc & parse back to PML
55 CRichTextReader* myRTReader;
56 CBufSeg* returnedPmlDoc;
57 TRAP(ret, myRTReader = CRichTextReader::NewL());
58 TRAP(ret, returnedPmlDoc = myRTReader->ConvertRichText(richTextDoc));
62 TRAP(ret, myFileApp = CFileApp::NewL());
63 TInt errorLevel = myFileApp->SaveFile(returnedPmlDoc,theFileName);
66 Adt::Destroy(myFileApp);
67 Adt::Destroy(myRTReader);
68 Adt::Destroy(myParser);
69 Adt::Destroy(cleanup);