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
5a9e9c8a
Kaydet (Commit)
5a9e9c8a
authored
Eyl 26, 2013
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
convert open-coded array into std::vector
Change-Id: I067e1ddcf2c46ac55ed2c5b92db8edb19dc6a0f1
üst
ea2c80bd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
61 deletions
+27
-61
hangulhanjadlg.cxx
cui/source/dialogs/hangulhanjadlg.cxx
+27
-61
No files found.
cui/source/dialogs/hangulhanjadlg.cxx
Dosyayı görüntüle @
5a9e9c8a
...
...
@@ -1239,15 +1239,15 @@ namespace svx
{
private
:
protected
:
sal_uInt16
m_nSize
;
OUString
**
m_ppElements
;
std
::
vector
<
OUString
*>
m_vElements
;
sal_uInt16
m_nNumOfEntries
;
// index of the internal iterator, used for First() and Next() methods
sal_uInt16
m_nAct
;
const
OUString
*
_Next
(
void
);
public
:
SuggestionList
(
sal_uInt16
_nNumOfElements
);
virtual
~
SuggestionList
();
SuggestionList
();
~
SuggestionList
();
bool
Set
(
const
OUString
&
_rElement
,
sal_uInt16
_nNumOfElement
);
bool
Reset
(
sal_uInt16
_nNumOfElement
);
...
...
@@ -1257,51 +1257,30 @@ namespace svx
const
OUString
*
First
(
void
);
const
OUString
*
Next
(
void
);
inline
sal_uInt16
GetCount
(
void
)
const
;
inline
sal_uInt16
GetCount
(
void
)
const
{
return
m_nNumOfEntries
;
}
};
inline
sal_uInt16
SuggestionList
::
GetCount
(
void
)
const
SuggestionList
::
SuggestionList
()
:
m_vElements
(
MAXNUM_SUGGESTIONS
,
NULL
)
{
return
m_nNumOfEntries
;
}
SuggestionList
::
SuggestionList
(
sal_uInt16
_nNumOfElements
)
{
if
(
!
_nNumOfElements
)
_nNumOfElements
=
1
;
m_nSize
=
_nNumOfElements
;
m_ppElements
=
new
OUString
*
[
m_nSize
];
m_nAct
=
m_nNumOfEntries
=
0
;
OUString
**
ppNull
=
m_ppElements
;
sal_uInt16
n
=
_nNumOfElements
;
while
(
n
)
{
*
ppNull
=
NULL
;
++
ppNull
;
--
n
;
}
}
SuggestionList
::~
SuggestionList
()
{
Clear
();
delete
[]
m_ppElements
;
}
bool
SuggestionList
::
Set
(
const
OUString
&
_rElement
,
sal_uInt16
_nNumOfElement
)
{
bool
bRet
=
_nNumOfElement
<
m_
nSize
;
bool
bRet
=
_nNumOfElement
<
m_
vElements
.
size
()
;
if
(
bRet
)
{
OUString
**
ppElem
=
m_ppElements
+
_nNumOfElement
;
if
(
*
ppElem
)
**
ppElem
=
_rElement
;
if
(
m_vElements
[
_nNumOfElement
]
!=
NULL
)
*
(
m_vElements
[
_nNumOfElement
])
=
_rElement
;
else
{
*
ppElem
=
new
OUString
(
_rElement
);
m_vElements
[
_nNumOfElement
]
=
new
OUString
(
_rElement
);
++
m_nNumOfEntries
;
}
}
...
...
@@ -1311,14 +1290,13 @@ namespace svx
bool
SuggestionList
::
Reset
(
sal_uInt16
_nNumOfElement
)
{
bool
bRet
=
_nNumOfElement
<
m_
nSize
;
bool
bRet
=
_nNumOfElement
<
m_
vElements
.
size
()
;
if
(
bRet
)
{
OUString
**
ppElem
=
m_ppElements
+
_nNumOfElement
;
if
(
*
ppElem
)
if
(
m_vElements
[
_nNumOfElement
]
!=
NULL
)
{
delete
*
ppElem
;
*
ppElem
=
NULL
;
delete
m_vElements
[
_nNumOfElement
]
;
m_vElements
[
_nNumOfElement
]
=
NULL
;
--
m_nNumOfEntries
;
}
}
...
...
@@ -1328,33 +1306,21 @@ namespace svx
const
OUString
*
SuggestionList
::
Get
(
sal_uInt16
_nNumOfElement
)
const
{
const
OUString
*
pRet
;
if
(
_nNumOfElement
<
m_nSize
)
pRet
=
m_ppElements
[
_nNumOfElement
];
else
pRet
=
NULL
;
return
pRet
;
if
(
_nNumOfElement
<
m_vElements
.
size
())
return
m_vElements
[
_nNumOfElement
];
return
NULL
;
}
void
SuggestionList
::
Clear
(
void
)
{
if
(
m_nNumOfEntries
)
{
OUString
**
ppDel
=
m_ppElements
;
sal_uInt16
nCnt
=
m_nSize
;
while
(
nCnt
)
{
if
(
*
ppDel
)
for
(
std
::
vector
<
OUString
*>::
iterator
it
=
m_vElements
.
begin
();
it
!=
m_vElements
.
end
();
++
it
)
if
(
*
it
!=
NULL
)
{
delete
*
ppDel
;
*
ppDel
=
NULL
;
}
++
ppDel
;
--
nCnt
;
}
delete
*
it
;
*
it
=
NULL
;
}
m_nNumOfEntries
=
m_nAct
=
0
;
}
...
...
@@ -1363,9 +1329,9 @@ namespace svx
const
OUString
*
SuggestionList
::
_Next
(
void
)
{
const
OUString
*
pRet
=
NULL
;
while
(
m_nAct
<
m_
nSize
&&
!
pRet
)
while
(
m_nAct
<
m_
vElements
.
size
()
&&
!
pRet
)
{
pRet
=
m_
pp
Elements
[
m_nAct
];
pRet
=
m_
v
Elements
[
m_nAct
];
if
(
!
pRet
)
++
m_nAct
;
}
...
...
@@ -1712,7 +1678,7 @@ namespace svx
if
(
nCnt
)
{
if
(
!
m_pSuggestions
)
m_pSuggestions
=
new
SuggestionList
(
MAXNUM_SUGGESTIONS
)
;
m_pSuggestions
=
new
SuggestionList
;
const
OUString
*
pSugg
=
aEntries
.
getConstArray
();
sal_uInt32
n
=
0
;
...
...
@@ -1759,7 +1725,7 @@ namespace svx
{
//set suggestion
if
(
!
m_pSuggestions
)
m_pSuggestions
=
new
SuggestionList
(
MAXNUM_SUGGESTIONS
)
;
m_pSuggestions
=
new
SuggestionList
;
m_pSuggestions
->
Set
(
aTxt
,
nEntryNum
);
}
...
...
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