summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-08-19 11:10:43 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-08-19 17:03:30 +0200
commit9f883783a6a5f52ab18d96d9fd412776987fffe5 (patch)
treec293f3553aeb2a78025838d95efd75f54918e958
parentfc4340ba565d1aa7e008d78d5c07c1d424928abc (diff)
sw: remove never read SwViewShell::mbInLibreOfficeKitCallback
This was read in the now removed SwViewShell::libreOfficeKitCallback(), so add a similar flag to SfxViewShell instead, and restore the lost condition. This fixes paint/invalidation loops when inserting the first comment to a Writer document in gtktiledviewer. Reviewed-on: https://gerrit.libreoffice.org/28236 Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk> Tested-by: Jenkins <ci@libreoffice.org> (cherry picked from commit 8b4705e0e0c76503b1ca61cb567d222f49466fc5) Conflicts: sfx2/source/view/viewsh.cxx Change-Id: Iad5ef90848f3b309ef8db4553760dd36d9b8a37c
-rw-r--r--include/sfx2/viewsh.hxx4
-rw-r--r--sfx2/source/view/viewimp.hxx2
-rw-r--r--sfx2/source/view/viewsh.cxx14
-rw-r--r--sw/inc/viewsh.hxx2
-rw-r--r--sw/source/core/view/viewsh.cxx4
-rw-r--r--sw/source/core/view/vnew.cxx2
6 files changed, 22 insertions, 6 deletions
diff --git a/include/sfx2/viewsh.hxx b/include/sfx2/viewsh.hxx
index e4b21a22a439..0bda74393033 100644
--- a/include/sfx2/viewsh.hxx
+++ b/include/sfx2/viewsh.hxx
@@ -331,6 +331,10 @@ public:
void setTiledSearching(bool bTiledSearching);
/// Are we doing tiled searching?
bool isTiledSearching() const;
+ /// Set if we are doing tiled painting.
+ void setTiledPainting(bool bTiledPainting);
+ /// Are we doing tiled painting?
+ bool isTiledPainting() const;
/// See lok::Document::getPart().
virtual int getPart() const;
virtual void dumpAsXml(struct _xmlTextWriter* pWriter) const;
diff --git a/sfx2/source/view/viewimp.hxx b/sfx2/source/view/viewimp.hxx
index 81f39e1c4d8c..9c50b7dfbb13 100644
--- a/sfx2/source/view/viewimp.hxx
+++ b/sfx2/source/view/viewimp.hxx
@@ -66,6 +66,8 @@ struct SfxViewShell_Impl
void* m_pLibreOfficeKitViewData;
/// Set if we are in the middle of a tiled search.
bool m_bTiledSearching;
+ /// Set if we are in the middle of a tiled paint.
+ bool m_bTiledPainting;
static sal_uInt32 m_nLastViewShellId;
const sal_uInt32 m_nViewShellId;
diff --git a/sfx2/source/view/viewsh.cxx b/sfx2/source/view/viewsh.cxx
index e7110998fef3..694ea7d6dc58 100644
--- a/sfx2/source/view/viewsh.cxx
+++ b/sfx2/source/view/viewsh.cxx
@@ -316,6 +316,7 @@ SfxViewShell_Impl::SfxViewShell_Impl(SfxViewShellFlags const nFlags)
, m_pLibreOfficeKitViewCallback(nullptr)
, m_pLibreOfficeKitViewData(nullptr)
, m_bTiledSearching(false)
+, m_bTiledPainting(false)
, m_nViewShellId(SfxViewShell_Impl::m_nLastViewShellId++)
{}
@@ -1620,6 +1621,9 @@ void SfxViewShell::registerLibreOfficeKitViewCallback(LibreOfficeKitCallback pCa
void SfxViewShell::libreOfficeKitViewCallback(int nType, const char* pPayload) const
{
+ if (pImp->m_bTiledPainting)
+ return;
+
if (pImp->m_bTiledSearching)
{
switch (nType)
@@ -1648,6 +1652,16 @@ bool SfxViewShell::isTiledSearching() const
return pImp->m_bTiledSearching;
}
+void SfxViewShell::setTiledPainting(bool bTiledPainting)
+{
+ pImp->m_bTiledPainting = bTiledPainting;
+}
+
+bool SfxViewShell::isTiledPainting() const
+{
+ return pImp->m_bTiledPainting;
+}
+
int SfxViewShell::getPart() const
{
return 0;
diff --git a/sw/inc/viewsh.hxx b/sw/inc/viewsh.hxx
index 1f54481658db..bb3bc8f2fd25 100644
--- a/sw/inc/viewsh.hxx
+++ b/sw/inc/viewsh.hxx
@@ -190,8 +190,6 @@ protected:
sal_uInt16 mnLockPaint; ///< != 0 if Paint is locked.
bool mbSelectAll; ///< Special select all mode: whole document selected, even if doc starts with table.
- bool mbInLibreOfficeKitCallback;
-
/// The virtual device we paint to will end up on the screen.
bool mbOutputToWindow;
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 1affa5d44f5d..2a518cd3e38a 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -1843,7 +1843,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// TODO clean up SwViewShell's approach to output devices (the many of
// them - mpBufferedOut, mpOut, mpWin, ...)
OutputDevice *pSaveOut = mpOut;
- mbInLibreOfficeKitCallback = true;
+ GetSfxViewShell()->setTiledPainting(true);
mpOut = &rDevice;
// resizes the virtual device so to contain the entries context
@@ -1896,7 +1896,7 @@ void SwViewShell::PaintTile(VirtualDevice &rDevice, int contextWidth, int contex
// SwViewShell's output device tear down
mpOut = pSaveOut;
- mbInLibreOfficeKitCallback = false;
+ GetSfxViewShell()->setTiledPainting(false);
}
void SwViewShell::SetBrowseBorder( const Size& rNew )
diff --git a/sw/source/core/view/vnew.cxx b/sw/source/core/view/vnew.cxx
index 9bd1868f33f0..95f104e93336 100644
--- a/sw/source/core/view/vnew.cxx
+++ b/sw/source/core/view/vnew.cxx
@@ -171,7 +171,6 @@ SwViewShell::SwViewShell( SwDoc& rDocument, vcl::Window *pWindow,
mnStartAction( 0 ),
mnLockPaint( 0 ),
mbSelectAll(false),
- mbInLibreOfficeKitCallback(false),
mbOutputToWindow(false),
mpPrePostOutDev(nullptr), // #i72754#
maPrePostMapMode()
@@ -251,7 +250,6 @@ SwViewShell::SwViewShell( SwViewShell& rShell, vcl::Window *pWindow,
mnStartAction( 0 ),
mnLockPaint( 0 ),
mbSelectAll(false),
- mbInLibreOfficeKitCallback(false),
mbOutputToWindow(false),
mpPrePostOutDev(nullptr), // #i72754#
maPrePostMapMode()