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
d63b767c
Kaydet (Commit)
d63b767c
authored
Ock 24, 2017
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:useuniqueptr
Change-Id: I502ebf4024cd9b0ee61d58d6b6a8e342c7ceac08
üst
f0b38738
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
10 deletions
+8
-10
salfont.cxx
vcl/win/gdi/salfont.cxx
+8
-10
No files found.
vcl/win/gdi/salfont.cxx
Dosyayı görüntüle @
d63b767c
...
...
@@ -22,6 +22,7 @@
#include <algorithm>
#include <map>
#include <memory>
#include <set>
#include <string.h>
#include <svsys.h>
...
...
@@ -74,19 +75,17 @@ class RawFontData
{
public
:
explicit
RawFontData
(
HDC
,
DWORD
nTableTag
=
0
);
~
RawFontData
()
{
delete
[]
mpRawBytes
;
}
const
unsigned
char
*
get
()
const
{
return
mpRawBytes
;
}
const
unsigned
char
*
steal
()
{
unsigned
char
*
p
=
mpRawBytes
;
mpRawBytes
=
nullptr
;
return
p
;
}
const
unsigned
char
*
get
()
const
{
return
mpRawBytes
.
get
();
}
const
unsigned
char
*
steal
()
{
return
mpRawBytes
.
release
();
}
int
size
()
const
{
return
mnByteCount
;
}
private
:
unsigned
char
*
mpRawBytes
;
std
::
unique_ptr
<
unsigned
char
[]
>
mpRawBytes
;
unsigned
mnByteCount
;
};
RawFontData
::
RawFontData
(
HDC
hDC
,
DWORD
nTableTag
)
:
mpRawBytes
(
nullptr
)
,
mnByteCount
(
0
)
:
mnByteCount
(
0
)
{
// get required size in bytes
mnByteCount
=
::
GetFontData
(
hDC
,
nTableTag
,
0
,
nullptr
,
0
);
...
...
@@ -96,7 +95,7 @@ RawFontData::RawFontData( HDC hDC, DWORD nTableTag )
return
;
// allocate the array
mpRawBytes
=
new
unsigned
char
[
mnByteCount
]
;
mpRawBytes
.
reset
(
new
unsigned
char
[
mnByteCount
])
;
// get raw data in chunks small enough for GetFontData()
unsigned
nRawDataOfs
=
0
;
...
...
@@ -111,7 +110,7 @@ RawFontData::RawFontData( HDC hDC, DWORD nTableTag )
if
(
nFDGet
>
nMaxChunkSize
)
nFDGet
=
nMaxChunkSize
;
const
DWORD
nFDGot
=
::
GetFontData
(
hDC
,
nTableTag
,
nRawDataOfs
,
mpRawBytes
+
nRawDataOfs
,
nFDGet
);
mpRawBytes
.
get
()
+
nRawDataOfs
,
nFDGet
);
if
(
!
nFDGot
)
break
;
else
if
(
nFDGot
!=
GDI_ERROR
)
...
...
@@ -128,8 +127,7 @@ RawFontData::RawFontData( HDC hDC, DWORD nTableTag )
// cleanup if the raw data is incomplete
if
(
nRawDataOfs
!=
mnByteCount
)
{
delete
[]
mpRawBytes
;
mpRawBytes
=
nullptr
;
mpRawBytes
.
reset
();
}
}
...
...
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