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
e85f223e
Kaydet (Commit)
e85f223e
authored
May 02, 2011
tarafından
Rafael Dominguez
Kaydeden (comit)
Joseph Powers
May 04, 2011
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Remove List usage in FontList
üst
57ad48b8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
27 deletions
+26
-27
ctrltool.hxx
svtools/inc/svtools/ctrltool.hxx
+5
-4
ctrltool.cxx
svtools/source/control/ctrltool.cxx
+21
-23
No files found.
svtools/inc/svtools/ctrltool.hxx
Dosyayı görüntüle @
e85f223e
...
@@ -29,8 +29,9 @@
...
@@ -29,8 +29,9 @@
#ifndef _CTRLTOOL_HXX
#ifndef _CTRLTOOL_HXX
#define _CTRLTOOL_HXX
#define _CTRLTOOL_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include "svtools/svtdllapi.h"
#include "svtools/svtdllapi.h"
#include <tools/list.hxx>
#include <sal/types.h>
#include <sal/types.h>
#include <vcl/metric.hxx>
#include <vcl/metric.hxx>
...
@@ -150,7 +151,7 @@ von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
...
@@ -150,7 +151,7 @@ von der FontList, sollte deshalb das Array nicht mehr referenziert werden.
#define FONTLIST_FONTNAMETYPE_SCREEN ((sal_uInt16)0x0002)
#define FONTLIST_FONTNAMETYPE_SCREEN ((sal_uInt16)0x0002)
#define FONTLIST_FONTNAMETYPE_SCALABLE ((sal_uInt16)0x0004)
#define FONTLIST_FONTNAMETYPE_SCALABLE ((sal_uInt16)0x0004)
class
SVT_DLLPUBLIC
FontList
:
private
List
class
SVT_DLLPUBLIC
FontList
{
{
private
:
private
:
XubString
maMapBoth
;
XubString
maMapBoth
;
...
@@ -170,7 +171,7 @@ private:
...
@@ -170,7 +171,7 @@ private:
long
*
mpSizeAry
;
long
*
mpSizeAry
;
OutputDevice
*
mpDev
;
OutputDevice
*
mpDev
;
OutputDevice
*
mpDev2
;
OutputDevice
*
mpDev2
;
boost
::
ptr_vector
<
ImplFontListNameInfo
>
maEntries
;
#ifdef CTRLTOOL_CXX
#ifdef CTRLTOOL_CXX
SVT_DLLPRIVATE
ImplFontListNameInfo
*
ImplFind
(
const
XubString
&
rSearchName
,
sal_uLong
*
pIndex
)
const
;
SVT_DLLPRIVATE
ImplFontListNameInfo
*
ImplFind
(
const
XubString
&
rSearchName
,
sal_uLong
*
pIndex
)
const
;
SVT_DLLPRIVATE
ImplFontListNameInfo
*
ImplFindByName
(
const
XubString
&
rStr
)
const
;
SVT_DLLPRIVATE
ImplFontListNameInfo
*
ImplFindByName
(
const
XubString
&
rStr
)
const
;
...
@@ -206,7 +207,7 @@ public:
...
@@ -206,7 +207,7 @@ public:
sal_Bool
IsAvailable
(
const
XubString
&
rName
)
const
;
sal_Bool
IsAvailable
(
const
XubString
&
rName
)
const
;
sal_uInt16
GetFontNameCount
()
const
sal_uInt16
GetFontNameCount
()
const
{
return
(
sal_uInt16
)
List
::
Count
();
}
{
return
(
sal_uInt16
)
maEntries
.
size
();
}
const
FontInfo
&
GetFontName
(
sal_uInt16
nFont
)
const
;
const
FontInfo
&
GetFontName
(
sal_uInt16
nFont
)
const
;
sal_uInt16
GetFontNameType
(
sal_uInt16
nFont
)
const
;
sal_uInt16
GetFontNameType
(
sal_uInt16
nFont
)
const
;
sal_Handle
GetFirstFontInfo
(
const
XubString
&
rName
)
const
;
sal_Handle
GetFirstFontInfo
(
const
XubString
&
rName
)
const
;
...
...
svtools/source/control/ctrltool.cxx
Dosyayı görüntüle @
e85f223e
...
@@ -171,30 +171,30 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
...
@@ -171,30 +171,30 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
// und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
// und somit die Wahrscheinlichkeit das hinten angehaengt werden muss
// sehr gross ist.
// sehr gross ist.
StringCompare
eComp
;
StringCompare
eComp
;
sal_uLong
nCnt
=
Count
();
sal_uLong
nCnt
=
maEntries
.
size
();
if
(
!
nCnt
)
if
(
!
nCnt
)
{
{
if
(
pIndex
)
if
(
pIndex
)
*
pIndex
=
LIST_APPEND
;
*
pIndex
=
ULONG_MAX
;
return
NULL
;
return
NULL
;
}
}
else
else
{
{
ImplFontListNameInfo
*
pCmpData
=
(
ImplFontListNameInfo
*
)
List
::
GetObject
(
nCnt
-
1
)
;
const
ImplFontListNameInfo
*
pCmpData
=
&
maEntries
[
nCnt
-
1
]
;
eComp
=
rSearchName
.
CompareTo
(
pCmpData
->
maSearchName
);
eComp
=
rSearchName
.
CompareTo
(
pCmpData
->
maSearchName
);
if
(
eComp
==
COMPARE_GREATER
)
if
(
eComp
==
COMPARE_GREATER
)
{
{
if
(
pIndex
)
if
(
pIndex
)
*
pIndex
=
LIST_APPEND
;
*
pIndex
=
ULONG_MAX
;
return
NULL
;
return
NULL
;
}
}
else
if
(
eComp
==
COMPARE_EQUAL
)
else
if
(
eComp
==
COMPARE_EQUAL
)
return
pCmpData
;
return
const_cast
<
ImplFontListNameInfo
*>
(
pCmpData
)
;
}
}
// Fonts in der Liste suchen
// Fonts in der Liste suchen
ImplFontListNameInfo
*
pCompareData
;
const
ImplFontListNameInfo
*
pCompareData
;
ImplFontListNameInfo
*
pFoundData
=
NULL
;
const
ImplFontListNameInfo
*
pFoundData
=
NULL
;
sal_uLong
nLow
=
0
;
sal_uLong
nLow
=
0
;
sal_uLong
nHigh
=
nCnt
-
1
;
sal_uLong
nHigh
=
nCnt
-
1
;
sal_uLong
nMid
;
sal_uLong
nMid
;
...
@@ -202,7 +202,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
...
@@ -202,7 +202,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
do
do
{
{
nMid
=
(
nLow
+
nHigh
)
/
2
;
nMid
=
(
nLow
+
nHigh
)
/
2
;
pCompareData
=
(
ImplFontListNameInfo
*
)
List
::
GetObject
(
nMid
)
;
pCompareData
=
&
maEntries
[
nMid
]
;
eComp
=
rSearchName
.
CompareTo
(
pCompareData
->
maSearchName
);
eComp
=
rSearchName
.
CompareTo
(
pCompareData
->
maSearchName
);
if
(
eComp
==
COMPARE_LESS
)
if
(
eComp
==
COMPARE_LESS
)
{
{
...
@@ -232,7 +232,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
...
@@ -232,7 +232,7 @@ ImplFontListNameInfo* FontList::ImplFind( const XubString& rSearchName, sal_uLon
*
pIndex
=
nMid
;
*
pIndex
=
nMid
;
}
}
return
pFoundData
;
return
const_cast
<
ImplFontListNameInfo
*>
(
pFoundData
)
;
}
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
...
@@ -284,7 +284,11 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
...
@@ -284,7 +284,11 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
pData
->
mpFirst
=
pNewInfo
;
pData
->
mpFirst
=
pNewInfo
;
pNewInfo
->
mpNext
=
NULL
;
pNewInfo
->
mpNext
=
NULL
;
pData
->
mnType
=
0
;
pData
->
mnType
=
0
;
Insert
(
(
void
*
)
pData
,
nIndex
);
if
(
nIndex
<
maEntries
.
size
())
maEntries
.
insert
(
maEntries
.
begin
()
+
nIndex
,
pData
);
else
maEntries
.
push_back
(
pData
);
}
}
}
}
else
else
...
@@ -344,8 +348,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
...
@@ -344,8 +348,7 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, sal_Bool bAll,
// =======================================================================
// =======================================================================
FontList
::
FontList
(
OutputDevice
*
pDevice
,
OutputDevice
*
pDevice2
,
sal_Bool
bAll
)
:
FontList
::
FontList
(
OutputDevice
*
pDevice
,
OutputDevice
*
pDevice2
,
sal_Bool
bAll
)
List
(
4096
,
sal
::
static_int_cast
<
sal_uInt16
>
(
pDevice
->
GetDevFontCount
()),
32
)
{
{
// Variablen initialisieren
// Variablen initialisieren
mpDev
=
pDevice
;
mpDev
=
pDevice
;
...
@@ -387,20 +390,17 @@ FontList::~FontList()
...
@@ -387,20 +390,17 @@ FontList::~FontList()
delete
[]
mpSizeAry
;
delete
[]
mpSizeAry
;
// FontInfos loeschen
// FontInfos loeschen
ImplFontListNameInfo
*
pData
=
(
ImplFontListNameInfo
*
)
First
();
ImplFontListFontInfo
*
pTemp
,
*
pInfo
;
while
(
pData
)
boost
::
ptr_vector
<
ImplFontListNameInfo
>::
iterator
it
;
for
(
it
=
maEntries
.
begin
();
it
!=
maEntries
.
end
();
++
it
)
{
{
ImplFontListFontInfo
*
pTemp
;
pInfo
=
it
->
mpFirst
;
ImplFontListFontInfo
*
pInfo
=
pData
->
mpFirst
;
while
(
pInfo
)
while
(
pInfo
)
{
{
pTemp
=
pInfo
->
mpNext
;
pTemp
=
pInfo
->
mpNext
;
delete
pInfo
;
delete
pInfo
;
pInfo
=
pTemp
;
pInfo
=
pTemp
;
}
}
ImplFontListNameInfo
*
pNext
=
(
ImplFontListNameInfo
*
)
Next
();
delete
pData
;
pData
=
pNext
;
}
}
}
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
...
@@ -757,8 +757,7 @@ const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
...
@@ -757,8 +757,7 @@ const FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
{
{
DBG_ASSERT
(
nFont
<
GetFontNameCount
(),
"FontList::GetFontName(): nFont >= Count"
);
DBG_ASSERT
(
nFont
<
GetFontNameCount
(),
"FontList::GetFontName(): nFont >= Count"
);
ImplFontListNameInfo
*
pData
=
(
ImplFontListNameInfo
*
)
List
::
GetObject
(
nFont
);
return
*
(
maEntries
[
nFont
].
mpFirst
);
return
*
(
pData
->
mpFirst
);
}
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
...
@@ -767,8 +766,7 @@ sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
...
@@ -767,8 +766,7 @@ sal_uInt16 FontList::GetFontNameType( sal_uInt16 nFont ) const
{
{
DBG_ASSERT
(
nFont
<
GetFontNameCount
(),
"FontList::GetFontNameType(): nFont >= Count"
);
DBG_ASSERT
(
nFont
<
GetFontNameCount
(),
"FontList::GetFontNameType(): nFont >= Count"
);
ImplFontListNameInfo
*
pData
=
(
ImplFontListNameInfo
*
)
List
::
GetObject
(
nFont
);
return
maEntries
[
nFont
].
mnType
;
return
pData
->
mnType
;
}
}
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
...
...
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