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
9e1966d9
Kaydet (Commit)
9e1966d9
authored
Eyl 24, 2011
tarafından
Pierre-André Jacquod
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
cppcheck: reduce scope of var in vcl sft.cxx
üst
f9dd399a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
18 additions
and
13 deletions
+18
-13
sft.cxx
vcl/source/fontsubset/sft.cxx
+18
-13
No files found.
vcl/source/fontsubset/sft.cxx
Dosyayı görüntüle @
9e1966d9
...
@@ -950,7 +950,6 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
...
@@ -950,7 +950,6 @@ static int BSplineToPSPath(ControlPoint *srcA, int srcCount, PSPathElement **pat
static
char
*
nameExtract
(
const
sal_uInt8
*
name
,
int
nTableSize
,
int
n
,
int
dbFlag
,
sal_uInt16
**
ucs2result
)
static
char
*
nameExtract
(
const
sal_uInt8
*
name
,
int
nTableSize
,
int
n
,
int
dbFlag
,
sal_uInt16
**
ucs2result
)
{
{
int
i
;
char
*
res
;
char
*
res
;
const
sal_uInt8
*
ptr
=
name
+
GetUInt16
(
name
,
4
,
1
)
+
GetUInt16
(
name
+
6
,
12
*
n
+
10
,
1
);
const
sal_uInt8
*
ptr
=
name
+
GetUInt16
(
name
,
4
,
1
)
+
GetUInt16
(
name
+
6
,
12
*
n
+
10
,
1
);
int
len
=
GetUInt16
(
name
+
6
,
12
*
n
+
8
,
1
);
int
len
=
GetUInt16
(
name
+
6
,
12
*
n
+
8
,
1
);
...
@@ -968,12 +967,14 @@ static char *nameExtract( const sal_uInt8* name, int nTableSize, int n, int dbFl
...
@@ -968,12 +967,14 @@ static char *nameExtract( const sal_uInt8* name, int nTableSize, int n, int dbFl
if
(
dbFlag
)
{
if
(
dbFlag
)
{
res
=
(
char
*
)
malloc
(
1
+
len
/
2
);
res
=
(
char
*
)
malloc
(
1
+
len
/
2
);
assert
(
res
!=
0
);
assert
(
res
!=
0
);
for
(
i
=
0
;
i
<
len
/
2
;
i
++
)
res
[
i
]
=
*
(
ptr
+
i
*
2
+
1
);
for
(
int
i
=
0
;
i
<
len
/
2
;
i
++
)
res
[
i
]
=
*
(
ptr
+
i
*
2
+
1
);
res
[
len
/
2
]
=
0
;
res
[
len
/
2
]
=
0
;
if
(
ucs2result
)
if
(
ucs2result
)
{
{
*
ucs2result
=
(
sal_uInt16
*
)
malloc
(
len
+
2
);
*
ucs2result
=
(
sal_uInt16
*
)
malloc
(
len
+
2
);
for
(
i
=
0
;
i
<
len
/
2
;
i
++
)
(
*
ucs2result
)[
i
]
=
GetUInt16
(
ptr
,
2
*
i
,
1
);
for
(
int
i
=
0
;
i
<
len
/
2
;
i
++
)
(
*
ucs2result
)[
i
]
=
GetUInt16
(
ptr
,
2
*
i
,
1
);
(
*
ucs2result
)[
len
/
2
]
=
0
;
(
*
ucs2result
)[
len
/
2
]
=
0
;
}
}
}
else
{
}
else
{
...
@@ -1595,7 +1596,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
...
@@ -1595,7 +1596,7 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
int
i
;
int
i
;
sal_uInt32
length
,
tag
;
sal_uInt32
length
,
tag
;
sal_uInt32
tdoffset
=
0
;
/* offset to TableDirectory in a TTC file. For TTF files is 0 */
sal_uInt32
tdoffset
=
0
;
/* offset to TableDirectory in a TTC file. For TTF files is 0 */
int
indexfmt
,
k
;
int
indexfmt
;
sal_uInt32
version
=
GetInt32
(
t
->
ptr
,
0
,
1
);
sal_uInt32
version
=
GetInt32
(
t
->
ptr
,
0
,
1
);
...
@@ -1678,9 +1679,9 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
...
@@ -1678,9 +1679,9 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
sal_uInt8
*
p
=
NULL
;
sal_uInt8
*
p
=
NULL
;
for
(
p
=
pHead
+
12
;
p
>
t
->
ptr
;
--
p
)
{
for
(
p
=
pHead
+
12
;
p
>
t
->
ptr
;
--
p
)
{
if
(
p
[
0
]
==
0x5F
&&
p
[
1
]
==
0x0F
&&
p
[
2
]
==
0x3C
&&
p
[
3
]
==
0xF5
)
{
if
(
p
[
0
]
==
0x5F
&&
p
[
1
]
==
0x0F
&&
p
[
2
]
==
0x3C
&&
p
[
3
]
==
0xF5
)
{
int
nDelta
=
(
pHead
+
12
)
-
p
,
j
;
int
nDelta
=
(
pHead
+
12
)
-
p
;
if
(
nDelta
)
if
(
nDelta
)
for
(
j
=
0
;
j
<
NUM_TAGS
;
++
j
)
for
(
int
j
=
0
;
j
<
NUM_TAGS
;
++
j
)
if
(
t
->
tables
[
j
]
)
if
(
t
->
tables
[
j
]
)
*
(
char
**
)
&
t
->
tables
[
j
]
-=
nDelta
;
*
(
char
**
)
&
t
->
tables
[
j
]
-=
nDelta
;
break
;
break
;
...
@@ -1743,8 +1744,9 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
...
@@ -1743,8 +1744,9 @@ static int doOpenTTFont( sal_uInt32 facenum, TrueTypeFont* t )
return
SF_TTFORMAT
;
return
SF_TTFORMAT
;
}
}
if
(
getTable
(
t
,
O_glyf
)
&&
getTable
(
t
,
O_loca
)
)
{
/* TTF or TTF-OpenType */
if
(
getTable
(
t
,
O_glyf
)
&&
getTable
(
t
,
O_loca
)
)
/* TTF or TTF-OpenType */
k
=
(
getTableSize
(
t
,
O_loca
)
/
(
indexfmt
?
4
:
2
))
-
1
;
{
int
k
=
(
getTableSize
(
t
,
O_loca
)
/
(
indexfmt
?
4
:
2
))
-
1
;
if
(
k
<
(
int
)
t
->
nglyphs
)
/* Hack for broken Chinese fonts */
if
(
k
<
(
int
)
t
->
nglyphs
)
/* Hack for broken Chinese fonts */
t
->
nglyphs
=
k
;
t
->
nglyphs
=
k
;
...
@@ -2603,7 +2605,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
...
@@ -2603,7 +2605,7 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
{
{
const
sal_uInt8
*
glyf
=
getTable
(
ttf
,
O_glyf
);
const
sal_uInt8
*
glyf
=
getTable
(
ttf
,
O_glyf
);
const
sal_uInt8
*
hmtx
=
getTable
(
ttf
,
O_hmtx
);
const
sal_uInt8
*
hmtx
=
getTable
(
ttf
,
O_hmtx
);
int
i
,
n
,
m
;
int
n
;
if
(
glyphID
>=
ttf
->
nglyphs
)
if
(
glyphID
>=
ttf
->
nglyphs
)
return
0
;
return
0
;
...
@@ -2633,10 +2635,13 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
...
@@ -2633,10 +2635,13 @@ GlyphData *GetTTRawGlyphData(TrueTypeFont *ttf, sal_uInt32 glyphID)
/* now calculate npoints and ncontours */
/* now calculate npoints and ncontours */
ControlPoint
*
cp
;
ControlPoint
*
cp
;
n
=
GetTTGlyphPoints
(
ttf
,
glyphID
,
&
cp
);
n
=
GetTTGlyphPoints
(
ttf
,
glyphID
,
&
cp
);
if
(
n
!=
-
1
)
{
if
(
n
!=
-
1
)
m
=
0
;
{
for
(
i
=
0
;
i
<
n
;
i
++
)
{
int
m
=
0
;
if
(
cp
[
i
].
flags
&
0x8000
)
m
++
;
for
(
int
i
=
0
;
i
<
n
;
i
++
)
{
if
(
cp
[
i
].
flags
&
0x8000
)
m
++
;
}
}
d
->
npoints
=
(
sal_uInt16
)
n
;
d
->
npoints
=
(
sal_uInt16
)
n
;
d
->
ncontours
=
(
sal_uInt16
)
m
;
d
->
ncontours
=
(
sal_uInt16
)
m
;
...
...
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