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
dbc371c4
Kaydet (Commit)
dbc371c4
authored
Tem 22, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add test for CJK (~X) mnemonics
Change-Id: I1f69c23dcde6d963ad9c3bc1f2d9178fe15eb27c
üst
86988a9e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
5 deletions
+20
-5
mnemonic.cxx
vcl/qa/cppunit/mnemonic.cxx
+18
-3
mnemonic.cxx
vcl/source/window/mnemonic.cxx
+2
-2
No files found.
vcl/qa/cppunit/mnemonic.cxx
Dosyayı görüntüle @
dbc371c4
...
...
@@ -32,9 +32,24 @@ void VclMnemonicTest::testMnemonic()
{
MnemonicGenerator
aGenerator
;
const
sal_Unicode
TEST
[]
=
{
0x00DF
,
'a'
};
OUString
sResult
=
aGenerator
.
CreateMnemonic
(
OUString
(
TEST
,
SAL_N_ELEMENTS
(
TEST
)));
CPPUNIT_ASSERT_EQUAL
(
u'~'
,
sResult
[
1
]);
{
const
sal_Unicode
TEST
[]
=
{
0x00DF
,
'a'
};
OUString
sResult
=
aGenerator
.
CreateMnemonic
(
OUString
(
TEST
,
SAL_N_ELEMENTS
(
TEST
)));
CPPUNIT_ASSERT_EQUAL
(
u'~'
,
sResult
[
1
]);
}
{
const
sal_Unicode
TEST
[]
=
{
0x4E00
,
'b'
};
OUString
sResult
=
aGenerator
.
CreateMnemonic
(
OUString
(
TEST
,
SAL_N_ELEMENTS
(
TEST
)));
CPPUNIT_ASSERT_EQUAL
(
u'~'
,
sResult
[
1
]);
}
{
const
sal_Unicode
TEST
[]
=
{
0x4E00
};
OUString
sResult
=
aGenerator
.
CreateMnemonic
(
OUString
(
TEST
,
SAL_N_ELEMENTS
(
TEST
)));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"(~C)"
),
sResult
.
copy
(
sResult
.
getLength
()
-
4
));
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
VclMnemonicTest
);
...
...
vcl/source/window/mnemonic.cxx
Dosyayı görüntüle @
dbc371c4
...
...
@@ -253,14 +253,14 @@ OUString MnemonicGenerator::CreateMnemonic( const OUString& _rKey )
// Append Ascii Mnemonic
for
(
c
=
MNEMONIC_RANGE_2_START
;
c
<=
MNEMONIC_RANGE_2_END
;
c
++
)
{
nMnemonicIndex
=
ImplGetMnemonicIndex
(
sal_Unicode
(
rtl
::
toAsciiUpperCase
(
c
))
);
nMnemonicIndex
=
ImplGetMnemonicIndex
(
c
);
if
(
nMnemonicIndex
!=
MNEMONIC_INDEX_NOTFOUND
)
{
if
(
maMnemonics
[
nMnemonicIndex
]
)
{
maMnemonics
[
nMnemonicIndex
]
=
0
;
OUString
aStr
=
OUStringBuffer
().
append
(
'('
).
append
(
MNEMONIC_CHAR
).
append
(
c
).
append
(
'('
).
append
(
MNEMONIC_CHAR
).
append
(
sal_Unicode
(
rtl
::
toAsciiUpperCase
(
c
))
).
append
(
')'
).
makeStringAndClear
();
nIndex
=
rKey
.
getLength
();
if
(
nIndex
>=
2
)
...
...
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