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
ffbe1b43
Kaydet (Commit)
ffbe1b43
authored
Nis 24, 2016
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Resolves: tdf#99468 do greedy '*' match if substring match is not allowed
Change-Id: I89ac29b7e8c2e8c567e85a5025dbc1f50050465d
üst
618e7622
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
8 deletions
+32
-8
textsearch.cxx
i18npool/source/search/textsearch.cxx
+32
-8
No files found.
i18npool/source/search/textsearch.cxx
Dosyayı görüntüle @
ffbe1b43
...
...
@@ -1188,7 +1188,7 @@ SearchResult TextSearch::WildcardSrchFrwrd( const OUString& searchStr, sal_Int32
rPattern
.
iterateCodePoints
(
&
nAfterFakePattern
);
}
sal_Int32
nString
=
nStartPos
,
nPat
=
-
1
,
nStr
=
-
1
;
sal_Int32
nString
=
nStartPos
,
nPat
=
-
1
,
nStr
=
-
1
,
nLastAsterisk
=
-
1
;
sal_uInt32
cPatternAfterAsterisk
=
0
;
bool
bEscaped
=
false
,
bEscapedAfterAsterisk
=
false
;
...
...
@@ -1215,11 +1215,21 @@ SearchResult TextSearch::WildcardSrchFrwrd( const OUString& searchStr, sal_Int32
}
else
{
// A trailing '*' is handled below. If the pattern is consumed and
// substring match allowed we're good.
// A trailing '*' is handled below.
if
(
mbWildcardAllowSubstring
)
{
// If the pattern is consumed and substring match allowed we're good.
setWildcardMatch
(
aRes
,
nStartOffset
,
nString
);
return
aRes
;
return
aRes
;
}
else
if
(
nString
<
nEndPos
&&
nLastAsterisk
>=
0
)
{
// If substring match is not allowed try a greedy '*' match.
nPattern
=
nLastAsterisk
;
continue
;
// do
}
else
return
aRes
;
}
if
(
cPattern
==
'*'
&&
!
bEscaped
)
...
...
@@ -1235,6 +1245,8 @@ SearchResult TextSearch::WildcardSrchFrwrd( const OUString& searchStr, sal_Int32
return
aRes
;
}
nLastAsterisk
=
nPattern
;
// Remember last encountered '*'.
// cPattern will be the next non-'*' character, nPattern
// incremented.
cPattern
=
rPattern
.
iterateCodePoints
(
&
nPattern
);
...
...
@@ -1406,7 +1418,7 @@ SearchResult TextSearch::WildcardSrchBkwrd( const OUString& searchStr, sal_Int32
rReversePattern
.
iterateCodePoints
(
&
nAfterFakePattern
,
-
1
);
}
sal_Int32
nString
=
nStartPos
,
nPat
=
-
1
,
nStr
=
-
1
;
sal_Int32
nString
=
nStartPos
,
nPat
=
-
1
,
nStr
=
-
1
,
nLastAsterisk
=
-
1
;
sal_uInt32
cPatternAfterAsterisk
=
0
;
bool
bEscaped
=
false
,
bEscapedAfterAsterisk
=
false
;
...
...
@@ -1433,11 +1445,21 @@ SearchResult TextSearch::WildcardSrchBkwrd( const OUString& searchStr, sal_Int32
}
else
{
// A leading '*' is handled below. If the pattern is consumed and
// substring match allowed we're good.
// A trailing '*' is handled below.
if
(
mbWildcardAllowSubstring
)
{
// If the pattern is consumed and substring match allowed we're good.
setWildcardMatch
(
aRes
,
nStartOffset
,
nString
);
return
aRes
;
return
aRes
;
}
else
if
(
nString
>
nEndPos
&&
nLastAsterisk
>=
0
)
{
// If substring match is not allowed try a greedy '*' match.
nPattern
=
nLastAsterisk
;
continue
;
// do
}
else
return
aRes
;
}
if
(
cPattern
==
'*'
&&
!
bEscaped
)
...
...
@@ -1453,6 +1475,8 @@ SearchResult TextSearch::WildcardSrchBkwrd( const OUString& searchStr, sal_Int32
return
aRes
;
}
nLastAsterisk
=
nPattern
;
// Remember last encountered '*'.
// cPattern will be the previous non-'*' character, nPattern
// decremented.
cPattern
=
rReversePattern
.
iterateCodePoints
(
&
nPattern
,
-
1
);
...
...
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