Update contrib.
2 * Copyright (c) 2000-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.
19 #include "EditorUndo.h"
20 #include "EditorCommands.h"
21 #include "UndoSystem.h"
22 #include "AssertFileAndLine.h"
24 using namespace UndoSystem;
28 // Functions for Unique Instance Repositories
34 TInt CompareCharFormatMasks(const TTmCharFormatMask* aL, const TTmCharFormatMask* aR)
36 TUint32 left = aL->iFlags;
37 TUint32 right= aR->iFlags;
44 TInt CompareParFormatMasks(const TTmParFormatMask* aL, const TTmParFormatMask* aR)
46 TUint32 left = aL->iFlags;
47 TUint32 right= aR->iFlags;
54 // aLeftEnd is one-past-end pointer for the memory beginning at aLeft.
55 TInt CompareRawMem(const TUint32* aLeft, const TUint32* aRight, const TUint32* aLeftEnd)
57 while (aLeft != aLeftEnd)
68 // void* for convenience, const TUint32* would be better
69 // aLeftEnd is one-past-end pointer for the memory beginning at aLeft.
70 TInt CompareMemByUint32(const void* aLeft, const void* aRight, const void* aLeftEnd)
72 ASSERT((reinterpret_cast<TUint32>(aLeft) & 3) == 0);
73 ASSERT((reinterpret_cast<TUint32>(aRight) & 3) == 0);
74 ASSERT((reinterpret_cast<TUint32>(aLeftEnd) & 3) == 0);
76 reinterpret_cast<const TUint32*>(aLeft),
77 reinterpret_cast<const TUint32*>(aRight),
78 reinterpret_cast<const TUint32*>(aLeftEnd));
80 TInt CompareOpenFontSpec(const TOpenFontSpec* aL, const TOpenFontSpec* aR)
82 // We can almost compare TOpenFontSpecs bitwise, except for the fact that
83 // there is a literal name of the font at the start. We must compare these
84 // names, and skip over them for the full compare.
85 TInt nameComp = aL->Name().Compare(aR->Name());
88 const TText* lText = reinterpret_cast<const TText*>(aL) + TOpenFontFaceAttribBase::ENameLength;
89 const TText* rText = reinterpret_cast<const TText*>(aR) + TOpenFontFaceAttribBase::ENameLength;
90 return CompareMemByUint32(lText, rText, aL + 1);
92 TInt CompareCharFormats(const TTmCharFormat* aL, const TTmCharFormat* aR)
94 TInt fontSpecCompare = CompareOpenFontSpec(&aL->iFontSpec, &aR->iFontSpec);
95 if (fontSpecCompare != 0)
96 return fontSpecCompare;
97 return CompareMemByUint32(&aL->iTextColor, &aR->iTextColor, aL + 1);
99 TBool operator<(const TTmTab& aL, const TTmTab& aR)
101 if (aL.iPosition != aR.iPosition)
102 return aL.iPosition < aR.iPosition;
103 return aL.iType < aR.iType;
105 TBool operator<(const TTmParBorder& aL, const TTmParBorder& aR)
107 if (aL.iAutoColor != aR.iAutoColor)
108 return aR.iAutoColor;
109 if (aL.iColor.Value() != aR.iColor.Value())
110 return aL.iColor.Value() < aR.iColor.Value();
111 if (aL.iStyle != aR.iStyle)
112 return aL.iStyle < aR.iStyle;
113 return aL.iWeight < aR.iWeight;
115 TInt CompareParFormats(const RTmParFormat* left, const RTmParFormat* right)
117 const TLogicalRgb* leftBodyEnd = &left->iBackgroundColor;
118 TInt bodyCompare = CompareMemByUint32(left, right, leftBodyEnd + 1);
119 if (bodyCompare != 0)
121 TInt tabs = left->Tabs();
122 if (right->Tabs() < tabs)
123 tabs = right->Tabs();
125 for(TInt i = 0; i != tabs; ++i)
127 if (left->Tab(i) != right->Tab(i))
128 return left->Tab(i) < right->Tab(i)? -1 : 1;
131 if (left->Tabs() != right->Tabs())
132 return left->Tabs() < right->Tabs()? -1 : 1;
134 const TTmBullet* leftBullet = left->Bullet();
135 const TTmBullet* rightBullet = right->Bullet();
136 if (leftBullet != rightBullet)
142 if (leftBullet->iCharacterCode < rightBullet->iCharacterCode)
144 if (rightBullet->iCharacterCode < leftBullet->iCharacterCode)
146 TInt fontSpecCompare = CompareOpenFontSpec(&leftBullet->iFontSpec,
147 &rightBullet->iFontSpec);
148 if (fontSpecCompare != 0)
149 return fontSpecCompare;
151 return CompareMemByUint32(&leftBullet->iHangingIndent, &rightBullet->iHangingIndent,
156 for (TInt i = 0; i != 4; ++i)
158 const TTmParBorder* lb =
159 left->Border(static_cast<RTmParFormat::TBorderIndex>(i));
160 const TTmParBorder* rb =
161 right->Border(static_cast<RTmParFormat::TBorderIndex>(i));
177 void DeleteParFormat(RTmParFormat* a)
182 RTmParFormat* CopyParFormatL(const RTmParFormat* a, TInt)
184 RTmParFormat* r = new(ELeave) RTmParFormat;
185 CleanupStack::PushL(r);
187 CleanupStack::Pop(r);
191 using namespace EditorUndo;
194 * Command factory. Used for obtaining 'command' versions of API calls to MUnifiedEditor.
197 * @since App-frameworks6.1
199 NONSHARABLE_CLASS(CEditorCommandFactory) : public CBase
202 ~CEditorCommandFactory();
203 static CEditorCommandFactory* NewL(MUnifiedEditor& aTarget);
205 // these commands set up the prototypes and then pass them back
206 const CEditorCommandCreateStyleProto*
207 GetCreateStyleProto(const RTmStyle&);
208 const CEditorCommandChangeStyleProto*
209 GetChangeStyleProto(const RTmStyle&);
210 const CEditorCommandSetStyleProto*
211 GetSetStyleProto(TInt aPos,
214 const CEditorCommandDeleteStyleProto*
215 GetDeleteStyleProto(const TDesC& aName);
216 const CEditorCommandDeleteCharFormatProto*
217 GetDeleteCharFormatProto(TInt aPos,
219 const CEditorCommandDeleteParFormatProto*
220 GetDeleteParFormatProto(TInt aPos,
222 const CEditorCommandSetCharFormatProto*
223 GetSetCharFormatProto(TInt aPos,
225 const TTmCharFormatLayer& aFormat);
226 const CEditorCommandSetParFormatProto*
227 GetSetParFormatProto(TInt aPos,
229 const RTmParFormatLayer& aFormat);
230 const CEditorCommandInsertProto*
231 GetInsertProto(TInt aPos,
234 const TTmCharFormatLayer* aCharFormat,
235 const RTmParFormatLayer* aParFormat);
236 const CEditorCommandDeletePictureProto*
237 GetDeletePictureProto(TInt aPos);
238 // this is only safe if there are no pictures to delete.
239 // If there are, multiple commands must be issued.
240 const CEditorCommandDeleteProto*
241 GetDeleteProto(TInt aPos, TInt aLength);
242 const CEditorCommandInsertPictureProto*
243 GetInsertPictureProto(TInt aPos, const TPictureHeader& aPicture);
244 const CEditorCommandDestroyPictureProto*
245 GetDestroyPictureProto(TInt aPos);
246 const CEditorCommandRenameStyleProto*
247 GetRenameStyleProto(const TDesC& aOldName, const TDesC& aNewName);
248 const CEditorCommandSetBaseFormatProto*
249 GetSetBaseFormatProto(const TTmCharFormat* aCharFormat,
250 const RTmParFormat* aParFormat);
251 const CEditorCommandPasteProto*
252 GetPasteProto(const CStreamStore& aStore,
253 const CStreamDictionary& aStreamDictionary, TInt aPos);
256 CEditorCommandFactory(MUnifiedEditor& aTarget);
260 MUnifiedEditor& iTarget;
261 // like Design Pattern prototypes, but not quite, because rather than
262 // being clonable, they create inverses of themselves
263 CEditorCommandCreateStyleProto iCreateStyleProto;
264 CEditorCommandChangeStyleProto iChangeStyleProto;
265 CEditorCommandSetStyleProto iSetStyleProto;
266 CEditorCommandDeleteStyleProto iDeleteStyleProto;
267 CEditorCommandSetCharFormatProto iSetCharFormatProto;
268 CEditorCommandSetParFormatProto iSetParFormatProto;
269 CEditorCommandInsertProto iInsertProto;
270 CEditorCommandDeleteProto iDeleteProto;
271 CEditorCommandDeleteCharFormatProto iDeleteCharFormatProto;
272 CEditorCommandDeleteParFormatProto iDeleteParFormatProto;
273 CEditorCommandDeletePictureProto iDeletePictureProto;
274 CEditorCommandInsertPictureProto iInsertPictureProto;
275 CEditorCommandDestroyPictureProto iDestroyPictureProto;
276 CEditorCommandRenameStyleProto iRenameStyleProto;
277 CEditorCommandSetBaseFormatProto iSetBaseFormatProto;
278 CEditorCommandPasteProto iPasteProto;
287 CEditorWithUndo::CEditorWithUndo() {}
289 CEditorWithUndo::~CEditorWithUndo()
292 iCommandManager->Release();
296 void CEditorWithUndo::ConstructL(MUnifiedEditor& aEditorBasedOn, CCommandManager* aUndoSys)
298 iBaseEditor = &aEditorBasedOn;
299 iFactory = CEditorCommandFactory::NewL(aEditorBasedOn);
301 iCommandManager = CCommandManager::NewL();
304 iCommandManager = aUndoSys;
305 iCommandManager->NewReference();
309 EXPORT_C CEditorWithUndo* CEditorWithUndo::NewL(MUnifiedEditor& aEditor,
310 CCommandManager* aUndoSys)
312 CEditorWithUndo *r = new(ELeave) CEditorWithUndo;
313 CleanupStack::PushL(r);
314 r->ConstructL(aEditor, aUndoSys);
315 CleanupStack::Pop(r);
319 EXPORT_C CEditorWithUndo* CEditorWithUndo::NewL(MUnifiedEditor& aEditor)
321 return NewL(aEditor, 0);
324 EXPORT_C MNotUndoableGatekeeper*
325 CEditorWithUndo::SetGatekeeper(MNotUndoableGatekeeper* a)
327 return iCommandManager->SetGatekeeper(a);
330 MTmOptionalInterface* CEditorWithUndo::Interface(TUint aId)
332 if (!iBaseEditor->Interface(aId))
334 if (aId == KUidMUnifiedEditorStyleSupport)
335 return static_cast<MUnifiedEditor::MStyleSupport*>(this);
336 if (aId == KUidMUnifiedEditorPictureSupport)
337 return static_cast<MUnifiedEditor::MPictureSupport*>(this);
338 if (aId == KUidMUnifiedEditorClipboardSupport)
339 return static_cast<MUnifiedEditor::MClipboardSupport*>(this);
344 // history control methods
347 EXPORT_C void CEditorWithUndo::UndoL()
349 iCommandManager->UndoL();
352 EXPORT_C void CEditorWithUndo::RedoL()
354 iCommandManager->RedoL();
357 EXPORT_C TBool CEditorWithUndo::CanUndo() const
359 return iCommandManager->CanUndo();
362 EXPORT_C TBool CEditorWithUndo::CanRedo() const
364 return iCommandManager->CanRedo();
367 EXPORT_C void CEditorWithUndo::ResetUndo()
369 iCommandManager->ResetUndo();
372 EXPORT_C void CEditorWithUndo::SetMaxItems(TInt aMaxItems)
374 iCommandManager->SetMaxItems(aMaxItems);
378 // purely delegated editor methods
380 TInt CEditorWithUndo::DocumentLength() const
383 return iBaseEditor->DocumentLength();
386 TInt CEditorWithUndo::StyleCount() const
389 MUnifiedEditor::MStyleSupport* si = iBaseEditor->StyleSupport();
390 return si? si->StyleCount() : 0;
393 void CEditorWithUndo::GetStyle(TInt aPos,
394 TPtrC& aName, TInt& aRunLength) const
397 MUnifiedEditor::MStyleSupport* si = iBaseEditor->StyleSupport();
399 si->GetStyle(aPos, aName, aRunLength);
402 TInt CEditorWithUndo::GetStyleByNameL(const TDesC& aName,
403 RTmStyle& aStyle) const
406 MUnifiedEditor::MStyleSupport* si = iBaseEditor->StyleSupport();
408 return si->GetStyleByNameL(aName, aStyle);
411 TInt CEditorWithUndo::GetStyleByIndexL(TInt aIndex,
412 RTmStyle& aStyle) const
415 MUnifiedEditor::MStyleSupport* si = iBaseEditor->StyleSupport();
417 return si->GetStyleByIndexL(aIndex, aStyle);
420 void CEditorWithUndo::GetText(TInt aPos,TPtrC& aText) const
423 iBaseEditor->GetText(aPos, aText);
426 void CEditorWithUndo::GetCharFormat(TInt aPos,
428 TTmCharFormatLayer& aFormat,
429 TInt& aRunLength) const
432 iBaseEditor->GetCharFormat(aPos, aLevel, aFormat, aRunLength);
435 void CEditorWithUndo::GetParFormatL(TInt aPos,
437 RTmParFormatLayer& aFormat,
438 TInt& aRunLength) const
441 iBaseEditor->GetParFormatL(aPos, aLevel, aFormat, aRunLength);
444 void CEditorWithUndo::GetBaseFormatL(TTmCharFormat& aCharFormat,
445 RTmParFormat& aParFormat) const
448 iBaseEditor->GetBaseFormatL(aCharFormat, aParFormat);
451 void CEditorWithUndo::CopyToStoreL(CStreamStore& aStore,
452 CStreamDictionary& aDictionary,
457 MUnifiedEditor::MClipboardSupport* ci = iBaseEditor->ClipboardSupport();
459 ci->CopyToStoreL(aStore, aDictionary, aPos, aLength);
463 // methods for altering styles
465 TInt CEditorWithUndo::CreateStyleL(const RTmStyle& aStyle)
468 const CSingleCommand* proto =
469 iFactory->GetCreateStyleProto(aStyle);
471 return iCommandManager->ExecuteL(*proto);
474 TInt CEditorWithUndo::ChangeStyleL(const RTmStyle& aStyle)
477 const CSingleCommand* proto =
478 iFactory->GetChangeStyleProto(aStyle);
480 return iCommandManager->ExecuteL(*proto);
483 TInt CEditorWithUndo::SetStyleL(TInt aPos,
488 const CSingleCommand* proto =
489 iFactory->GetSetStyleProto(aPos, aLength, aName);
491 return iCommandManager->ExecuteL(*proto);
494 TInt CEditorWithUndo::DeleteStyleL(const TDesC& aName)
497 const CSingleCommand* proto =
498 iFactory->GetDeleteStyleProto(aName);
500 return iCommandManager->ExecuteL(*proto);
503 void CEditorWithUndo::SetBaseFormatL(const TTmCharFormat& aChar,
504 const RTmParFormat& aPar)
507 const CSingleCommand* proto =
508 iFactory->GetSetBaseFormatProto(&aChar, &aPar);
510 iCommandManager->ExecuteL(*proto);
513 TInt CEditorWithUndo::RenameStyleL(const TDesC& aOldName,
514 const TDesC& aNewName)
517 const CSingleCommand* proto =
518 iFactory->GetRenameStyleProto(aOldName, aNewName);
520 return iCommandManager->ExecuteL(*proto);
524 // methods for altering format
526 void CEditorWithUndo::DeleteCharFormatL(TInt aPos,
530 const CSingleCommand* proto =
531 iFactory->GetDeleteCharFormatProto(aPos, aLength);
533 iCommandManager->ExecuteL(*proto);
536 void CEditorWithUndo::DeleteParFormatL(TInt aPos,
540 const CSingleCommand* proto =
541 iFactory->GetDeleteParFormatProto(aPos, aLength);
543 iCommandManager->ExecuteL(*proto);
546 void CEditorWithUndo::SetCharFormatL(TInt aPos,
548 const TTmCharFormatLayer& aFormat)
551 const CSingleCommand* proto =
552 iFactory->GetSetCharFormatProto(aPos, aLength, aFormat);
554 iCommandManager->ExecuteL(*proto);
557 void CEditorWithUndo::SetParFormatL(TInt aPos,
559 const RTmParFormatLayer& aFormat)
562 const CSingleCommand* proto =
563 iFactory->GetSetParFormatProto(aPos, aLength, aFormat);
565 iCommandManager->ExecuteL(*proto);
569 // methods for altering text
571 void CEditorWithUndo::InsertTextL(TInt aPos,
574 const TTmCharFormatLayer* aCharFormat,
575 const RTmParFormatLayer* aParFormat)
578 const CSingleCommand* proto =
579 iFactory->GetInsertProto(aPos, aText, aStyle, aCharFormat, aParFormat);
581 iCommandManager->ExecuteL(*proto);
584 void CEditorWithUndo::DeleteTextL(TInt aPos, TInt aLength)
588 TInt picPos = UndoSystem::FindPicture(*iBaseEditor, aPos, aLength);
591 const CSingleCommand* proto =
592 iFactory->GetDeleteProto(aPos, aLength);
594 iCommandManager->ExecuteL(*proto);
598 iCommandManager->BeginBatchLC();
601 picPos = UndoSystem::FindPicture(*iBaseEditor, aPos, aLength);
602 const CSingleCommand* proto = 0;
605 proto = iFactory->GetDestroyPictureProto(aPos);
610 TInt segLength = 0 <= picPos? picPos - aPos : aLength;
611 proto = iFactory->GetDeleteProto(aPos, segLength);
612 aLength -= segLength;
615 iCommandManager->ExecuteL(*proto);
616 ASSERT(0 <= aLength);
618 CleanupStack::PopAndDestroy(); // command manager's batch
622 // methods for pictures
624 void CEditorWithUndo::Picture(TInt aPos, TPictureHeader& aPictureOut) const
627 MUnifiedEditor::MPictureSupport* pi = iBaseEditor->PictureSupport();
630 aPictureOut.iPicture = 0;
631 aPictureOut.iPictureType = KNullUid;
634 pi->Picture(aPos, aPictureOut);
637 void CEditorWithUndo::InsertPictureL(TInt aPos,
638 const TPictureHeader& aPicture)
641 const CSingleCommand* proto =
642 iFactory->GetInsertPictureProto(aPos, aPicture);
644 iCommandManager->ExecuteL(*proto);
647 void CEditorWithUndo::DropPictureL(TInt aPos)
650 const CSingleCommand* proto =
651 iFactory->GetDeletePictureProto(aPos);
653 iCommandManager->ExecuteL(*proto);
660 void CEditorWithUndo::PasteFromStoreL(const CStreamStore& aStore,
661 const CStreamDictionary& aDictionary,
665 const CSingleCommand* proto =
666 iFactory->GetPasteProto(aStore, aDictionary, aPos);
668 iCommandManager->ExecuteL(*proto);
673 // CEditorCommandFactory
677 CEditorCommandFactory::CEditorCommandFactory(MUnifiedEditor& aTarget) :
679 iCreateStyleProto(iReps, aTarget),
680 iChangeStyleProto(iReps, aTarget),
681 iSetStyleProto(iReps, aTarget),
682 iDeleteStyleProto(iReps, aTarget),
683 iSetCharFormatProto(iReps, aTarget),
684 iSetParFormatProto(iReps, aTarget),
685 iInsertProto(iReps, aTarget),
686 iDeleteProto(iReps, aTarget),
687 iDeleteCharFormatProto(iReps, aTarget),
688 iDeleteParFormatProto(iReps, aTarget),
689 iDeletePictureProto(iReps, aTarget),
690 iInsertPictureProto(iReps, aTarget),
691 iDestroyPictureProto(iReps, aTarget),
692 iRenameStyleProto(iReps, aTarget),
693 iSetBaseFormatProto(iReps, aTarget),
694 iPasteProto(iReps, aTarget)
698 void CEditorCommandFactory::ConstructL()
700 iReps.iChar = CUniqueInstanceRepository<TTmCharFormat>
701 ::NewL(CompareCharFormats);
702 iReps.iPar = CUniqueInstanceRepository<RTmParFormat>
703 ::NewL(CompareParFormats, DeleteParFormat, CopyParFormatL);
704 iReps.iDes = CUniqueInstanceRepository<TDes>::NewL();
707 CEditorCommandFactory::~CEditorCommandFactory()
714 CEditorCommandFactory* CEditorCommandFactory::NewL(MUnifiedEditor& aTarget)
716 CEditorCommandFactory* r = new(ELeave) CEditorCommandFactory(aTarget);
717 CleanupStack::PushL(r);
719 CleanupStack::Pop(r);
723 const CEditorCommandChangeStyleProto*
724 CEditorCommandFactory::GetChangeStyleProto(const RTmStyle& aStyle)
726 iChangeStyleProto.Set(aStyle);
727 return &iChangeStyleProto;
730 const CEditorCommandCreateStyleProto*
731 CEditorCommandFactory::GetCreateStyleProto(const RTmStyle& aStyle)
733 iCreateStyleProto.Set(aStyle);
734 return &iCreateStyleProto;
737 const CEditorCommandSetStyleProto*
738 CEditorCommandFactory::GetSetStyleProto(TInt aPos,
742 iSetStyleProto.Set(aPos, aLength, aName);
743 return &iSetStyleProto;
746 const CEditorCommandDeleteStyleProto*
747 CEditorCommandFactory::GetDeleteStyleProto(const TDesC& aName)
749 iDeleteStyleProto.Set(aName);
750 return &iDeleteStyleProto;
753 const CEditorCommandDeleteCharFormatProto*
754 CEditorCommandFactory::GetDeleteCharFormatProto(TInt aPos, TInt aLength)
756 iDeleteCharFormatProto.Set(aPos, aLength);
757 return &iDeleteCharFormatProto;
760 const CEditorCommandDeleteParFormatProto*
761 CEditorCommandFactory::GetDeleteParFormatProto(TInt aPos, TInt aLength)
763 iDeleteParFormatProto.Set(aPos, aLength);
764 return &iDeleteParFormatProto;
767 const CEditorCommandSetCharFormatProto*
768 CEditorCommandFactory::GetSetCharFormatProto(TInt aPos,
770 const TTmCharFormatLayer& aFormat)
772 iSetCharFormatProto.Set(aPos, aLength, aFormat);
773 return &iSetCharFormatProto;
776 const CEditorCommandSetParFormatProto*
777 CEditorCommandFactory::GetSetParFormatProto(TInt aPos,
779 const RTmParFormatLayer& aFormat)
781 iSetParFormatProto.Set(aPos, aLength, aFormat);
782 return &iSetParFormatProto;
785 const CEditorCommandInsertProto*
786 CEditorCommandFactory::GetInsertProto(TInt aPos,
789 const TTmCharFormatLayer* aCharFormat,
790 const RTmParFormatLayer* aParFormat)
792 iInsertProto.Set(aPos, aText, aStyle, aCharFormat, aParFormat);
793 return &iInsertProto;
796 const CEditorCommandDeleteProto*
797 CEditorCommandFactory::GetDeleteProto(TInt aPos, TInt aLength)
799 iDeleteProto.Set(aPos, aLength);
800 return &iDeleteProto;
803 const CEditorCommandDeletePictureProto*
804 CEditorCommandFactory::GetDeletePictureProto(TInt aPos)
806 iDeletePictureProto.Set(aPos);
807 return &iDeletePictureProto;
810 const CEditorCommandInsertPictureProto*
811 CEditorCommandFactory::GetInsertPictureProto(TInt aPos,
812 const TPictureHeader& aPicture)
814 iInsertPictureProto.Set(aPos, aPicture);
815 return &iInsertPictureProto;
818 const CEditorCommandDestroyPictureProto*
819 CEditorCommandFactory::GetDestroyPictureProto(TInt aPos)
821 iDestroyPictureProto.Set(aPos);
822 return &iDestroyPictureProto;
825 const CEditorCommandRenameStyleProto*
826 CEditorCommandFactory::GetRenameStyleProto(const TDesC& aOldName,
827 const TDesC& aNewName)
829 iRenameStyleProto.Set(aOldName, aNewName);
830 return &iRenameStyleProto;
833 const CEditorCommandSetBaseFormatProto*
834 CEditorCommandFactory::GetSetBaseFormatProto(const TTmCharFormat* aCharFormat,
835 const RTmParFormat* aParFormat)
837 iSetBaseFormatProto.Set(aCharFormat, aParFormat);
838 return &iSetBaseFormatProto;
841 const CEditorCommandPasteProto*
842 CEditorCommandFactory::GetPasteProto(const CStreamStore& aStore,
843 const CStreamDictionary& aStreamDictionary, TInt aPos)
845 iPasteProto.Set(aStore, aStreamDictionary, aPos);