Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
07054b05
Kaydet (Commit)
07054b05
authored
Ock 15, 2016
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw tiled rendering: it's pointless to send selection changes during search all
Change-Id: Iad3436c74d0ff95c84b5da870124b1e335241ca2
üst
21af07a8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
2 deletions
+44
-2
tiledrendering.cxx
sw/qa/extras/tiledrendering/tiledrendering.cxx
+33
-1
viscrs.cxx
sw/source/core/crsr/viscrs.cxx
+2
-1
viewsrch.cxx
sw/source/uibase/uiview/viewsrch.cxx
+9
-0
No files found.
sw/qa/extras/tiledrendering/tiledrendering.cxx
Dosyayı görüntüle @
07054b05
...
...
@@ -47,6 +47,7 @@ public:
void
testSearchTextFrameWrapAround
();
void
testDocumentSizeChanged
();
void
testSearchAll
();
void
testSearchAllNotifications
();
CPPUNIT_TEST_SUITE
(
SwTiledRenderingTest
);
CPPUNIT_TEST
(
testRegisterCallback
);
...
...
@@ -62,6 +63,7 @@ public:
CPPUNIT_TEST
(
testSearchTextFrameWrapAround
);
CPPUNIT_TEST
(
testDocumentSizeChanged
);
CPPUNIT_TEST
(
testSearchAll
);
CPPUNIT_TEST
(
testSearchAllNotifications
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -74,10 +76,14 @@ private:
bool
m_bFound
;
std
::
vector
<
OString
>
m_aSearchResultSelection
;
std
::
vector
<
int
>
m_aSearchResultPart
;
int
m_nSelectionBeforeSearchResult
;
int
m_nSelectionAfterSearchResult
;
};
SwTiledRenderingTest
::
SwTiledRenderingTest
()
:
m_bFound
(
true
)
:
m_bFound
(
true
),
m_nSelectionBeforeSearchResult
(
0
),
m_nSelectionAfterSearchResult
(
0
)
{
}
...
...
@@ -126,6 +132,10 @@ void SwTiledRenderingTest::callbackImpl(int nType, const char* pPayload)
case
LOK_CALLBACK_TEXT_SELECTION
:
{
m_aTextSelection
=
pPayload
;
if
(
m_aSearchResultSelection
.
empty
())
++
m_nSelectionBeforeSearchResult
;
else
++
m_nSelectionAfterSearchResult
;
}
break
;
case
LOK_CALLBACK_SEARCH_NOT_FOUND
:
...
...
@@ -461,6 +471,28 @@ void SwTiledRenderingTest::testSearchAll()
comphelper
::
LibreOfficeKit
::
setActive
(
false
);
}
void
SwTiledRenderingTest
::
testSearchAllNotifications
()
{
comphelper
::
LibreOfficeKit
::
setActive
();
SwXTextDocument
*
pXTextDocument
=
createDoc
(
"search.odt"
);
pXTextDocument
->
registerCallback
(
&
SwTiledRenderingTest
::
callback
,
this
);
uno
::
Sequence
<
beans
::
PropertyValue
>
aPropertyValues
(
comphelper
::
InitPropertySequence
(
{
{
"SearchItem.SearchString"
,
uno
::
makeAny
(
OUString
(
"shape"
))},
{
"SearchItem.Backward"
,
uno
::
makeAny
(
false
)},
{
"SearchItem.Command"
,
uno
::
makeAny
(
static_cast
<
sal_uInt16
>
(
SvxSearchCmd
::
FIND_ALL
))},
}));
comphelper
::
dispatchCommand
(
".uno:ExecuteSearch"
,
aPropertyValues
);
Scheduler
::
ProcessEventsToIdle
();
// This was 5, make sure that we get no notifications about selection changes during search.
CPPUNIT_ASSERT_EQUAL
(
0
,
m_nSelectionBeforeSearchResult
);
// But we do get the selection afterwards.
CPPUNIT_ASSERT
(
m_nSelectionAfterSearchResult
>
0
);
comphelper
::
LibreOfficeKit
::
setActive
(
false
);
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
SwTiledRenderingTest
);
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
sw/source/core/crsr/viscrs.cxx
Dosyayı görüntüle @
07054b05
...
...
@@ -364,7 +364,8 @@ void SwSelPaintRects::Show(std::vector<OString>* pSelectionRectangles)
// being edited.
if
(
comphelper
::
LibreOfficeKit
::
isActive
()
&&
!
pView
->
GetTextEditObject
())
{
if
(
!
empty
())
// If pSelectionRectangles is set, we're just collecting the text selections -> don't emit start/end.
if
(
!
empty
()
&&
!
pSelectionRectangles
)
{
// The selection may be a complex polygon, emit the logical
// start/end cursor rectangle of the selection as separate
...
...
sw/source/uibase/uiview/viewsrch.cxx
Dosyayı görüntüle @
07054b05
...
...
@@ -65,6 +65,8 @@
#include <view.hrc>
#include <SwRewriter.hxx>
#include <comcore.hrc>
#include <IDocumentDrawModelAccess.hxx>
#include <drawdoc.hxx>
#include "PostItMgr.hxx"
...
...
@@ -267,7 +269,14 @@ void SwView::ExecSearch(SfxRequest& rReq, bool bNoMessage)
break
;
case
SvxSearchCmd
:
:
FIND_ALL
:
{
// Disable LOK selection notifications during search.
SwDrawModel
*
pModel
=
m_pWrtShell
->
getIDocumentDrawModelAccess
().
GetDrawModel
();
if
(
pModel
)
pModel
->
setTiledSearching
(
true
);
bool
bRet
=
SearchAll
();
if
(
pModel
)
pModel
->
setTiledSearching
(
false
);
if
(
!
bRet
)
{
#if HAVE_FEATURE_DESKTOP
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment