[Libreoffice-commits] core.git: 2 commits - editeng/source include/editeng include/svx sc/source sd/qa sd/source svx/source sw/inc sw/source

Miklos Vajna vmiklos at collabora.co.uk
Thu Jan 14 05:45:56 PST 2016


 editeng/source/editeng/editview.cxx          |    4 ++--
 editeng/source/editeng/impedit.cxx           |   17 ++++++++++++++++-
 editeng/source/editeng/impedit.hxx           |    4 +++-
 editeng/source/outliner/outlvw.cxx           |    8 +++++---
 include/editeng/editview.hxx                 |    3 ++-
 include/editeng/outliner.hxx                 |   12 ++++++++++--
 include/svx/svdmodel.hxx                     |    9 ++++++++-
 sc/source/ui/app/inputhdl.cxx                |    2 +-
 sc/source/ui/view/viewdata.cxx               |    3 ++-
 sd/qa/unit/tiledrendering/tiledrendering.cxx |   26 +++++++++++++++++++++++++-
 sd/source/ui/view/Outliner.cxx               |    2 ++
 svx/source/svdraw/svdedxv.cxx                |    2 +-
 svx/source/svdraw/svdmodel.cxx               |   24 ++++++++++++++++++++++++
 sw/inc/PostItMgr.hxx                         |    3 ++-
 sw/source/core/view/viewsh.cxx               |    2 +-
 sw/source/uibase/docvw/PostItMgr.cxx         |    4 ++--
 sw/source/uibase/docvw/SidebarWin.cxx        |    2 +-
 17 files changed, 107 insertions(+), 20 deletions(-)

New commits:
commit 7b5d20983dfbfb458898eeab54828ba5fef5841f
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 14 14:20:40 2016 +0100

    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.
    
    Change-Id: I3b98011593b00ac0fab05b6b9c591dd20d94c579

diff --git a/editeng/source/editeng/editview.cxx b/editeng/source/editeng/editview.cxx
index d9d3148..f936d4e 100644
--- a/editeng/source/editeng/editview.cxx
+++ b/editeng/source/editeng/editview.cxx
@@ -588,9 +588,9 @@ void EditView::setTiledRendering(bool bTiledRendering)
     pImpEditView->setTiledRendering(bTiledRendering);
 }
 
-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 f14d57c..0fc72ff 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 = nullptr;
     mpLibreOfficeKitData = nullptr;
+    mpLibreOfficeKitSearchable = nullptr;
     nScrollDiffX        = 0;
     nExtraCursorFlags   = 0;
     nCursorBidiLevel    = CURSOR_BIDILEVEL_DONTKNOW;
@@ -123,14 +125,27 @@ void ImpEditView::setTiledRendering(bool bTiledRendering)
     mbTiledRendering = bTiledRendering;
 }
 
-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 84163cc..5f180cd 100644
--- a/editeng/source/editeng/impedit.hxx
+++ b/editeng/source/editeng/impedit.hxx
@@ -79,6 +79,7 @@
 
 class EditView;
 class EditEngine;
+class OutlinerSearchable;
 
 class SvxSearchItem;
 class SvxLRSpaceItem;
@@ -224,6 +225,7 @@ private:
     bool                mbTiledRendering;
     LibreOfficeKitCallback mpLibreOfficeKitCallback;
     void* mpLibreOfficeKitData;
+    OutlinerSearchable* mpLibreOfficeKitSearchable;
     EditEngine*         pEditEngine;
     VclPtr<vcl::Window> pOutWin;
     Pointer*            pPointer;
@@ -370,7 +372,7 @@ public:
 
     void            setTiledRendering(bool bTiledRendering);
     /// @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 9de935e..d624eb6 100644
--- a/editeng/source/outliner/outlvw.cxx
+++ b/editeng/source/outliner/outlvw.cxx
@@ -1436,9 +1436,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()
@@ -1466,7 +1466,9 @@ Selection OutlinerView::GetSurroundingTextSelection() const
     return pEditView->GetSurroundingTextSelection();
 }
 
-
+OutlinerSearchable::~OutlinerSearchable()
+{
+}
 
 // ===== some code for thesaurus sub menu within context menu
 
diff --git a/include/editeng/editview.hxx b/include/editeng/editview.hxx
index 33adc6e..21343f5 100644
--- a/include/editeng/editview.hxx
+++ b/include/editeng/editview.hxx
@@ -35,6 +35,7 @@
 class EditEngine;
 class ImpEditEngine;
 class ImpEditView;
+class OutlinerSearchable;
 class SvxSearchItem;
 class SvxFieldItem;
 namespace vcl { class Window; }
@@ -183,7 +184,7 @@ public:
 
     void            setTiledRendering(bool bTiledRendering);
     /// @see vcl::ITiledRenderable::registerCallback().
-    void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
+    void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData, OutlinerSearchable *pSearchable);
 
     void            SetControlWord( EVControlBits nWord );
     EVControlBits   GetControlWord() const;
diff --git a/include/editeng/outliner.hxx b/include/editeng/outliner.hxx
index b2c018e..6ea221e 100644
--- a/include/editeng/outliner.hxx
+++ b/include/editeng/outliner.hxx
@@ -72,7 +72,7 @@ class SvKeyValueIterator;
 class SvxForbiddenCharactersTable;
 class OverflowingText;
 class NonOverflowingText;
-
+class OutlinerSearchable;
 
 namespace svl
 {
@@ -276,7 +276,7 @@ public:
     /// Set if we are doing tiled rendering.
     void        setTiledRendering(bool bTiledRendering);
     /// @see vcl::ITiledRenderable::registerCallback().
-    void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData);
+    void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pLibreOfficeKitData, OutlinerSearchable* pSearchable);
 
     SfxItemSet  GetAttribs();
 
@@ -378,6 +378,14 @@ public:
     void        SetEndCutPasteLinkHdl(const Link<LinkParamNone*,void> &rLink) { aEndCutPasteLink = rLink; }
 };
 
+/// Interface class to know if we do tiled searching.
+class EDITENG_DLLPUBLIC OutlinerSearchable
+{
+public:
+    virtual ~OutlinerSearchable();
+
+    virtual bool isTiledSearching() const = 0;
+};
 
 // some thesaurus functionality to avoid code duplication in different projects...
 bool EDITENG_DLLPUBLIC  GetStatusValueForThesaurusFromContext( OUString &rStatusVal, LanguageType &rLang, const EditView &rEditView );
diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 49eab63..fc60a89 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -23,6 +23,7 @@
 #include <com/sun/star/uno/Sequence.hxx>
 #include <cppuhelper/weakref.hxx>
 #include <editeng/forbiddencharacterstable.hxx>
+#include <editeng/outliner.hxx>
 #include <rtl/ustring.hxx>
 #include <tools/link.hxx>
 #include <tools/weakbase.hxx>
@@ -148,7 +149,7 @@ public:
 
 struct SdrModelImpl;
 
-class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >
+class SVX_DLLPUBLIC SdrModel : public SfxBroadcaster, public tools::WeakBase< SdrModel >, public OutlinerSearchable
 {
 protected:
     std::vector<SdrPage*> maMaPag;     // master pages
diff --git a/sc/source/ui/app/inputhdl.cxx b/sc/source/ui/app/inputhdl.cxx
index 65fd839..a4cf3ef 100644
--- a/sc/source/ui/app/inputhdl.cxx
+++ b/sc/source/ui/app/inputhdl.cxx
@@ -1722,7 +1722,7 @@ void ScInputHandler::UpdateActiveView()
         if (comphelper::LibreOfficeKit::isActive())
         {
             ScDrawLayer *pDrawLayer = pDocShell->GetDocument().GetDrawLayer();
-            pTableView->registerLibreOfficeKitCallback(pDrawLayer->getLibreOfficeKitCallback(), pDrawLayer->getLibreOfficeKitData());
+            pTableView->registerLibreOfficeKitCallback(pDrawLayer->getLibreOfficeKitCallback(), pDrawLayer->getLibreOfficeKitData(), pDrawLayer);
             pTableView->setTiledRendering(true);
         }
     }
diff --git a/sc/source/ui/view/viewdata.cxx b/sc/source/ui/view/viewdata.cxx
index fdf86d4..95b9573 100644
--- a/sc/source/ui/view/viewdata.cxx
+++ b/sc/source/ui/view/viewdata.cxx
@@ -941,7 +941,8 @@ void ScViewData::SetEditEngine( ScSplitPos eWhich,
         if (pDoc->GetDrawLayer() && comphelper::LibreOfficeKit::isActive())
         {
             pEditView[eWhich]->registerLibreOfficeKitCallback(pDoc->GetDrawLayer()->getLibreOfficeKitCallback(),
-                                                              pDoc->GetDrawLayer()->getLibreOfficeKitData());
+                                                              pDoc->GetDrawLayer()->getLibreOfficeKitData(),
+                                                              pDoc->GetDrawLayer());
             pEditView[eWhich]->setTiledRendering(true);
         }
     }
diff --git a/sd/qa/unit/tiledrendering/tiledrendering.cxx b/sd/qa/unit/tiledrendering/tiledrendering.cxx
index 13b4223..296964d 100644
--- a/sd/qa/unit/tiledrendering/tiledrendering.cxx
+++ b/sd/qa/unit/tiledrendering/tiledrendering.cxx
@@ -54,6 +54,7 @@ public:
     void testSearch();
     void testSearchAll();
     void testSearchAllSelections();
+    void testSearchAllNotifications();
 #endif
 
     CPPUNIT_TEST_SUITE(SdTiledRenderingTest);
@@ -68,6 +69,7 @@ public:
     CPPUNIT_TEST(testSearch);
     CPPUNIT_TEST(testSearchAll);
     CPPUNIT_TEST(testSearchAllSelections);
+    CPPUNIT_TEST(testSearchAllNotifications);
 #endif
     CPPUNIT_TEST_SUITE_END();
 
@@ -86,13 +88,17 @@ private:
     sal_Int32 m_nPart;
     std::vector<OString> m_aSearchResultSelection;
     std::vector<int> m_aSearchResultPart;
+    int m_nSelectionBeforeSearchResult;
+    int m_nSelectionAfterSearchResult;
 #endif
 };
 
 SdTiledRenderingTest::SdTiledRenderingTest()
 #if !defined(WNT) && !defined(MACOSX)
     : m_bFound(true),
-      m_nPart(0)
+      m_nPart(0),
+      m_nSelectionBeforeSearchResult(0),
+      m_nSelectionAfterSearchResult(0)
 #endif
 {
 }
@@ -177,6 +183,10 @@ void SdTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
             lcl_convertRectangle(rString, aRectangle);
             m_aSelection.push_back(aRectangle);
         }
+        if (m_aSearchResultSelection.empty())
+            ++m_nSelectionBeforeSearchResult;
+        else
+            ++m_nSelectionAfterSearchResult;
     }
     break;
     case LOK_CALLBACK_SEARCH_NOT_FOUND:
@@ -458,6 +468,20 @@ void SdTiledRenderingTest::testSearchAllSelections()
     comphelper::LibreOfficeKit::setActive(false);
 }
 
+void SdTiledRenderingTest::testSearchAllNotifications()
+{
+    comphelper::LibreOfficeKit::setActive();
+    SdXImpressDocument* pXImpressDocument = createDoc("search-all.odp");
+    pXImpressDocument->registerCallback(&SdTiledRenderingTest::callback, this);
+
+    lcl_search("third", /*bFindAll=*/true);
+    // Make sure that we get no notifications about selection changes during search.
+    CPPUNIT_ASSERT_EQUAL(0, m_nSelectionBeforeSearchResult);
+    // But we do get the selection of the first hit.
+    CPPUNIT_ASSERT(m_nSelectionAfterSearchResult > 0);
+    comphelper::LibreOfficeKit::setActive(false);
+}
+
 #endif
 
 CPPUNIT_TEST_SUITE_REGISTRATION(SdTiledRenderingTest);
diff --git a/svx/source/svdraw/svdedxv.cxx b/svx/source/svdraw/svdedxv.cxx
index 9c9b244..5c2dc63 100644
--- a/svx/source/svdraw/svdedxv.cxx
+++ b/svx/source/svdraw/svdedxv.cxx
@@ -462,7 +462,7 @@ OutlinerView* SdrObjEditView::ImpMakeOutlinerView(vcl::Window* pWin, bool /*bNoP
     pOutlView->SetControlWord(nStat);
     pOutlView->SetBackgroundColor( aBackground );
     pOutlView->setTiledRendering(GetModel()->isTiledRendering());
-    pOutlView->registerLibreOfficeKitCallback(GetModel()->getLibreOfficeKitCallback(), GetModel()->getLibreOfficeKitData());
+    pOutlView->registerLibreOfficeKitCallback(GetModel()->getLibreOfficeKitCallback(), GetModel()->getLibreOfficeKitData(), GetModel());
     if (pText!=nullptr)
     {
         pOutlView->SetAnchorMode((EVAnchorMode)(pText->GetOutlinerViewAnchorMode()));
diff --git a/sw/inc/PostItMgr.hxx b/sw/inc/PostItMgr.hxx
index 11276b9..b4f96a6 100644
--- a/sw/inc/PostItMgr.hxx
+++ b/sw/inc/PostItMgr.hxx
@@ -62,6 +62,7 @@ class SwSidebarItem;
 class SwFrame;
 namespace vcl { class Window; }
 struct ImplSVEvent;
+class OutlinerSearchable;
 
 #define COL_NOTES_SIDEPANE_ARROW_ENABLED    RGB_COLORDATA(0,0,0)
 #define COL_NOTES_SIDEPANE_ARROW_DISABLED   RGB_COLORDATA(172,168,153)
@@ -290,7 +291,7 @@ class SwPostItMgr: public SfxListener
         void DrawNotesForPage(OutputDevice *pOutDev, sal_uInt32 nPage);
         void PaintTile(OutputDevice& rRenderContext, const Rectangle& rRect);
         /// Informs already created annotations about a newly registered LOK callback.
-        void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData);
+        void registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData, OutlinerSearchable* pSearchable);
 };
 
 #endif
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 50087dc..a543016 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -119,7 +119,7 @@ void SwViewShell::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallbac
 {
     getIDocumentDrawModelAccess().GetDrawModel()->registerLibreOfficeKitCallback(pCallback, pData);
     if (SwPostItMgr* pPostItMgr = GetPostItMgr())
-        pPostItMgr->registerLibreOfficeKitCallback(pCallback, pData);
+        pPostItMgr->registerLibreOfficeKitCallback(pCallback, pData, getIDocumentDrawModelAccess().GetDrawModel());
 }
 
 void SwViewShell::libreOfficeKitCallback(int nType, const char* pPayload) const
diff --git a/sw/source/uibase/docvw/PostItMgr.cxx b/sw/source/uibase/docvw/PostItMgr.cxx
index c4d0f6a..86be220 100644
--- a/sw/source/uibase/docvw/PostItMgr.cxx
+++ b/sw/source/uibase/docvw/PostItMgr.cxx
@@ -881,7 +881,7 @@ void SwPostItMgr::PaintTile(OutputDevice& rRenderContext, const Rectangle& /*rRe
     }
 }
 
-void SwPostItMgr::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData)
+void SwPostItMgr::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallback, void* pData, OutlinerSearchable* pSearchable)
 {
     for (SwSidebarItem* pItem : mvPostItFields)
     {
@@ -890,7 +890,7 @@ void SwPostItMgr::registerLibreOfficeKitCallback(LibreOfficeKitCallback pCallbac
             continue;
 
         pPostIt->GetOutlinerView()->setTiledRendering(comphelper::LibreOfficeKit::isActive());
-        pPostIt->GetOutlinerView()->registerLibreOfficeKitCallback(pCallback, pData);
+        pPostIt->GetOutlinerView()->registerLibreOfficeKitCallback(pCallback, pData, pSearchable);
     }
 }
 
diff --git a/sw/source/uibase/docvw/SidebarWin.cxx b/sw/source/uibase/docvw/SidebarWin.cxx
index 6f73a63..57374ac 100644
--- a/sw/source/uibase/docvw/SidebarWin.cxx
+++ b/sw/source/uibase/docvw/SidebarWin.cxx
@@ -619,7 +619,7 @@ void SwSidebarWin::InitControls()
         void* pData = nullptr;
         pDrawModel->getLibreOfficeKitCallback(pCallback, pData);
         mpOutlinerView->setTiledRendering(comphelper::LibreOfficeKit::isActive());
-        mpOutlinerView->registerLibreOfficeKitCallback(pCallback, pData);
+        mpOutlinerView->registerLibreOfficeKitCallback(pCallback, pData, pDrawModel);
     }
 
     //create Scrollbars
commit b9565ef0a73c235cd1e14fce9031db6e9237c524
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Thu Jan 14 11:22:13 2016 +0100

    sd tiled rendering: it's pointless to send selection changes during search all
    
    But they do cause annoying flashing.
    
    Change-Id: Ic313a15429c5db98c5660a5274aa49e95dd217e5

diff --git a/include/svx/svdmodel.hxx b/include/svx/svdmodel.hxx
index 86956c3..49eab63 100644
--- a/include/svx/svdmodel.hxx
+++ b/include/svx/svdmodel.hxx
@@ -177,6 +177,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
@@ -346,6 +348,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 height in logical units
diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx
index 1eb659a..afe5b87 100644
--- a/sd/source/ui/view/Outliner.cxx
+++ b/sd/source/ui/view/Outliner.cxx
@@ -617,6 +617,7 @@ bool Outliner::SearchAndReplaceAll()
     }
     else if( nullptr != dynamic_cast< const DrawViewShell *>( pViewShell.get() ))
     {
+        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.
@@ -666,6 +667,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 85a5c54..737a179 100644
--- a/svx/source/svdraw/svdmodel.cxx
+++ b/svx/source/svdraw/svdmodel.cxx
@@ -90,6 +90,7 @@
 #include <vcl/svapp.hxx>
 #include <memory>
 #include <libxml/xmlwriter.h>
+#include <LibreOfficeKit/LibreOfficeKitEnums.h>
 
 using namespace ::com::sun::star;
 using namespace ::com::sun::star::uno;
@@ -128,6 +129,7 @@ void SdrModel::ImpCtor(SfxItemPool* pPool, ::comphelper::IEmbeddedHelper* _pEmbe
     mbTiledRendering = false;
     mpLibreOfficeKitCallback = nullptr;
     mpLibreOfficeKitData = nullptr;
+    mbTiledSearching = false;
     nProgressAkt=0;
     nProgressMax=0;
     nProgressOfs=0;
@@ -828,10 +830,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;


More information about the Libreoffice-commits mailing list