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
cef74993
Kaydet (Commit)
cef74993
authored
Tem 23, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
svtools: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: Ib0b10305768d368585d80ad6163e9081a4d8cd28
üst
7c927b64
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
ctrltool.hxx
include/svtools/ctrltool.hxx
+6
-4
ctrltool.cxx
svtools/source/control/ctrltool.cxx
+12
-13
No files found.
include/svtools/ctrltool.hxx
Dosyayı görüntüle @
cef74993
...
...
@@ -20,14 +20,16 @@
#ifndef INCLUDED_SVTOOLS_CTRLTOOL_HXX
#define INCLUDED_SVTOOLS_CTRLTOOL_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include <svtools/svtdllapi.h>
#include <rtl/ustring.hxx>
#include <sal/types.h>
#include <vcl/metric.hxx>
#include <tools/solar.h>
#include <vector>
#include <memory>
class
ImplFontListNameInfo
;
class
OutputDevice
;
...
...
@@ -149,7 +151,7 @@ private:
sal_IntPtr
*
mpSizeAry
;
VclPtr
<
OutputDevice
>
mpDev
;
VclPtr
<
OutputDevice
>
mpDev2
;
boost
::
ptr_vector
<
ImplFontListNameInfo
>
ma
Entries
;
std
::
vector
<
std
::
unique_ptr
<
ImplFontListNameInfo
>>
m_
Entries
;
SVT_DLLPRIVATE
ImplFontListNameInfo
*
ImplFind
(
const
OUString
&
rSearchName
,
sal_uLong
*
pIndex
)
const
;
SVT_DLLPRIVATE
ImplFontListNameInfo
*
ImplFindByName
(
const
OUString
&
rStr
)
const
;
...
...
@@ -182,7 +184,7 @@ public:
bool
IsAvailable
(
const
OUString
&
rName
)
const
;
sal_uInt16
GetFontNameCount
()
const
{
return
(
sal_uInt16
)
m
a
Entries
.
size
();
return
(
sal_uInt16
)
m
_
Entries
.
size
();
}
const
vcl
::
FontInfo
&
GetFontName
(
sal_uInt16
nFont
)
const
;
sal_Handle
GetFirstFontInfo
(
const
OUString
&
rName
)
const
;
...
...
svtools/source/control/ctrltool.cxx
Dosyayı görüntüle @
cef74993
...
...
@@ -168,8 +168,7 @@ ImplFontListNameInfo* FontList::ImplFind(const OUString& rSearchName, sal_uLong*
// then the last one. We only compare to the last entry as the list of VCL
// is returned sorted, which increases the probability that appending
// is more likely
sal_uLong
nCnt
=
maEntries
.
size
();
if
(
!
nCnt
)
if
(
m_Entries
.
empty
())
{
if
(
pIndex
)
*
pIndex
=
ULONG_MAX
;
...
...
@@ -177,7 +176,7 @@ ImplFontListNameInfo* FontList::ImplFind(const OUString& rSearchName, sal_uLong*
}
else
{
const
ImplFontListNameInfo
*
pCmpData
=
&
maEntries
[
nCnt
-
1
]
;
const
ImplFontListNameInfo
*
pCmpData
=
m_Entries
.
back
().
get
()
;
sal_Int32
nComp
=
rSearchName
.
compareTo
(
pCmpData
->
maSearchName
);
if
(
nComp
>
0
)
{
...
...
@@ -192,14 +191,14 @@ ImplFontListNameInfo* FontList::ImplFind(const OUString& rSearchName, sal_uLong*
// search fonts in the list
const
ImplFontListNameInfo
*
pCompareData
;
const
ImplFontListNameInfo
*
pFoundData
=
NULL
;
s
al_uLong
nLow
=
0
;
s
al_uLong
nHigh
=
nCnt
-
1
;
s
al_uLong
nMid
;
s
ize_t
nLow
=
0
;
s
ize_t
nHigh
=
m_Entries
.
size
()
-
1
;
s
ize_t
nMid
;
do
{
nMid
=
(
nLow
+
nHigh
)
/
2
;
pCompareData
=
&
maEntries
[
nMid
]
;
pCompareData
=
m_Entries
[
nMid
].
get
()
;
sal_Int32
nComp
=
rSearchName
.
compareTo
(
pCompareData
->
maSearchName
);
if
(
nComp
<
0
)
{
...
...
@@ -275,10 +274,11 @@ void FontList::ImplInsertFonts( OutputDevice* pDevice, bool bAll,
pData
->
mpFirst
=
pNewInfo
;
pNewInfo
->
mpNext
=
NULL
;
if
(
nIndex
<
maEntries
.
size
())
maEntries
.
insert
(
maEntries
.
begin
()
+
nIndex
,
pData
);
if
(
nIndex
<
m_Entries
.
size
())
m_Entries
.
insert
(
m_Entries
.
begin
()
+
nIndex
,
std
::
unique_ptr
<
ImplFontListNameInfo
>
(
pData
));
else
m
aEntries
.
push_back
(
pData
);
m
_Entries
.
push_back
(
std
::
unique_ptr
<
ImplFontListNameInfo
>
(
pData
)
);
}
}
else
...
...
@@ -372,8 +372,7 @@ FontList::~FontList()
// delete FontInfos
ImplFontListFontInfo
*
pTemp
,
*
pInfo
;
boost
::
ptr_vector
<
ImplFontListNameInfo
>::
iterator
it
;
for
(
it
=
maEntries
.
begin
();
it
!=
maEntries
.
end
();
++
it
)
for
(
auto
const
&
it
:
m_Entries
)
{
pInfo
=
it
->
mpFirst
;
while
(
pInfo
)
...
...
@@ -701,7 +700,7 @@ const vcl::FontInfo& FontList::GetFontName( sal_uInt16 nFont ) const
{
DBG_ASSERT
(
nFont
<
GetFontNameCount
(),
"FontList::GetFontName(): nFont >= Count"
);
return
*
(
m
aEntries
[
nFont
].
mpFirst
);
return
*
(
m
_Entries
[
nFont
]
->
mpFirst
);
}
sal_Handle
FontList
::
GetFirstFontInfo
(
const
OUString
&
rName
)
const
...
...
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