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
6e1c20b9
Kaydet (Commit)
6e1c20b9
authored
Kas 11, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
vcl: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I91d833a541f1d21be66789bba6c983aa741731d8
üst
c8b2f752
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
17 deletions
+18
-17
ilstbox.hxx
vcl/inc/ilstbox.hxx
+5
-4
ilstbox.cxx
vcl/source/control/ilstbox.cxx
+13
-13
No files found.
vcl/inc/ilstbox.hxx
Dosyayı görüntüle @
6e1c20b9
...
@@ -20,7 +20,8 @@
...
@@ -20,7 +20,8 @@
#ifndef INCLUDED_VCL_INC_ILSTBOX_HXX
#ifndef INCLUDED_VCL_INC_ILSTBOX_HXX
#define INCLUDED_VCL_INC_ILSTBOX_HXX
#define INCLUDED_VCL_INC_ILSTBOX_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <memory>
#include <boost/signals2/signal.hpp>
#include <boost/signals2/signal.hpp>
#include <vcl/image.hxx>
#include <vcl/image.hxx>
#include <vcl/ctrl.hxx>
#include <vcl/ctrl.hxx>
...
@@ -51,7 +52,7 @@ struct ImplEntryType
...
@@ -51,7 +52,7 @@ struct ImplEntryType
OUString
maStr
;
OUString
maStr
;
Image
maImage
;
Image
maImage
;
void
*
mpUserData
;
void
*
mpUserData
;
bool
mbIsSelected
;
bool
mbIsSelected
;
ListBoxEntryFlags
mnFlags
;
ListBoxEntryFlags
mnFlags
;
long
mnHeight
;
long
mnHeight
;
...
@@ -97,13 +98,13 @@ private:
...
@@ -97,13 +98,13 @@ private:
Link
<
sal_Int32
,
void
>
maSelectionChangedHdl
;
Link
<
sal_Int32
,
void
>
maSelectionChangedHdl
;
bool
mbCallSelectionChangedHdl
;
bool
mbCallSelectionChangedHdl
;
boost
::
ptr_vector
<
ImplEntryType
>
maEntries
;
std
::
vector
<
std
::
unique_ptr
<
ImplEntryType
>
>
maEntries
;
ImplEntryType
*
GetEntry
(
sal_Int32
nPos
)
const
ImplEntryType
*
GetEntry
(
sal_Int32
nPos
)
const
{
{
if
(
nPos
<
0
||
static_cast
<
size_t
>
(
nPos
)
>=
maEntries
.
size
())
if
(
nPos
<
0
||
static_cast
<
size_t
>
(
nPos
)
>=
maEntries
.
size
())
return
nullptr
;
return
nullptr
;
return
const_cast
<
ImplEntryType
*>
(
&
maEntries
[
nPos
]
);
return
const_cast
<
ImplEntryType
*>
(
maEntries
[
nPos
].
get
()
);
}
}
public
:
public
:
...
...
vcl/source/control/ilstbox.cxx
Dosyayı görüntüle @
6e1c20b9
...
@@ -87,12 +87,12 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect )
...
@@ -87,12 +87,12 @@ void ImplEntryList::SelectEntry( sal_Int32 nPos, bool bSelect )
{
{
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
maEntries
.
size
())
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
maEntries
.
size
())
{
{
boost
::
ptr_vector
<
ImplEntryType
>::
iterator
iter
=
maEntries
.
begin
()
+
nPos
;
std
::
vector
<
std
::
unique_ptr
<
ImplEntryType
>
>::
iterator
iter
=
maEntries
.
begin
()
+
nPos
;
if
(
(
iter
->
mbIsSelected
!=
bSelect
)
&&
if
(
(
(
*
iter
)
->
mbIsSelected
!=
bSelect
)
&&
(
(
iter
->
mnFlags
&
ListBoxEntryFlags
::
DisableSelection
)
==
ListBoxEntryFlags
::
NONE
)
)
(
(
(
*
iter
)
->
mnFlags
&
ListBoxEntryFlags
::
DisableSelection
)
==
ListBoxEntryFlags
::
NONE
)
)
{
{
iter
->
mbIsSelected
=
bSelect
;
(
*
iter
)
->
mbIsSelected
=
bSelect
;
if
(
mbCallSelectionChangedHdl
)
if
(
mbCallSelectionChangedHdl
)
maSelectionChangedHdl
.
Call
(
nPos
);
maSelectionChangedHdl
.
Call
(
nPos
);
}
}
...
@@ -135,12 +135,12 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
...
@@ -135,12 +135,12 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
if
(
0
<=
nPos
&&
nPos
<
nEntriesSize
)
if
(
0
<=
nPos
&&
nPos
<
nEntriesSize
)
{
{
insPos
=
nPos
;
insPos
=
nPos
;
maEntries
.
insert
(
maEntries
.
begin
()
+
nPos
,
pNewEntry
);
maEntries
.
insert
(
maEntries
.
begin
()
+
nPos
,
std
::
unique_ptr
<
ImplEntryType
>
(
pNewEntry
)
);
}
}
else
else
{
{
insPos
=
nEntriesSize
;
insPos
=
nEntriesSize
;
maEntries
.
push_back
(
pNewEntry
);
maEntries
.
push_back
(
std
::
unique_ptr
<
ImplEntryType
>
(
pNewEntry
)
);
}
}
}
}
else
else
...
@@ -159,7 +159,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
...
@@ -159,7 +159,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
if
(
nComp
>=
0
)
if
(
nComp
>=
0
)
{
{
insPos
=
nEntriesSize
;
insPos
=
nEntriesSize
;
maEntries
.
push_back
(
pNewEntry
);
maEntries
.
push_back
(
std
::
unique_ptr
<
ImplEntryType
>
(
pNewEntry
)
);
}
}
else
else
{
{
...
@@ -169,7 +169,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
...
@@ -169,7 +169,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
if
(
nComp
<=
0
)
if
(
nComp
<=
0
)
{
{
insPos
=
0
;
insPos
=
0
;
maEntries
.
insert
(
maEntries
.
begin
(),
pNewEntry
);
maEntries
.
insert
(
maEntries
.
begin
(),
std
::
unique_ptr
<
ImplEntryType
>
(
pNewEntry
)
);
}
}
else
else
{
{
...
@@ -201,7 +201,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
...
@@ -201,7 +201,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
nMid
++
;
nMid
++
;
insPos
=
nMid
;
insPos
=
nMid
;
maEntries
.
insert
(
maEntries
.
begin
()
+
nMid
,
pNewEntry
);
maEntries
.
insert
(
maEntries
.
begin
()
+
nMid
,
std
::
unique_ptr
<
ImplEntryType
>
(
pNewEntry
)
);
}
}
}
}
}
}
...
@@ -212,7 +212,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
...
@@ -212,7 +212,7 @@ sal_Int32 ImplEntryList::InsertEntry( sal_Int32 nPos, ImplEntryType* pNewEntry,
// Collator implementation is garbage then give the user a chance to see
// Collator implementation is garbage then give the user a chance to see
// his stuff
// his stuff
insPos
=
0
;
insPos
=
0
;
maEntries
.
insert
(
maEntries
.
begin
(),
pNewEntry
);
maEntries
.
insert
(
maEntries
.
begin
(),
std
::
unique_ptr
<
ImplEntryType
>
(
pNewEntry
)
);
}
}
}
}
...
@@ -224,9 +224,9 @@ void ImplEntryList::RemoveEntry( sal_Int32 nPos )
...
@@ -224,9 +224,9 @@ void ImplEntryList::RemoveEntry( sal_Int32 nPos )
{
{
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
maEntries
.
size
())
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
maEntries
.
size
())
{
{
boost
::
ptr_vector
<
ImplEntryType
>::
iterator
iter
=
maEntries
.
begin
()
+
nPos
;
std
::
vector
<
std
::
unique_ptr
<
ImplEntryType
>
>::
iterator
iter
=
maEntries
.
begin
()
+
nPos
;
if
(
!!
iter
->
maImage
)
if
(
!!
(
*
iter
)
->
maImage
)
mnImages
--
;
mnImages
--
;
maEntries
.
erase
(
iter
);
maEntries
.
erase
(
iter
);
...
@@ -238,7 +238,7 @@ sal_Int32 ImplEntryList::FindEntry( const OUString& rString, bool bSearchMRUArea
...
@@ -238,7 +238,7 @@ sal_Int32 ImplEntryList::FindEntry( const OUString& rString, bool bSearchMRUArea
const
sal_Int32
nEntries
=
static_cast
<
sal_Int32
>
(
maEntries
.
size
());
const
sal_Int32
nEntries
=
static_cast
<
sal_Int32
>
(
maEntries
.
size
());
for
(
sal_Int32
n
=
bSearchMRUArea
?
0
:
GetMRUCount
();
n
<
nEntries
;
n
++
)
for
(
sal_Int32
n
=
bSearchMRUArea
?
0
:
GetMRUCount
();
n
<
nEntries
;
n
++
)
{
{
OUString
aComp
(
vcl
::
I18nHelper
::
filterFormattingChars
(
maEntries
[
n
]
.
maStr
)
);
OUString
aComp
(
vcl
::
I18nHelper
::
filterFormattingChars
(
maEntries
[
n
]
->
maStr
)
);
if
(
aComp
==
rString
)
if
(
aComp
==
rString
)
return
n
;
return
n
;
}
}
...
...
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