Kaydet (Commit) de774e26 authored tarafından Ashod Nakashian's avatar Ashod Nakashian Kaydeden (comit) Ashod Nakashian

lok: notify clients of clipboard changes

Change-Id: I93d8eacc0defb1176ec5d767f49356812cf90ff6
Reviewed-on: https://gerrit.libreoffice.org/50327Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarAshod Nakashian <ashnakash@gmail.com>
üst df425378
......@@ -568,6 +568,17 @@ typedef enum
* - "close" - window is closed
*/
LOK_CALLBACK_WINDOW = 36,
/**
* Notification that the clipboard contents have changed.
* Typically fired in response to copying to clipboard.
*
* The payload currently is empty and it's up to the
* client to get the contents, if necessary. However,
* in the future the contents might be included for
* convenience.
*/
LOK_CALLBACK_CLIPBOARD_CHANGED = 37,
}
LibreOfficeKitCallbackType;
......
......@@ -156,12 +156,18 @@ SfxClipboardChangeListener::SfxClipboardChangeListener( SfxViewShell* pView, con
void SfxClipboardChangeListener::ChangedContents()
{
const SolarMutexGuard aGuard;
if( m_pViewShell )
if (m_pViewShell)
{
SfxBindings& rBind = m_pViewShell->GetViewFrame()->GetBindings();
rBind.Invalidate( SID_PASTE );
rBind.Invalidate( SID_PASTE_SPECIAL );
rBind.Invalidate( SID_CLIPBOARD_FORMAT_ITEMS );
rBind.Invalidate(SID_PASTE);
rBind.Invalidate(SID_PASTE_SPECIAL);
rBind.Invalidate(SID_CLIPBOARD_FORMAT_ITEMS);
if (comphelper::LibreOfficeKit::isActive())
{
// In the future we might send the payload as well.
SfxLokHelper::notifyAllViews(LOK_CALLBACK_CLIPBOARD_CHANGED, "");
}
}
}
......@@ -823,7 +829,7 @@ SfxInPlaceClient* SfxViewShell::GetUIActiveClient() const
if ( !pClients )
return nullptr;
bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
const bool bIsTiledRendering = comphelper::LibreOfficeKit::isActive();
for (SfxInPlaceClient* pIPClient : *pClients)
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment