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
b6b32516
Kaydet (Commit)
b6b32516
authored
Eki 05, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: replace boost::ptr_vector with std::vector
Change-Id: If7b9251a1b3f953a7386d621da40b0c14bbf61be
üst
63b0a1fe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
23 deletions
+23
-23
swlbox.cxx
sw/source/uibase/cctrl/swlbox.cxx
+17
-18
swlbox.hxx
sw/source/uibase/inc/swlbox.hxx
+6
-5
No files found.
sw/source/uibase/cctrl/swlbox.cxx
Dosyayı görüntüle @
b6b32516
...
...
@@ -58,8 +58,7 @@ void SwComboBox::Init()
sal_Int32
nSize
=
GetEntryCount
();
for
(
sal_Int32
i
=
0
;
i
<
nSize
;
++
i
)
{
SwBoxEntry
*
pTmp
=
new
SwBoxEntry
(
ComboBox
::
GetEntry
(
i
),
i
);
aEntryLst
.
push_back
(
pTmp
);
m_EntryList
.
push_back
(
SwBoxEntry
(
ComboBox
::
GetEntry
(
i
),
i
));
}
}
...
...
@@ -70,7 +69,7 @@ SwComboBox::~SwComboBox()
void
SwComboBox
::
InsertSwEntry
(
const
SwBoxEntry
&
rEntry
)
{
InsertSorted
(
new
SwBoxEntry
(
rEntry
)
);
InsertSorted
(
rEntry
);
}
sal_Int32
SwComboBox
::
InsertEntry
(
const
OUString
&
rStr
,
sal_Int32
)
...
...
@@ -81,23 +80,23 @@ sal_Int32 SwComboBox::InsertEntry(const OUString& rStr, sal_Int32)
void
SwComboBox
::
RemoveEntryAt
(
sal_Int32
const
nPos
)
{
if
(
nPos
<
0
||
static_cast
<
size_t
>
(
nPos
)
>=
aEntryL
st
.
size
())
if
(
nPos
<
0
||
static_cast
<
size_t
>
(
nPos
)
>=
m_EntryLi
st
.
size
())
return
;
// Remove old element
SwBoxEntry
*
pEntry
=
&
aEntryL
st
[
nPos
];
SwBoxEntry
const
&
rEntry
=
m_EntryLi
st
[
nPos
];
ComboBox
::
RemoveEntryAt
(
nPos
);
// Don't add new entries to the list
if
(
pEntry
->
bNew
)
if
(
rEntry
.
bNew
)
{
aEntryLst
.
erase
(
aEntryL
st
.
begin
()
+
nPos
);
m_EntryList
.
erase
(
m_EntryLi
st
.
begin
()
+
nPos
);
}
else
{
// add to DelEntryLst
aDelEntryLst
.
transfer
(
aDelEntryLst
.
end
(),
aEntryLst
.
begin
()
+
nPos
,
aEntryLst
);
m_DelEntryList
.
push_back
(
m_EntryList
[
nPos
]);
m_EntryList
.
erase
(
m_EntryList
.
begin
()
+
nPos
);
}
}
...
...
@@ -108,30 +107,30 @@ sal_Int32 SwComboBox::GetSwEntryPos(const SwBoxEntry& rEntry) const
const
SwBoxEntry
&
SwComboBox
::
GetSwEntry
(
sal_Int32
const
nPos
)
const
{
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
aEntryL
st
.
size
())
return
aEntryL
st
[
nPos
];
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
m_EntryLi
st
.
size
())
return
m_EntryLi
st
[
nPos
];
return
aDefault
;
}
sal_Int32
SwComboBox
::
GetRemovedCount
()
const
{
return
static_cast
<
sal_Int32
>
(
aDelEntryL
st
.
size
());
return
static_cast
<
sal_Int32
>
(
m_DelEntryLi
st
.
size
());
}
const
SwBoxEntry
&
SwComboBox
::
GetRemovedEntry
(
sal_Int32
nPos
)
const
{
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
aDelEntryL
st
.
size
())
return
aDelEntryL
st
[
nPos
];
if
(
0
<=
nPos
&&
static_cast
<
size_t
>
(
nPos
)
<
m_DelEntryLi
st
.
size
())
return
m_DelEntryLi
st
[
nPos
];
return
aDefault
;
}
void
SwComboBox
::
InsertSorted
(
SwBoxEntry
*
p
Entry
)
void
SwComboBox
::
InsertSorted
(
SwBoxEntry
const
&
r
Entry
)
{
ComboBox
::
InsertEntry
(
pEntry
->
aName
);
sal_Int32
nPos
=
ComboBox
::
GetEntryPos
(
pEntry
->
aName
);
aEntryLst
.
insert
(
aEntryLst
.
begin
()
+
nPos
,
pEntry
);
ComboBox
::
InsertEntry
(
rEntry
.
aName
);
sal_Int32
nPos
=
ComboBox
::
GetEntryPos
(
rEntry
.
aName
);
m_EntryList
.
insert
(
m_EntryList
.
begin
()
+
nPos
,
rEntry
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/source/uibase/inc/swlbox.hxx
Dosyayı görüntüle @
b6b32516
...
...
@@ -22,12 +22,13 @@
#include <vcl/lstbox.hxx>
#include <vcl/combobox.hxx>
#include "swdllapi.h"
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
class
SwBoxEntry
;
namespace
vcl
{
class
Window
;
}
typedef
boost
::
ptr_vector
<
SwBoxEntry
>
SwEntryL
st
;
typedef
std
::
vector
<
SwBoxEntry
>
SwEntryLi
st
;
class
SW_DLLPUBLIC
SwBoxEntry
{
...
...
@@ -50,11 +51,11 @@ public:
// for combo boxes
class
SW_DLLPUBLIC
SwComboBox
:
public
ComboBox
{
SwEntryL
st
aEntryL
st
;
SwEntryL
st
aDelEntryL
st
;
SwEntryL
ist
m_EntryLi
st
;
SwEntryL
ist
m_DelEntryLi
st
;
SwBoxEntry
aDefault
;
SAL_DLLPRIVATE
void
InsertSorted
(
SwBoxEntry
*
p
Entry
);
SAL_DLLPRIVATE
void
InsertSorted
(
SwBoxEntry
const
&
r
Entry
);
SAL_DLLPRIVATE
void
Init
();
public
:
...
...
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