gaopeng wrote:
> Hi ,
> Anybody can tell me what function is the code labeled with red color :
> void SAL_CALL SwClipboardChangeListener::changedContents( const
> CLIP_NMSPC::ClipboardEvent& rEventObject ) throw ( RuntimeException )
> {
> ...............
>
> pView->nLastPasteDestination = SwTransferable::GetSotDestination( rSh );
> pView->bPasteState = aDataHelper.GetXTransferable().is() &&
> SwTransferable::IsPaste( rSh, aDataHelper );
>
> pView->bPasteSpecialState = aDataHelper.GetXTransferable().is() &&
> SwTransferable::IsPasteSpecial( rSh, aDataHelper );
>
> .................
>
> SfxBindings& rBind = pView->GetViewFrame()->GetBindings();
> rBind.Invalidate( SID_PASTE );
> rBind.Invalidate( FN_PASTESPECIAL );
> rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
> ..................
> }
It seems that your coloring got lost. It's not a good idea to use HTML
formatting anyway, marking the code in a way that it is transported in
text only mails should be preferred.
Anyway, I wonder which part of the code you are referring to, but the
posted code is small enough to describe it completely.
This code evaluates whether the document is able to paste the provided
content at all ("IsPaste") and if perhaps more than one format is
supported ("IsPasteSpecial"). This information is stored in pView.
Then the sfx2 framework is notified that possibly all UI elements
relating to the "Paste" and "Paste Special" functionality need a state
update, e.g. a disabled "Paste" button now might want to become enabled.
The "Invalidate" calls will not change the button state immediately,
they will trigger an update timer in SfxBindings that will do the
necessary updates some milliseconds later.
Ciao,
Mathias
--
Mathias Bauer (mba) - Project Lead OpenOffice.org Writer
OpenOffice.org Engineering at Sun: http://blogs.sun.com/GullFOSS
Please don't reply to "[EMAIL PROTECTED]".
I use it for the OOo lists and only rarely read other mails sent to it.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]