Kaydet (Commit) eb2de5c7 authored tarafından Miklos Vajna's avatar Miklos Vajna

LOK: don't ignore all callback events when we're in the callback already

There are two conflicting requirements here:

- if there was an invalidation event, and PaintTile() is called due to
  that, then we're not interested in invalidation events generated by
  PaintTile() itself.
- we do want other event types all the time like the cursor rectangle

Change SwViewShell::libreOfficeKitCallback(), so that it doesn't ignore
all callbacks when we're in the callback already, just the so far only
problematic type: tile invalidation.

Change-Id: Idcaedbbe0fe2b5b1aa9bafbfe33a81c8011fe148
üst c7ce08fb
......@@ -197,6 +197,7 @@ protected:
LibreOfficeKitCallback mpLibreOfficeKitCallback;
void* mpLibreOfficeKitData;
bool mbInLibreOfficeKitCallback;
public:
TYPEINFO();
......
......@@ -125,6 +125,11 @@ void SwViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallbac
void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const
{
if (mbInLibreOfficeKitCallback && nType == LOK_CALLBACK_INVALIDATE_TILES)
// Make sure no more invalidation events are issued when we're in the
// callback already.
return;
if (mpLibreOfficeKitCallback)
mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData);
}
......@@ -1775,8 +1780,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
OutputDevice *pSaveOut = mpOut;
bool bTiledRendering = mbTiledRendering;
mbTiledRendering = true;
LibreOfficeKitCallback pCallback = mpLibreOfficeKitCallback;
mpLibreOfficeKitCallback = 0;
mbInLibreOfficeKitCallback = true;
mpOut = &rDevice;
// resizes the virtual device so to contain the entrie context
......@@ -1824,7 +1828,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// SwViewShell's output device tear down
mpOut = pSaveOut;
mpLibreOfficeKitCallback = pCallback;
mbInLibreOfficeKitCallback = false;
mbTiledRendering = bTiledRendering;
static bool bDebug = getenv("SW_DEBUG_TILEDRENDERING") != 0;
......
......@@ -171,6 +171,7 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
mbSelectAll(false),
mpLibreOfficeKitCallback(0),
mpLibreOfficeKitData(0),
mbInLibreOfficeKitCallback(false),
mpPrePostOutDev(0), // #i72754#
maPrePostMapMode()
{
......@@ -249,6 +250,7 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
mbSelectAll(false),
mpLibreOfficeKitCallback(0),
mpLibreOfficeKitData(0),
mbInLibreOfficeKitCallback(false),
mpPrePostOutDev(0), // #i72754#
maPrePostMapMode()
{
......
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