summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 11:22:13 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 15:06:42 +0100
commit70c946d1682d019e12cd447fdf4d6a523b899ba4 (patch)
tree2dbe0dcf13518b311e35c7fb355f1f5a952e94db
parent83c540d275e351b1979f7b59be8aad728bca6dc0 (diff)
sd tiled rendering: it's pointless to send selection changes during search all
But they do cause annoying flashing. (cherry picked from commit b9565ef0a73c235cd1e14fce9031db6e9237c524) Conflicts: include/svx/svdmodel.hxx svx/source/svdraw/svdmodel.cxx Change-Id: Ic313a15429c5db98c5660a5274aa49e95dd217e5
-rw-r--r--include/svx/svdmodel.hxx6
-rw-r--r--sd/source/ui/view/Outliner.cxx2
-rw-r--r--svx/source/svdraw/svdmodel.cxx24
3 files changed, 32 insertions, 0 deletions
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 4d56a4413801..99bdf72c03ba 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -179,6 +179,8 @@ protected:
bool mbTiledRendering;
LibreOfficeKitCallback mpLibreOfficeKitCallback;
void* mpLibreOfficeKitData;
+ /// Set if we are in the middle of a tiled search.
+ bool mbTiledSearching;
sal_uIntPtr nProgressAkt; // for the
sal_uIntPtr nProgressMax; // ProgressBar-
sal_uIntPtr nProgressOfs; // -Handler
@@ -352,6 +354,10 @@ public:
void* getLibreOfficeKitData() const;
/// Invokes the registered callback, if there are any.
void libreOfficeKitCallback(int nType, const char* pPayload) const;
+ /// Set if we are doing tiled searching.
+ void setTiledSearching(bool bTiledSearching);
+ /// Are we doing tiled searching?
+ bool isTiledSearching() const;
// If a new MapMode is set on the RefDevice (or similar)
void RefDeviceChanged(); // not yet implemented
// default font heigth in logical units
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index c16ba31e6ccd..76b1272fd0d0 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -631,6 +631,7 @@ bool Outliner::SearchAndReplaceAll()
}
else if (pViewShell->ISA(DrawViewShell))
{
+ pViewShell->GetDoc()->setTiledSearching(true);
// Go to beginning/end of document.
maObjectIterator = ::sd::outliner::OutlinerContainer(this).begin();
// Switch to the first object which contains the search string.
@@ -680,6 +681,7 @@ bool Outliner::SearchAndReplaceAll()
OString aPayload = aStream.str().c_str();
pViewShell->GetDoc()->libreOfficeKitCallback(LOK_CALLBACK_SEARCH_RESULT_SELECTION, aPayload.getStr());
}
+ pViewShell->GetDoc()->setTiledSearching(false);
}
RestoreStartPosition ();
diff --git a/svx/source/svdraw/svdmodel.cxx b/svx/source/svdraw/svdmodel.cxx
index 47c3c21d7aa2..b26f1561c7d1 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -88,6 +88,7 @@
#include <vcl/svapp.hxx>
#include <boost/scoped_array.hpp>
#include <libxml/xmlwriter.h>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -127,6 +128,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
mbTiledRendering = false;
mpLibreOfficeKitCallback = 0;
mpLibreOfficeKitData = 0;
+ mbTiledSearching = false;
nProgressAkt=0;
nProgressMax=0;
nProgressOfs=0;
@@ -816,10 +818,32 @@ void SdrModel::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback,
void SdrModel::libreOfficeKitCallback(int nType, const char* pPayload) const
{
+ if (mbTiledSearching)
+ {
+ switch (nType)
+ {
+ case LOK_CALLBACK_TEXT_SELECTION:
+ case LOK_CALLBACK_TEXT_SELECTION_START:
+ case LOK_CALLBACK_TEXT_SELECTION_END:
+ case LOK_CALLBACK_GRAPHIC_SELECTION:
+ return;
+ }
+ }
+
if (mpLibreOfficeKitCallback)
mpLibreOfficeKitCallback(nType, pPayload, mpLibreOfficeKitData);
}
+void SdrModel::setTiledSearching(bool bTiledSearching)
+{
+ mbTiledSearching = bTiledSearching;
+}
+
+bool SdrModel::isTiledSearching() const
+{
+ return mbTiledSearching;
+}
+
LibreOfficeKitCallback SdrModel::getLibreOfficeKitCallback() const
{
return mpLibreOfficeKitCallback;