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
afad4eea
Kaydet (Commit)
afad4eea
authored
May 06, 2016
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
svtools: FontList loops with > 2^16 fonts
Change-Id: Idfe5d76ee384dff3280f81686cbf408c2f675dc6
üst
8d10c237
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
16 deletions
+11
-16
ctrltool.hxx
include/svtools/ctrltool.hxx
+3
-6
ctrltool.cxx
svtools/source/control/ctrltool.cxx
+6
-8
stdmenu.cxx
svtools/source/control/stdmenu.cxx
+2
-2
No files found.
include/svtools/ctrltool.hxx
Dosyayı görüntüle @
afad4eea
...
...
@@ -127,9 +127,6 @@ You should thus not reference the array after the next method call on the
FontList.
*/
#define FONTLIST_FONTINFO_NOTFOUND ((sal_uInt16)0xFFFF)
class
SVT_DLLPUBLIC
FontList
{
private
:
...
...
@@ -182,11 +179,11 @@ public:
FontItalic
eItalic
)
const
;
bool
IsAvailable
(
const
OUString
&
rName
)
const
;
s
al_uInt16
GetFontNameCount
()
const
s
ize_t
GetFontNameCount
()
const
{
return
(
sal_uInt16
)
m_Entries
.
size
();
return
m_Entries
.
size
();
}
const
FontMetric
&
GetFontName
(
sal_uInt16
nFont
)
const
;
const
FontMetric
&
GetFontName
(
size_t
nFont
)
const
;
sal_Handle
GetFirstFontMetric
(
const
OUString
&
rName
)
const
;
static
sal_Handle
GetNextFontMetric
(
sal_Handle
hFontMetric
);
static
const
FontMetric
&
GetFontMetric
(
sal_Handle
hFontMetric
);
...
...
svtools/source/control/ctrltool.cxx
Dosyayı görüntüle @
afad4eea
...
...
@@ -249,9 +249,8 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll,
nType
=
FontListFontNameType
::
PRINTER
;
// inquire all fonts from the device
int
n
=
pDevice
->
GetDevFontCount
();
sal_uInt16
i
;
for
(
i
=
0
;
i
<
n
;
i
++
)
int
const
n
=
pDevice
->
GetDevFontCount
();
for
(
int
i
=
0
;
i
<
n
;
++
i
)
{
FontMetric
aFontMetric
=
pDevice
->
GetDevFont
(
i
);
...
...
@@ -387,7 +386,7 @@ FontList::~FontList()
FontList
*
FontList
::
Clone
()
const
{
FontList
*
pReturn
=
new
FontList
(
mpDev
,
mpDev2
,
GetFontNameCount
(
)
==
mpDev
->
GetDevFontCount
());
mpDev
,
mpDev2
,
sal
::
static_int_cast
<
int
>
(
GetFontNameCount
()
)
==
mpDev
->
GetDevFontCount
());
return
pReturn
;
}
...
...
@@ -696,7 +695,7 @@ bool FontList::IsAvailable(const OUString& rName) const
return
(
ImplFindByName
(
rName
)
!=
nullptr
);
}
const
FontMetric
&
FontList
::
GetFontName
(
sal_uInt16
nFont
)
const
const
FontMetric
&
FontList
::
GetFontName
(
size_t
const
nFont
)
const
{
DBG_ASSERT
(
nFont
<
GetFontNameCount
(),
"FontList::GetFontName(): nFont >= Count"
);
...
...
@@ -752,11 +751,10 @@ const sal_IntPtr* FontList::GetSizeAry( const FontMetric& rInfo ) const
MapMode
aMap
(
MAP_10TH_INCH
,
Point
(),
Fraction
(
1
,
72
),
Fraction
(
1
,
72
)
);
pDevice
->
SetMapMode
(
aMap
);
sal_uInt16
i
;
sal_uInt16
nRealCount
=
0
;
int
nRealCount
=
0
;
long
nOldHeight
=
0
;
const_cast
<
FontList
*>
(
this
)
->
mpSizeAry
=
new
sal_IntPtr
[
nDevSizeCount
+
1
];
for
(
i
=
0
;
i
<
nDevSizeCount
;
i
++
)
for
(
int
i
=
0
;
i
<
nDevSizeCount
;
++
i
)
{
Size
aSize
=
pDevice
->
GetDevFontSize
(
rInfo
,
i
);
if
(
aSize
.
Height
()
!=
nOldHeight
)
...
...
svtools/source/control/stdmenu.cxx
Dosyayı görüntüle @
afad4eea
...
...
@@ -54,8 +54,8 @@ void FontNameMenu::Fill( const FontList* pList )
const
vcl
::
I18nHelper
&
rI18nHelper
=
Application
::
GetSettings
().
GetUILocaleI18nHelper
();
// more than 100 fonts reduces the speed of opening the menu.
// So only the first 100 fonts will be displayed.
s
al_uInt16
nFontCount
=
::
std
::
min
(
pList
->
GetFontNameCount
(),
static_cast
<
sal_uInt16
>
(
100
)
);
for
(
s
al_uInt16
i
=
0
;
i
<
nFontCount
;
++
i
)
s
ize_t
nFontCount
=
::
std
::
min
<
size_t
>
(
pList
->
GetFontNameCount
(),
100
);
for
(
s
ize_t
i
=
0
;
i
<
nFontCount
;
++
i
)
{
const
OUString
&
rName
=
pList
->
GetFontName
(
i
).
GetFamilyName
();
...
...
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