maoyg wrote:
> I have some questions about Undo which hover in my mind these days. I have 
> two rough ideas in mind...
> 
> First idea:
> I don't completely understand the specificaton on Undo.
> I make some operations in normol mode,for example,I input some characters in 
> cell,or I change the column widths.
> the undo remembers these operations. when I switch from normal mode to page 
> preview mode.
> Should operations that are recorded in Undo list in normol mode be used in 
> page preview mode ?
> on the contrary,
> Should operations that are recorded in Undo list in page preview mode be used 
> in normol mode ?
> e.g. I change the column widths in page preview mode.
> My thought is that operations that are recorded in Undo list in normol mode 
> can't be used in page preview mode 
> or operations that are recorded in Undo list in page preview mode can't be 
> used in normol mode.

There's a single list of undo actions for the document, and only the
last action can be undone.

> Second idea:
> I trace the code, debug the application, find it's difficult for me to 
> distingush the two mode accurrately.
> I add 
> "SfxViewShell* pCur = SfxViewShell::Current(); 
> ScPreviewShell* pViewSh = PTR_CAST(ScPreviewShell,pCur);
> SfxUndoManager* pUndoManager=pViewSh->GetUndoManager();" 
> to distingush the two mode in ScPreviewShell::ExecuteUndo(...),
> But pUndoManager is null, I found pUndoMgr is null too in 
> SfxShell::GetUndoManager(), 
> the reason is when switching from normal mode to page preview mode, the 
> SfxUndoManager has been deconstructed.
> Do you think whether I am in the right direction?

The SfxUndoManager for the document isn't deleted. It's available from
the DocShell.

Niklas

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to