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
1f7e6bdd
Kaydet (Commit)
1f7e6bdd
authored
Eyl 08, 2014
tarafından
Michael Meeks
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fdo#82854 - cleanup & review bits.
Change-Id: Ia5b2628adb62013a22cf6c5e384154c54abc2294
üst
8e1a7034
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
22 deletions
+6
-22
testGetEnlishSearchName.cxx
unotools/qa/unit/testGetEnlishSearchName.cxx
+5
-20
fontdefs.cxx
unotools/source/misc/fontdefs.cxx
+1
-2
No files found.
unotools/qa/unit/testGetEnlishSearchName.cxx
Dosyayı görüntüle @
1f7e6bdd
...
@@ -15,10 +15,8 @@
...
@@ -15,10 +15,8 @@
#include "cppunit/plugin/TestPlugIn.h"
#include "cppunit/plugin/TestPlugIn.h"
#include <unotools/fontdefs.hxx>
#include <unotools/fontdefs.hxx>
class
Test
:
public
CppUnit
::
TestFixture
class
Test
:
public
CppUnit
::
TestFixture
{
{
public
:
public
:
virtual
void
setUp
()
SAL_OVERRIDE
;
virtual
void
setUp
()
SAL_OVERRIDE
;
void
testSingleElement
();
void
testSingleElement
();
...
@@ -34,36 +32,23 @@ void Test::setUp()
...
@@ -34,36 +32,23 @@ void Test::setUp()
void
Test
::
testSingleElement
()
void
Test
::
testSingleElement
()
{
{
{
//lowercase
{
// lowercase
printf
(
"GetEnglishSearchFontName(
\"
SYMBOL
\"
)"
);
OUString
test1
=
GetEnglishSearchFontName
(
"SYMBOL"
);
OUString
test1
=
GetEnglishSearchFontName
(
"SYMBOL"
);
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
printf
(
"return %s"
,
test1
.
getStr
());
// trailingWhitespaces
//trailingWhitespaces
printf
(
"GetEnglishSearchFontName(
\"
SYMBOL
\"
)"
);
test1
=
GetEnglishSearchFontName
(
"Symbol "
);
test1
=
GetEnglishSearchFontName
(
"Symbol "
);
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
printf
(
"return %s"
,
test1
.
getStr
());
// removing Skripts
//removing Skripts
printf
(
"GetEnglishSearchFontName(
\"
SYMBOL(skript)
\"
)"
);
test1
=
GetEnglishSearchFontName
(
"Symbol(skript)"
);
test1
=
GetEnglishSearchFontName
(
"Symbol(skript)"
);
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
printf
(
"return %s"
,
test1
.
getStr
());
// remove Whitespaces between
//remove Whitespaces between
printf
(
"GetEnglishSearchFontName(
\"
SYMBOL (skript)
\"
)"
);
test1
=
GetEnglishSearchFontName
(
"Symbol (skript)"
);
test1
=
GetEnglishSearchFontName
(
"Symbol (skript)"
);
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
CPPUNIT_ASSERT_EQUAL
(
test1
,
OUString
(
"symbol"
));
printf
(
"return %s"
,
test1
.
getStr
());
// trailingWhitespaces
//trailingWhitespaces
}
}
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
CPPUNIT_PLUGIN_IMPLEMENT
();
CPPUNIT_PLUGIN_IMPLEMENT
();
...
...
unotools/source/misc/fontdefs.cxx
Dosyayı görüntüle @
1f7e6bdd
...
@@ -400,7 +400,6 @@ OUString GetEnglishSearchFontName( const OUString& rInName )
...
@@ -400,7 +400,6 @@ OUString GetEnglishSearchFontName( const OUString& rInName )
else
if
(
((
c
<
'0'
)
||
(
c
>
'9'
))
&&
(
c
!=
';'
)
)
// not 0-9 or semicolon
else
if
(
((
c
<
'0'
)
||
(
c
>
'9'
))
&&
(
c
!=
';'
)
)
// not 0-9 or semicolon
{
{
// Remove white spaces and special characters
// Remove white spaces and special characters
rName
.
remove
(
i
,
1
);
rName
.
remove
(
i
,
1
);
nLen
--
;
nLen
--
;
continue
;
continue
;
...
@@ -426,7 +425,7 @@ OUString GetEnglishSearchFontName( const OUString& rInName )
...
@@ -426,7 +425,7 @@ OUString GetEnglishSearchFontName( const OUString& rInName )
FontNameDictionary
::
const_iterator
it
=
aDictionary
.
find
(
rNameStr
);
FontNameDictionary
::
const_iterator
it
=
aDictionary
.
find
(
rNameStr
);
if
(
it
!=
aDictionary
.
end
()
)
if
(
it
!=
aDictionary
.
end
()
)
rName
=
OUString
::
createFromAscii
(
it
->
second
);
rName
Str
=
OUString
::
createFromAscii
(
it
->
second
);
}
}
return
rNameStr
;
return
rNameStr
;
...
...
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