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
6676c4eb
Kaydet (Commit)
6676c4eb
authored
Kas 28, 2012
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fix rtl::OUString::compareToIgnoreAsciiCase
Change-Id: I40005ef4fad4d44314ec2fb2881fec82e926970e
üst
47dfe5b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
6 deletions
+19
-6
ustring.hxx
sal/inc/rtl/ustring.hxx
+4
-6
test_oustring_compare.cxx
sal/qa/rtl/strings/test_oustring_compare.cxx
+15
-0
No files found.
sal/inc/rtl/ustring.hxx
Dosyayı görüntüle @
6676c4eb
...
...
@@ -527,8 +527,8 @@ public:
/**
Perform a ASCII lowercase comparison of two strings.
Compare t
eh two string
with uppercase ASCII
character values between 65 and 90 (ASCII A-Z)
are
interpreted as
Compare t
he two strings
with uppercase ASCII
character values between 65 and 90 (ASCII A-Z) interpreted as
values between 97 and 122 (ASCII a-z).
This function can't be used for language specific comparison.
...
...
@@ -536,13 +536,11 @@ public:
@return 0 - if both strings are equal
< 0 - if this string is less than the string argument
> 0 - if this string is greater than the string argument
@since LibreOffice 4.0
*/
sal_Int32
compareToIgnoreAsciiCase
(
const
OUString
&
str
)
const
SAL_THROW
(())
{
if
(
pData
->
length
!=
str
.
pData
->
length
)
return
sal_False
;
if
(
pData
==
str
.
pData
)
return
sal_True
;
return
rtl_ustr_compareIgnoreAsciiCase_WithLength
(
pData
->
buffer
,
pData
->
length
,
str
.
pData
->
buffer
,
str
.
pData
->
length
);
}
...
...
sal/qa/rtl/strings/test_oustring_compare.cxx
Dosyayı görüntüle @
6676c4eb
...
...
@@ -32,9 +32,12 @@ private:
void
compareToAscii
();
void
compareToIgnoreAsciiCase
();
CPPUNIT_TEST_SUITE
(
Compare
);
CPPUNIT_TEST
(
equalsIgnoreAsciiCaseAscii
);
CPPUNIT_TEST
(
compareToAscii
);
CPPUNIT_TEST
(
compareToIgnoreAsciiCase
);
CPPUNIT_TEST_SUITE_END
();
};
...
...
@@ -70,4 +73,16 @@ void test::oustring::Compare::compareToAscii()
sal_Int32
(
0
),
abc
.
compareToAscii
(
RTL_CONSTASCII_STRINGPARAM
(
"a"
)));
}
void
test
::
oustring
::
Compare
::
compareToIgnoreAsciiCase
()
{
CPPUNIT_ASSERT_EQUAL
(
sal_Int32
(
0
),
rtl
::
OUString
(
"abc"
).
compareToIgnoreAsciiCase
(
rtl
::
OUString
(
"ABC"
)));
CPPUNIT_ASSERT
(
rtl
::
OUString
(
"ABC"
).
compareToIgnoreAsciiCase
(
rtl
::
OUString
(
"abcdef"
))
<
0
);
CPPUNIT_ASSERT
(
rtl
::
OUString
(
"A"
).
compareToIgnoreAsciiCase
(
rtl
::
OUString
(
"_"
))
>
0
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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