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
bd28739f
Kaydet (Commit)
bd28739f
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 deprecated List from ImplEntryList
üst
e85f223e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
61 additions
and
40 deletions
+61
-40
ilstbox.hxx
vcl/inc/vcl/ilstbox.hxx
+13
-5
ilstbox.cxx
vcl/source/control/ilstbox.cxx
+48
-35
No files found.
vcl/inc/vcl/ilstbox.hxx
Dosyayı görüntüle @
bd28739f
...
...
@@ -29,6 +29,8 @@
#ifndef _SV_ILSTBOX_HXX
#define _SV_ILSTBOX_HXX
#include <boost/ptr_container/ptr_vector.hpp>
#include <vcl/sv.h>
#include <vcl/image.hxx>
#include <vcl/ctrl.hxx>
...
...
@@ -104,7 +106,7 @@ struct ImplEntryType
// - ImplEntryList -
// -----------------
class
ImplEntryList
:
private
List
class
ImplEntryList
{
private
:
Window
*
mpWindow
;
// For getting the current locale when matching strings
...
...
@@ -117,8 +119,14 @@ private:
Link
maSelectionChangedHdl
;
sal_Bool
mbCallSelectionChangedHdl
;
boost
::
ptr_vector
<
ImplEntryType
>
maEntries
;
ImplEntryType
*
GetEntry
(
sal_uInt16
nPos
)
const
{
return
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
}
ImplEntryType
*
GetEntry
(
sal_uInt16
nPos
)
const
{
if
(
nPos
>=
maEntries
.
size
())
return
NULL
;
return
const_cast
<
ImplEntryType
*>
(
&
maEntries
[
nPos
]);
}
public
:
ImplEntryList
(
Window
*
pWindow
);
...
...
@@ -126,8 +134,8 @@ public:
sal_uInt16
InsertEntry
(
sal_uInt16
nPos
,
ImplEntryType
*
pNewEntry
,
sal_Bool
bSort
);
void
RemoveEntry
(
sal_uInt16
nPos
);
const
ImplEntryType
*
GetEntryPtr
(
sal_uInt16
nPos
)
const
{
return
(
const
ImplEntryType
*
)
Get
Object
(
nPos
);
}
ImplEntryType
*
GetMutableEntryPtr
(
sal_uInt16
nPos
)
const
{
return
(
ImplEntryType
*
)
GetObject
(
nPos
);
}
const
ImplEntryType
*
GetEntryPtr
(
sal_uInt16
nPos
)
const
{
return
(
const
ImplEntryType
*
)
Get
Entry
(
nPos
);
}
ImplEntryType
*
GetMutableEntryPtr
(
sal_uInt16
nPos
)
const
{
return
GetEntry
(
nPos
);
}
void
Clear
();
sal_uInt16
FindMatchingEntry
(
const
XubString
&
rStr
,
sal_uInt16
nStart
=
0
,
sal_Bool
bForward
=
sal_True
,
sal_Bool
bLazy
=
sal_True
)
const
;
...
...
@@ -141,7 +149,7 @@ public:
long
GetAddedHeight
(
sal_uInt16
nEndIndex
,
sal_uInt16
nBeginIndex
=
0
,
long
nBeginHeight
=
0
)
const
;
long
GetEntryHeight
(
sal_uInt16
nPos
)
const
;
sal_uInt16
GetEntryCount
()
const
{
return
(
sal_uInt16
)
List
::
Count
();
}
sal_uInt16
GetEntryCount
()
const
{
return
(
sal_uInt16
)
maEntries
.
size
();
}
sal_Bool
HasImages
()
const
{
return
mnImages
?
sal_True
:
sal_False
;
}
XubString
GetEntryText
(
sal_uInt16
nPos
)
const
;
...
...
vcl/source/control/ilstbox.cxx
Dosyayı görüntüle @
bd28739f
...
...
@@ -124,26 +124,24 @@ ImplEntryList::~ImplEntryList()
void
ImplEntryList
::
Clear
()
{
mnImages
=
0
;
for
(
sal_uInt16
n
=
GetEntryCount
();
n
;
)
{
ImplEntryType
*
pImplEntry
=
GetEntry
(
--
n
);
delete
pImplEntry
;
}
List
::
Clear
();
maEntries
.
clear
();
}
// -----------------------------------------------------------------------
void
ImplEntryList
::
SelectEntry
(
sal_uInt16
nPos
,
sal_Bool
bSelect
)
{
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
if
(
pImplEntry
&&
(
pImplEntry
->
mbIsSelected
!=
bSelect
)
&&
(
(
pImplEntry
->
mnFlags
&
LISTBOX_ENTRY_FLAG_DISABLE_SELECTION
)
==
0
)
)
if
(
nPos
<
maEntries
.
size
())
{
pImplEntry
->
mbIsSelected
=
bSelect
;
if
(
mbCallSelectionChangedHdl
)
maSelectionChangedHdl
.
Call
(
(
void
*
)
sal_IntPtr
(
nPos
)
);
boost
::
ptr_vector
<
ImplEntryType
>::
iterator
iter
=
maEntries
.
begin
()
+
nPos
;
if
(
(
iter
->
mbIsSelected
!=
bSelect
)
&&
(
(
iter
->
mnFlags
&
LISTBOX_ENTRY_FLAG_DISABLE_SELECTION
)
==
0
)
)
{
iter
->
mbIsSelected
=
bSelect
;
if
(
mbCallSelectionChangedHdl
)
maSelectionChangedHdl
.
Call
(
(
void
*
)
sal_IntPtr
(
nPos
)
);
}
}
}
...
...
@@ -177,9 +175,20 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
if
(
!!
pNewEntry
->
maImage
)
mnImages
++
;
if
(
!
bSort
||
!
Count
()
)
sal_uInt16
insPos
=
0
;
if
(
!
bSort
||
maEntries
.
empty
())
{
Insert
(
pNewEntry
,
nPos
);
if
(
nPos
<
maEntries
.
size
())
{
insPos
=
nPos
;
maEntries
.
insert
(
maEntries
.
begin
()
+
nPos
,
pNewEntry
);
}
else
{
maEntries
.
push_back
(
pNewEntry
);
insPos
=
maEntries
.
size
();
}
}
else
{
...
...
@@ -188,7 +197,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
const
XubString
&
rStr
=
pNewEntry
->
maStr
;
sal_uLong
nLow
,
nHigh
,
nMid
;
nHigh
=
Count
();
nHigh
=
maEntries
.
size
();
ImplEntryType
*
pTemp
=
GetEntry
(
(
sal_uInt16
)(
nHigh
-
1
)
);
...
...
@@ -201,7 +210,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
// Schnelles Einfuegen bei sortierten Daten
if
(
eComp
!=
COMPARE_LESS
)
{
Insert
(
pNewEntry
,
LIST_APPEND
);
insPos
=
maEntries
.
size
();
maEntries
.
push_back
(
pNewEntry
);
}
else
{
...
...
@@ -211,7 +221,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
eComp
=
(
StringCompare
)
rSorter
.
compare
(
rStr
,
pTemp
->
maStr
);
if
(
eComp
!=
COMPARE_GREATER
)
{
Insert
(
pNewEntry
,
(
sal_uLong
)
0
);
insPos
=
0
;
maEntries
.
insert
(
maEntries
.
begin
(),
pNewEntry
);
}
else
{
...
...
@@ -220,7 +231,7 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
do
{
nMid
=
(
nLow
+
nHigh
)
/
2
;
pTemp
=
(
ImplEntryType
*
)
Get
Object
(
nMid
);
pTemp
=
(
ImplEntryType
*
)
Get
Entry
(
nMid
);
eComp
=
(
StringCompare
)
rSorter
.
compare
(
rStr
,
pTemp
->
maStr
);
...
...
@@ -239,7 +250,8 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
if
(
eComp
!=
COMPARE_LESS
)
nMid
++
;
Insert
(
pNewEntry
,
nMid
);
insPos
=
nMid
;
maEntries
.
insert
(
maEntries
.
begin
()
+
nMid
,
pNewEntry
);
}
}
}
...
...
@@ -249,25 +261,27 @@ sal_uInt16 ImplEntryList::InsertEntry( sal_uInt16 nPos, ImplEntryType* pNewEntry
// garbage you wouldn't insert it. If the exception occurred because the
// Collator implementation is garbage then give the user a chance to see
// his stuff
Insert
(
pNewEntry
,
(
sal_uLong
)
0
);
insPos
=
0
;
maEntries
.
insert
(
maEntries
.
begin
(),
pNewEntry
);
}
}
return
(
sal_uInt16
)
GetPos
(
pNewEntry
)
;
return
insPos
;
}
// -----------------------------------------------------------------------
void
ImplEntryList
::
RemoveEntry
(
sal_uInt16
nPos
)
{
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
Remove
(
nPos
);
if
(
pImplEntry
)
boost
::
ptr_vector
<
ImplEntryType
>::
iterator
iter
=
maEntries
.
begin
()
+
nPos
;
if
(
iter
!=
maEntries
.
end
())
{
if
(
!!
pImplEntry
->
maImage
)
if
(
!!
iter
->
maImage
)
mnImages
--
;
delete
pImplEntry
;
maEntries
.
erase
(
iter
)
;
}
}
...
...
@@ -275,11 +289,10 @@ void ImplEntryList::RemoveEntry( sal_uInt16 nPos )
sal_uInt16
ImplEntryList
::
FindEntry
(
const
XubString
&
rString
,
sal_Bool
bSearchMRUArea
)
const
{
sal_uInt16
nEntries
=
GetEntryCount
();
sal_uInt16
nEntries
=
maEntries
.
size
();
for
(
sal_uInt16
n
=
bSearchMRUArea
?
0
:
GetMRUCount
();
n
<
nEntries
;
n
++
)
{
ImplEntryType
*
pImplEntry
=
GetEntry
(
n
);
String
aComp
(
vcl
::
I18nHelper
::
filterFormattingChars
(
pImplEntry
->
maStr
)
);
String
aComp
(
vcl
::
I18nHelper
::
filterFormattingChars
(
maEntries
[
n
].
maStr
)
);
if
(
aComp
==
rString
)
return
n
;
}
...
...
@@ -385,7 +398,7 @@ XubString ImplEntryList::GetEntryText( sal_uInt16 nPos ) const
sal_Bool
ImplEntryList
::
HasEntryImage
(
sal_uInt16
nPos
)
const
{
sal_Bool
bImage
=
sal_False
;
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
if
(
pImplEntry
)
bImage
=
!!
pImplEntry
->
maImage
;
return
bImage
;
...
...
@@ -396,7 +409,7 @@ sal_Bool ImplEntryList::HasEntryImage( sal_uInt16 nPos ) const
Image
ImplEntryList
::
GetEntryImage
(
sal_uInt16
nPos
)
const
{
Image
aImage
;
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
if
(
pImplEntry
)
aImage
=
pImplEntry
->
maImage
;
return
aImage
;
...
...
@@ -406,7 +419,7 @@ Image ImplEntryList::GetEntryImage( sal_uInt16 nPos ) const
void
ImplEntryList
::
SetEntryData
(
sal_uInt16
nPos
,
void
*
pNewData
)
{
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
if
(
pImplEntry
)
pImplEntry
->
mpUserData
=
pNewData
;
}
...
...
@@ -415,7 +428,7 @@ void ImplEntryList::SetEntryData( sal_uInt16 nPos, void* pNewData )
void
*
ImplEntryList
::
GetEntryData
(
sal_uInt16
nPos
)
const
{
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
return
pImplEntry
?
pImplEntry
->
mpUserData
:
NULL
;
}
...
...
@@ -423,7 +436,7 @@ void* ImplEntryList::GetEntryData( sal_uInt16 nPos ) const
void
ImplEntryList
::
SetEntryFlags
(
sal_uInt16
nPos
,
long
nFlags
)
{
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
if
(
pImplEntry
)
pImplEntry
->
mnFlags
=
nFlags
;
}
...
...
@@ -432,7 +445,7 @@ void ImplEntryList::SetEntryFlags( sal_uInt16 nPos, long nFlags )
long
ImplEntryList
::
GetEntryFlags
(
sal_uInt16
nPos
)
const
{
ImplEntryType
*
pImplEntry
=
(
ImplEntryType
*
)
List
::
GetObject
(
nPos
);
ImplEntryType
*
pImplEntry
=
GetEntry
(
nPos
);
return
pImplEntry
?
pImplEntry
->
mnFlags
:
0
;
}
...
...
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