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
989cffdd
Kaydet (Commit)
989cffdd
authored
Eki 22, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
some sneaky strings in vcl/win
Change-Id: I489b0088302016fb403fed090be9de9d6c213350
üst
a537db87
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
15 deletions
+15
-15
salgdi3.cxx
vcl/win/source/gdi/salgdi3.cxx
+15
-15
No files found.
vcl/win/source/gdi/salgdi3.cxx
Dosyayı görüntüle @
989cffdd
...
@@ -88,7 +88,7 @@ static bool bImplSalCourierNew = false;
...
@@ -88,7 +88,7 @@ static bool bImplSalCourierNew = false;
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
// TODO: also support temporary TTC font files
// TODO: also support temporary TTC font files
typedef
std
::
map
<
String
,
ImplDevFontAttributes
>
FontAttrMap
;
typedef
std
::
map
<
OU
String
,
ImplDevFontAttributes
>
FontAttrMap
;
class
ImplFontAttrCache
class
ImplFontAttrCache
{
{
...
@@ -108,8 +108,8 @@ public:
...
@@ -108,8 +108,8 @@ public:
const
OUString
&
rBaseURL
);
const
OUString
&
rBaseURL
);
~
ImplFontAttrCache
();
~
ImplFontAttrCache
();
ImplDevFontAttributes
GetFontAttr
(
const
String
&
rFontFileName
)
const
;
ImplDevFontAttributes
GetFontAttr
(
const
OU
String
&
rFontFileName
)
const
;
void
AddFontAttr
(
const
String
&
rFontFileName
,
const
ImplDevFontAttributes
&
);
void
AddFontAttr
(
const
OU
String
&
rFontFileName
,
const
ImplDevFontAttributes
&
);
};
};
ImplFontAttrCache
::
ImplFontAttrCache
(
const
OUString
&
rFileNameURL
,
const
OUString
&
rBaseURL
)
:
aBaseURL
(
rBaseURL
)
ImplFontAttrCache
::
ImplFontAttrCache
(
const
OUString
&
rFileNameURL
,
const
OUString
&
rBaseURL
)
:
aBaseURL
(
rBaseURL
)
...
@@ -130,12 +130,12 @@ ImplFontAttrCache::ImplFontAttrCache( const OUString& rFileNameURL, const OUStri
...
@@ -130,12 +130,12 @@ ImplFontAttrCache::ImplFontAttrCache( const OUString& rFileNameURL, const OUStri
return
;
// ignore cache and rewrite if no match
return
;
// ignore cache and rewrite if no match
// read the cache entries from the file
// read the cache entries from the file
String
aFontFileURL
,
aFontName
;
OUString
aFontFileURL
;
ImplDevFontAttributes
aDFA
;
ImplDevFontAttributes
aDFA
;
for
(;;)
for
(;;)
{
{
aFontFileURL
=
read_lenPrefixed_uInt8s_ToOUString
<
sal_uInt16
>
(
aCacheFile
,
RTL_TEXTENCODING_UTF8
);
aFontFileURL
=
read_lenPrefixed_uInt8s_ToOUString
<
sal_uInt16
>
(
aCacheFile
,
RTL_TEXTENCODING_UTF8
);
if
(
!
aFontFileURL
.
Len
()
)
if
(
aFontFileURL
.
isEmpty
()
)
break
;
break
;
aDFA
.
SetFamilyName
(
read_lenPrefixed_uInt8s_ToOUString
<
sal_uInt16
>
(
aCacheFile
,
RTL_TEXTENCODING_UTF8
));
aDFA
.
SetFamilyName
(
read_lenPrefixed_uInt8s_ToOUString
<
sal_uInt16
>
(
aCacheFile
,
RTL_TEXTENCODING_UTF8
));
...
@@ -169,7 +169,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
...
@@ -169,7 +169,7 @@ ImplFontAttrCache::~ImplFontAttrCache()
FontAttrMap
::
const_iterator
aIter
=
aFontAttributes
.
begin
();
FontAttrMap
::
const_iterator
aIter
=
aFontAttributes
.
begin
();
while
(
aIter
!=
aFontAttributes
.
end
()
)
while
(
aIter
!=
aFontAttributes
.
end
()
)
{
{
const
String
rFontFileURL
(
(
*
aIter
).
first
);
const
OU
String
rFontFileURL
(
(
*
aIter
).
first
);
const
ImplDevFontAttributes
&
rDFA
(
(
*
aIter
).
second
);
const
ImplDevFontAttributes
&
rDFA
(
(
*
aIter
).
second
);
write_lenPrefixed_uInt8s_FromOUString
<
sal_uInt16
>
(
aCacheFile
,
rFontFileURL
,
RTL_TEXTENCODING_UTF8
);
write_lenPrefixed_uInt8s_FromOUString
<
sal_uInt16
>
(
aCacheFile
,
rFontFileURL
,
RTL_TEXTENCODING_UTF8
);
write_lenPrefixed_uInt8s_FromOUString
<
sal_uInt16
>
(
aCacheFile
,
rDFA
.
GetFamilyName
(),
RTL_TEXTENCODING_UTF8
);
write_lenPrefixed_uInt8s_FromOUString
<
sal_uInt16
>
(
aCacheFile
,
rDFA
.
GetFamilyName
(),
RTL_TEXTENCODING_UTF8
);
...
@@ -199,7 +199,7 @@ OUString ImplFontAttrCache::OptimizeURL( const OUString& rURL ) const
...
@@ -199,7 +199,7 @@ OUString ImplFontAttrCache::OptimizeURL( const OUString& rURL ) const
return
aOptimizedFontFileURL
;
return
aOptimizedFontFileURL
;
}
}
ImplDevFontAttributes
ImplFontAttrCache
::
GetFontAttr
(
const
String
&
rFontFileName
)
const
ImplDevFontAttributes
ImplFontAttrCache
::
GetFontAttr
(
const
OU
String
&
rFontFileName
)
const
{
{
ImplDevFontAttributes
aDFA
;
ImplDevFontAttributes
aDFA
;
FontAttrMap
::
const_iterator
it
=
aFontAttributes
.
find
(
OptimizeURL
(
rFontFileName
)
);
FontAttrMap
::
const_iterator
it
=
aFontAttributes
.
find
(
OptimizeURL
(
rFontFileName
)
);
...
@@ -210,7 +210,7 @@ ImplDevFontAttributes ImplFontAttrCache::GetFontAttr( const String& rFontFileNam
...
@@ -210,7 +210,7 @@ ImplDevFontAttributes ImplFontAttrCache::GetFontAttr( const String& rFontFileNam
return
aDFA
;
return
aDFA
;
}
}
void
ImplFontAttrCache
::
AddFontAttr
(
const
String
&
rFontFileName
,
const
ImplDevFontAttributes
&
rDFA
)
void
ImplFontAttrCache
::
AddFontAttr
(
const
OU
String
&
rFontFileName
,
const
ImplDevFontAttributes
&
rDFA
)
{
{
SAL_WARN_IF
(
!
rFontFileName
.
Len
()
||
rDFA
.
GetFamilyName
().
isEmpty
(),
SAL_WARN_IF
(
!
rFontFileName
.
Len
()
||
rDFA
.
GetFamilyName
().
isEmpty
(),
"vcl.gdi"
,
"ImplFontNameCache::AddFontName - invalid data!"
);
"vcl.gdi"
,
"ImplFontNameCache::AddFontName - invalid data!"
);
...
@@ -600,7 +600,7 @@ struct ImplEnumInfo
...
@@ -600,7 +600,7 @@ struct ImplEnumInfo
{
{
HDC
mhDC
;
HDC
mhDC
;
ImplDevFontList
*
mpList
;
ImplDevFontList
*
mpList
;
String
*
mpName
;
OUString
*
mpName
;
LOGFONTA
*
mpLogFontA
;
LOGFONTA
*
mpLogFontA
;
LOGFONTW
*
mpLogFontW
;
LOGFONTW
*
mpLogFontW
;
UINT
mnPreferedCharSet
;
UINT
mnPreferedCharSet
;
...
@@ -1801,7 +1801,7 @@ int CALLBACK SalEnumFontsProcExA( const ENUMLOGFONTEXA* pLogFont,
...
@@ -1801,7 +1801,7 @@ int CALLBACK SalEnumFontsProcExA( const ENUMLOGFONTEXA* pLogFont,
pInfo
->
mbCourier
=
stricmp
(
pLogFont
->
elfLogFont
.
lfFaceName
,
"Courier"
)
==
0
;
pInfo
->
mbCourier
=
stricmp
(
pLogFont
->
elfLogFont
.
lfFaceName
,
"Courier"
)
==
0
;
else
else
pInfo
->
mbCourier
=
FALSE
;
pInfo
->
mbCourier
=
FALSE
;
String
aName
(
ImplSalGetUniString
(
pLogFont
->
elfLogFont
.
lfFaceName
)
);
OU
String
aName
(
ImplSalGetUniString
(
pLogFont
->
elfLogFont
.
lfFaceName
)
);
pInfo
->
mpName
=
&
aName
;
pInfo
->
mpName
=
&
aName
;
strncpy
(
pInfo
->
mpLogFontA
->
lfFaceName
,
pLogFont
->
elfLogFont
.
lfFaceName
,
LF_FACESIZE
);
strncpy
(
pInfo
->
mpLogFontA
->
lfFaceName
,
pLogFont
->
elfLogFont
.
lfFaceName
,
LF_FACESIZE
);
pInfo
->
mpLogFontA
->
lfCharSet
=
pLogFont
->
elfLogFont
.
lfCharSet
;
pInfo
->
mpLogFontA
->
lfCharSet
=
pLogFont
->
elfLogFont
.
lfCharSet
;
...
@@ -1857,7 +1857,7 @@ int CALLBACK SalEnumFontsProcExW( const ENUMLOGFONTEXW* pLogFont,
...
@@ -1857,7 +1857,7 @@ int CALLBACK SalEnumFontsProcExW( const ENUMLOGFONTEXW* pLogFont,
pInfo
->
mbCourier
=
ImplSalWICompareAscii
(
pLogFont
->
elfLogFont
.
lfFaceName
,
"Courier"
)
==
0
;
pInfo
->
mbCourier
=
ImplSalWICompareAscii
(
pLogFont
->
elfLogFont
.
lfFaceName
,
"Courier"
)
==
0
;
else
else
pInfo
->
mbCourier
=
FALSE
;
pInfo
->
mbCourier
=
FALSE
;
String
aName
=
OUString
(
reinterpret_cast
<
const
sal_Unicode
*>
(
pLogFont
->
elfLogFont
.
lfFaceName
));
OU
String
aName
=
OUString
(
reinterpret_cast
<
const
sal_Unicode
*>
(
pLogFont
->
elfLogFont
.
lfFaceName
));
pInfo
->
mpName
=
&
aName
;
pInfo
->
mpName
=
&
aName
;
memcpy
(
pInfo
->
mpLogFontW
->
lfFaceName
,
pLogFont
->
elfLogFont
.
lfFaceName
,
(
aName
.
Len
()
+
1
)
*
sizeof
(
wchar_t
)
);
memcpy
(
pInfo
->
mpLogFontW
->
lfFaceName
,
pLogFont
->
elfLogFont
.
lfFaceName
,
(
aName
.
Len
()
+
1
)
*
sizeof
(
wchar_t
)
);
pInfo
->
mpLogFontW
->
lfCharSet
=
pLogFont
->
elfLogFont
.
lfCharSet
;
pInfo
->
mpLogFontW
->
lfCharSet
=
pLogFont
->
elfLogFont
.
lfCharSet
;
...
@@ -2001,7 +2001,7 @@ void ImplReleaseTempFonts( SalData& rSalData )
...
@@ -2001,7 +2001,7 @@ void ImplReleaseTempFonts( SalData& rSalData )
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
static
bool
ImplGetFontAttrFromFile
(
const
String
&
rFontFileURL
,
static
bool
ImplGetFontAttrFromFile
(
const
OU
String
&
rFontFileURL
,
ImplDevFontAttributes
&
rDFA
)
ImplDevFontAttributes
&
rDFA
)
{
{
OUString
aUSytemPath
;
OUString
aUSytemPath
;
...
@@ -2171,7 +2171,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
...
@@ -2171,7 +2171,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
OUString
aPath
;
OUString
aPath
;
osl_getExecutableFile
(
&
aPath
.
pData
);
osl_getExecutableFile
(
&
aPath
.
pData
);
aPath
=
aPath
.
copy
(
0
,
aPath
.
lastIndexOf
(
'/'
)
);
aPath
=
aPath
.
copy
(
0
,
aPath
.
lastIndexOf
(
'/'
)
);
String
aFontDirUrl
=
aPath
.
copy
(
0
,
aPath
.
lastIndexOf
(
'/'
)
);
OU
String
aFontDirUrl
=
aPath
.
copy
(
0
,
aPath
.
lastIndexOf
(
'/'
)
);
aFontDirUrl
+=
OUString
(
"/"
LIBO_SHARE_FOLDER
"/fonts/truetype"
);
aFontDirUrl
+=
OUString
(
"/"
LIBO_SHARE_FOLDER
"/fonts/truetype"
);
// collect fonts in font path that could not be registered
// collect fonts in font path that could not be registered
...
@@ -2180,7 +2180,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
...
@@ -2180,7 +2180,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
if
(
rcOSL
==
osl
::
FileBase
::
E_None
)
if
(
rcOSL
==
osl
::
FileBase
::
E_None
)
{
{
osl
::
DirectoryItem
aDirItem
;
osl
::
DirectoryItem
aDirItem
;
String
aEmptyString
;
OU
String
aEmptyString
;
OUString
aBootStrap
;
OUString
aBootStrap
;
rtl
::
Bootstrap
::
get
(
OUString
(
"BRAND_BASE_DIR"
),
aBootStrap
);
rtl
::
Bootstrap
::
get
(
OUString
(
"BRAND_BASE_DIR"
),
aBootStrap
);
...
@@ -2189,7 +2189,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
...
@@ -2189,7 +2189,7 @@ void WinSalGraphics::GetDevFontList( ImplDevFontList* pFontList )
OUString
aUserPath
;
OUString
aUserPath
;
aBootstrap
.
getFrom
(
OUString
(
"UserInstallation"
),
aUserPath
);
aBootstrap
.
getFrom
(
OUString
(
"UserInstallation"
),
aUserPath
);
aUserPath
+=
"/user/config/fontnames.dat"
;
aUserPath
+=
"/user/config/fontnames.dat"
;
String
aBaseURL
=
aPath
.
copy
(
0
,
aPath
.
lastIndexOf
(
'/'
)
+
1
);
OU
String
aBaseURL
=
aPath
.
copy
(
0
,
aPath
.
lastIndexOf
(
'/'
)
+
1
);
mpFontAttrCache
=
new
ImplFontAttrCache
(
aUserPath
,
aBaseURL
);
mpFontAttrCache
=
new
ImplFontAttrCache
(
aUserPath
,
aBaseURL
);
while
(
aFontDir
.
getNextItem
(
aDirItem
,
10
)
==
osl
::
FileBase
::
E_None
)
while
(
aFontDir
.
getNextItem
(
aDirItem
,
10
)
==
osl
::
FileBase
::
E_None
)
...
...
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