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
32d573cd
Kaydet (Commit)
32d573cd
authored
Eki 14, 2015
tarafından
Miklos Vajna
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sd tiled rendering: initial search all
Change-Id: Icee3a07103fad1bf70637fbf23299f50b7ad838d
üst
95f5ca35
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
54 additions
and
22 deletions
+54
-22
Outliner.hxx
sd/inc/Outliner.hxx
+4
-1
Outliner.cxx
sd/source/ui/view/Outliner.cxx
+50
-21
No files found.
sd/inc/Outliner.hxx
Dosyayı görüntüle @
32d573cd
...
...
@@ -350,11 +350,14 @@ private:
bool
SearchAndReplaceAll
();
/** Do search and replace for next match.
@param pSelections
When tiled rendering and not 0, then don't emit LOK events, instead
assume the caller will do so.
@return
The return value specifies whether the search ended (</sal_True>) or
another call to this method is required (</sal_False>).
*/
bool
SearchAndReplaceOnce
();
bool
SearchAndReplaceOnce
(
std
::
vector
<
OString
>*
pSelections
=
0
);
/** Detect changes of the document or view and react accordingly. Such
changes may occur because different calls to
...
...
sd/source/ui/view/Outliner.cxx
Dosyayı görüntüle @
32d573cd
...
...
@@ -484,7 +484,7 @@ bool Outliner::StartSearchAndReplace (const SvxSearchItem* pSearchItem)
Initialize
(
!
mpSearchItem
->
GetBackward
());
const
SvxSearchCmd
nCommand
(
mpSearchItem
->
GetCommand
());
if
(
nCommand
==
SvxSearchCmd
::
REPLACE_ALL
)
if
(
nCommand
==
SvxSearchCmd
::
FIND_ALL
||
nCommand
==
SvxSearchCmd
::
REPLACE_ALL
)
bEndOfSearch
=
SearchAndReplaceAll
();
else
{
...
...
@@ -615,11 +615,32 @@ bool Outliner::SearchAndReplaceAll()
// Search/replace until the end of the document is reached.
bool
bFoundMatch
;
std
::
vector
<
OString
>
aSelections
;
do
{
bFoundMatch
=
!
SearchAndReplaceOnce
();
bFoundMatch
=
!
SearchAndReplaceOnce
(
&
aSelections
);
}
while
(
bFoundMatch
);
if
(
mpSearchItem
->
GetCommand
()
==
SvxSearchCmd
::
FIND_ALL
&&
pViewShell
->
GetDoc
()
->
isTiledRendering
()
&&
!
aSelections
.
empty
())
{
boost
::
property_tree
::
ptree
aTree
;
aTree
.
put
(
"searchString"
,
mpSearchItem
->
GetSearchString
().
toUtf8
().
getStr
());
boost
::
property_tree
::
ptree
aChildren
;
for
(
const
OString
&
rSelection
:
aSelections
)
{
boost
::
property_tree
::
ptree
aChild
;
aChild
.
put
(
""
,
rSelection
.
getStr
());
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
}
aTree
.
add_child
(
"searchResultSelection"
,
aChildren
);
std
::
stringstream
aStream
;
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
OString
aPayload
=
aStream
.
str
().
c_str
();
pViewShell
->
GetDoc
()
->
libreOfficeKitCallback
(
LOK_CALLBACK_SEARCH_RESULT_SELECTION
,
aPayload
.
getStr
());
}
}
RestoreStartPosition
();
...
...
@@ -628,7 +649,7 @@ bool Outliner::SearchAndReplaceAll()
return
true
;
}
bool
Outliner
::
SearchAndReplaceOnce
()
bool
Outliner
::
SearchAndReplaceOnce
(
std
::
vector
<
OString
>*
pSelections
)
{
DetectChange
();
...
...
@@ -718,30 +739,38 @@ bool Outliner::SearchAndReplaceOnce()
if
(
pViewShell
&&
pViewShell
->
GetDoc
()
->
isTiledRendering
()
&&
mbStringFound
)
{
// notify LibreOfficeKit about changed page
OString
aPayload
=
OString
::
number
(
maCurrentPosition
.
mnPageIndex
);
pViewShell
->
GetDoc
()
->
libreOfficeKitCallback
(
LOK_CALLBACK_SET_PART
,
aPayload
.
getStr
());
// also about search result selections
std
::
vector
<
Rectangle
>
aLogicRects
;
pOutlinerView
->
GetSelectionRectangles
(
aLogicRects
);
boost
::
property_tree
::
ptree
aTree
;
aTree
.
put
(
"searchString"
,
mpSearchItem
->
GetSearchString
().
toUtf8
().
getStr
());
std
::
vector
<
OString
>
aLogicRectStrings
;
std
::
transform
(
aLogicRects
.
begin
(),
aLogicRects
.
end
(),
std
::
back_inserter
(
aLogicRectStrings
),
[](
const
Rectangle
&
rRectangle
)
{
return
rRectangle
.
toString
();
});
OString
sRectangles
=
comphelper
::
string
::
join
(
"; "
,
aLogicRectStrings
);
boost
::
property_tree
::
ptree
aChildren
;
boost
::
property_tree
::
ptree
aChild
;
aChild
.
put
(
""
,
sRectangles
.
getStr
());
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
aTree
.
add_child
(
"searchResultSelection"
,
aChildren
);
std
::
stringstream
aStream
;
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
aPayload
=
aStream
.
str
().
c_str
();
pViewShell
->
GetDoc
()
->
libreOfficeKitCallback
(
LOK_CALLBACK_SEARCH_RESULT_SELECTION
,
aPayload
.
getStr
());
if
(
!
pSelections
)
{
// notify LibreOfficeKit about changed page
OString
aPayload
=
OString
::
number
(
maCurrentPosition
.
mnPageIndex
);
pViewShell
->
GetDoc
()
->
libreOfficeKitCallback
(
LOK_CALLBACK_SET_PART
,
aPayload
.
getStr
());
// also about search result selections
boost
::
property_tree
::
ptree
aTree
;
aTree
.
put
(
"searchString"
,
mpSearchItem
->
GetSearchString
().
toUtf8
().
getStr
());
boost
::
property_tree
::
ptree
aChildren
;
boost
::
property_tree
::
ptree
aChild
;
aChild
.
put
(
""
,
sRectangles
.
getStr
());
aChildren
.
push_back
(
std
::
make_pair
(
""
,
aChild
));
aTree
.
add_child
(
"searchResultSelection"
,
aChildren
);
std
::
stringstream
aStream
;
boost
::
property_tree
::
write_json
(
aStream
,
aTree
);
aPayload
=
aStream
.
str
().
c_str
();
pViewShell
->
GetDoc
()
->
libreOfficeKitCallback
(
LOK_CALLBACK_SEARCH_RESULT_SELECTION
,
aPayload
.
getStr
());
}
else
{
pSelections
->
push_back
(
sRectangles
);
}
}
return
mbEndOfSearch
;
...
...
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