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
d67da1e7
Kaydet (Commit)
d67da1e7
authored
Nis 16, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove FontNameHash, use standard OUStringHash
Change-Id: If123bbe8a4ee044ef45f418be0118ccf9509f4e7
üst
bcbf14f6
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
29 deletions
+8
-29
fontdefs.hxx
include/unotools/fontdefs.hxx
+0
-2
fontdefs.cxx
unotools/source/misc/fontdefs.cxx
+1
-23
PhysicalFontCollection.hxx
vcl/inc/PhysicalFontCollection.hxx
+1
-1
font.cxx
vcl/source/outdev/font.cxx
+6
-3
No files found.
include/unotools/fontdefs.hxx
Dosyayı görüntüle @
d67da1e7
...
...
@@ -41,8 +41,6 @@ UNOTOOLS_DLLPUBLIC OUString GetSubsFontName( const OUString& rName, sal_uLong nF
UNOTOOLS_DLLPUBLIC
void
AddTokenFontName
(
OUString
&
rName
,
const
OUString
&
rNewToken
);
struct
UNOTOOLS_DLLPUBLIC
FontNameHash
{
int
operator
()(
const
OUString
&
)
const
;
};
// - ConvertChar -
class
UNOTOOLS_DLLPUBLIC
ConvertChar
...
...
unotools/source/misc/fontdefs.cxx
Dosyayı görüntüle @
d67da1e7
...
...
@@ -423,7 +423,7 @@ void GetEnglishSearchFontName( OUString& rName )
// translate normalized localized name to its normalized English ASCII name
if
(
bNeedTranslation
)
{
typedef
boost
::
unordered_map
<
const
OUString
,
const
char
*
,
FontName
Hash
>
FontNameDictionary
;
typedef
boost
::
unordered_map
<
const
OUString
,
const
char
*
,
OUString
Hash
>
FontNameDictionary
;
static
FontNameDictionary
aDictionary
(
SAL_N_ELEMENTS
(
aImplLocalizedNamesList
)
);
// the font name dictionary needs to be intialized once
if
(
aDictionary
.
empty
()
)
...
...
@@ -568,28 +568,6 @@ OUString GetSubsFontName( const OUString& rName, sal_uLong nFlags )
return
aName
;
}
// TODO: use a more generic String hash
int
FontNameHash
::
operator
()(
const
OUString
&
rStr
)
const
{
// this simple hash just has to be good enough for font names
int
nHash
=
0
;
const
int
nLen
=
rStr
.
getLength
();
const
sal_Unicode
*
p
=
rStr
.
getStr
();
switch
(
nLen
)
{
default
:
nHash
=
(
p
[
0
]
<<
16
)
-
(
p
[
1
]
<<
8
)
+
p
[
2
];
nHash
+=
nLen
;
p
+=
nLen
-
3
;
// fall through
case
3
:
nHash
+=
(
p
[
2
]
<<
16
);
// fall through
case
2
:
nHash
+=
(
p
[
1
]
<<
8
);
// fall through
case
1
:
nHash
+=
p
[
0
];
// fall through
case
0
:
break
;
};
return
nHash
;
}
bool
IsStarSymbol
(
const
OUString
&
rFontName
)
{
sal_Int32
nIndex
=
0
;
...
...
vcl/inc/PhysicalFontCollection.hxx
Dosyayı görüntüle @
d67da1e7
...
...
@@ -35,7 +35,7 @@ private:
mutable
bool
mbMatchData
;
// true if matching attributes are initialized
bool
mbMapNames
;
// true if MapNames are available
typedef
boost
::
unordered_map
<
const
OUString
,
PhysicalFontFamily
*
,
FontName
Hash
>
PhysicalFontFamilies
;
typedef
boost
::
unordered_map
<
const
OUString
,
PhysicalFontFamily
*
,
OUString
Hash
>
PhysicalFontFamilies
;
PhysicalFontFamilies
maPhysicalFontFamilies
;
ImplPreMatchFontSubstitution
*
mpPreMatchHook
;
// device specific prematch substitution
...
...
vcl/source/outdev/font.cxx
Dosyayı görüntüle @
d67da1e7
...
...
@@ -770,16 +770,19 @@ size_t ImplFontCache::IFSD_Hash::operator()( const FontSelectPattern& rFSD ) con
size_t
FontSelectPatternAttributes
::
hashCode
()
const
{
// TODO: does it pay off to improve this hash function?
static
FontNameHash
aFontNameHash
;
size_t
nHash
=
aFontNameHash
(
maSearchName
);
size_t
nHash
;
#if ENABLE_GRAPHITE
// check for features and generate a unique hash if necessary
if
(
maTargetName
.
indexOf
(
grutils
::
GrFeatureParser
::
FEAT_PREFIX
)
!=
-
1
)
{
nHash
=
aFontNameHash
(
maTargetName
);
nHash
=
maTargetName
.
hashCode
(
);
}
else
#endif
{
nHash
=
maSearchName
.
hashCode
();
}
nHash
+=
11
*
mnHeight
;
nHash
+=
19
*
GetWeight
();
nHash
+=
29
*
GetSlant
();
...
...
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