summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 14:20:40 +0100
committerMiklos Vajna <vmiklos@collabora.co.uk>2016-01-14 16:00:08 +0100
commit8cdc1e85f60bdb8340ef7a001222b777b194fab3 (patch)
tree5002999bfb7e7fc590e279918c8153f208fac534 /editeng
parent70c946d1682d019e12cd447fdf4d6a523b899ba4 (diff)
editeng: handle SdrModel::isTiledSearching()
Given that the edit/outliner views can come and go, avoid the lifecycle problems with just passing a pointer to the sdr model to editeng, and then it'll always have the up to date "are we searching" information. editeng can't depend on svx, so provide an interface class SdrModel can implement. (cherry picked from commit 7b5d20983dfbfb458898eeab54828ba5fef5841f) Conflicts: editeng/source/editeng/editview.cxx editeng/source/editeng/impedit.cxx include/editeng/outliner.hxx sd/qa/unit/tiledrendering/tiledrendering.cxx svx/source/svdraw/svdedxv.cxx sw/inc/PostItMgr.hxx sw/source/uibase/docvw/PostItMgr.cxx sw/source/uibase/docvw/SidebarWin.cxx Change-Id: I3b98011593b00ac0fab05b6b9c591dd20d94c579
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editview.cxx4
-rw-r--r--editeng/source/editeng/impedit.cxx17
-rw-r--r--editeng/source/editeng/impedit.hxx4
-rw-r--r--editeng/source/outliner/outlvw.cxx8
4 files changed, 26 insertions, 7 deletions
diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index 66a49ed925de..2a418b5c3cd7 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -592,9 +592,9 @@ bool EditView::isTiledRendering()
return pImpEditView->isTiledRendering();
}
-void EditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData)
+void EditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData, OutlinerSearchable *pSearchable)
{
- pImpEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData);
+ pImpEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData, pSearchable);
}
void EditView::SetControlWord( EVControlBits nWord )
diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx
index 7ee1a2bc0ba2..5ac794a3fb2f 100644
--- a/editeng/source/editeng/impedit.cxx
+++ b/editeng/source/editeng/impedit.cxx
@@ -26,6 +26,7 @@
#include <impedit.hxx>
#include <editeng/editeng.hxx>
#include <editeng/editview.hxx>
+#include <editeng/outliner.hxx>
#include <tools/poly.hxx>
#include <editeng/unolingu.hxx>
#include <com/sun/star/linguistic2/XDictionaryEntry.hpp>
@@ -81,6 +82,7 @@ ImpEditView::ImpEditView( EditView* pView, EditEngine* pEng, vcl::Window* pWindo
mbTiledRendering = false;
mpLibreOfficeKitCallback = 0;
mpLibreOfficeKitData = 0;
+ mpLibreOfficeKitSearchable = 0;
nScrollDiffX = 0;
nExtraCursorFlags = 0;
nCursorBidiLevel = CURSOR_BIDILEVEL_DONTKNOW;
@@ -128,14 +130,27 @@ bool ImpEditView::isTiledRendering() const
return mbTiledRendering;
}
-void ImpEditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData)
+void ImpEditView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData, OutlinerSearchable* pSearchable)
{
mpLibreOfficeKitCallback = pCallback;
mpLibreOfficeKitData = pData;
+ mpLibreOfficeKitSearchable = pSearchable;
}
void ImpEditView::libreOfficeKitCallback(int nType, const char* pPayload) const
{
+ if (mpLibreOfficeKitSearchable && mpLibreOfficeKitSearchable->isTiledSearching())
+ {
+ 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);
}
diff --git a/editeng/source/editeng/impedit.hxx b/editeng/source/editeng/impedit.hxx
index 7b24e6e790b7..a44e3356e44f 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -78,6 +78,7 @@
class EditView;
class EditEngine;
+class OutlinerSearchable;
class SvxSearchItem;
class SvxLRSpaceItem;
@@ -223,6 +224,7 @@ private:
bool mbTiledRendering;
LibreOfficeKitCallback mpLibreOfficeKitCallback;
void* mpLibreOfficeKitData;
+ OutlinerSearchable* mpLibreOfficeKitSearchable;
EditEngine* pEditEngine;
VclPtr<vcl::Window> pOutWin;
Pointer* pPointer;
@@ -375,7 +377,7 @@ public:
void setTiledRendering(bool bTiledRendering);
bool isTiledRendering() const;
/// @see vcl::ITiledRenderable::registerCallback().
- void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
+ void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData, OutlinerSearchable* pSearchable);
/// Invokes the registered callback, if there are any.
void libreOfficeKitCallback(int nType, const char* pPayload) const;
diff --git a/editeng/source/outliner/outlvw.cxx b/editeng/source/outliner/outlvw.cxx
index 329b5f3c0ed4..6b918f410084 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1430,9 +1430,9 @@ void OutlinerView::setTiledRendering(bool bTiledRendering)
pEditView->setTiledRendering(bTiledRendering);
}
-void OutlinerView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData)
+void OutlinerView::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData, OutlinerSearchable* pSearchable)
{
- pEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData);
+ pEditView->registerLibreOfficeKitCallback(pCallback, pLibreOfficeKitData, pSearchable);
}
Color OutlinerView::GetBackgroundColor()
@@ -1460,7 +1460,9 @@ Selection OutlinerView::GetSurroundingTextSelection() const
return pEditView->GetSurroundingTextSelection();
}
-
+OutlinerSearchable::~OutlinerSearchable()
+{
+}
// ===== some code for thesaurus sub menu within context menu