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
51eb04a1
Kaydet (Commit)
51eb04a1
authored
Eki 25, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
basic: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I98c4ac860fbdb55a61f9be0e9d2d5f29fb849e05
üst
71f6aab0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
19 deletions
+20
-19
symtbl.cxx
basic/source/comp/symtbl.cxx
+17
-15
symtbl.hxx
basic/source/inc/symtbl.hxx
+3
-4
No files found.
basic/source/comp/symtbl.cxx
Dosyayı görüntüle @
51eb04a1
...
...
@@ -107,33 +107,33 @@ SbiSymDef* SbiSymPool::First()
SbiSymDef
*
SbiSymPool
::
Next
()
{
if
(
++
nCur
>=
aData
.
size
()
)
if
(
m_Data
.
size
()
<=
++
nCur
)
return
NULL
;
else
return
&
aData
[
nCur
]
;
return
m_Data
[
nCur
].
get
()
;
}
SbiSymDef
*
SbiSymPool
::
AddSym
(
const
OUString
&
rName
)
{
SbiSymDef
*
p
=
new
SbiSymDef
(
rName
);
p
->
nPos
=
a
Data
.
size
();
p
->
nPos
=
m_
Data
.
size
();
p
->
nId
=
rStrings
.
Add
(
rName
);
p
->
nProcId
=
nProcId
;
p
->
pIn
=
this
;
aData
.
insert
(
aData
.
begin
()
+
p
->
nPos
,
p
);
m_Data
.
insert
(
m_Data
.
begin
()
+
p
->
nPos
,
std
::
unique_ptr
<
SbiSymDef
>
(
p
)
);
return
p
;
}
SbiProcDef
*
SbiSymPool
::
AddProc
(
const
OUString
&
rName
)
{
SbiProcDef
*
p
=
new
SbiProcDef
(
pParser
,
rName
);
p
->
nPos
=
a
Data
.
size
();
p
->
nPos
=
m_
Data
.
size
();
p
->
nId
=
rStrings
.
Add
(
rName
);
// procs are always local
p
->
nProcId
=
0
;
p
->
pIn
=
this
;
aData
.
insert
(
aData
.
begin
()
+
p
->
nPos
,
p
);
m_Data
.
insert
(
m_Data
.
begin
()
+
p
->
nPos
,
std
::
unique_ptr
<
SbiProcDef
>
(
p
)
);
return
p
;
}
...
...
@@ -152,7 +152,7 @@ void SbiSymPool::Add( SbiSymDef* pDef )
return
;
}
pDef
->
nPos
=
a
Data
.
size
();
pDef
->
nPos
=
m_
Data
.
size
();
if
(
!
pDef
->
nId
)
{
// A unique name must be created in the string pool
...
...
@@ -172,17 +172,17 @@ void SbiSymPool::Add( SbiSymDef* pDef )
pDef
->
nProcId
=
nProcId
;
}
pDef
->
pIn
=
this
;
aData
.
insert
(
aData
.
begin
()
+
pDef
->
nPos
,
pDef
);
m_Data
.
insert
(
m_Data
.
begin
()
+
pDef
->
nPos
,
std
::
unique_ptr
<
SbiSymDef
>
(
pDef
)
);
}
}
SbiSymDef
*
SbiSymPool
::
Find
(
const
OUString
&
rName
)
{
sal_uInt16
nCount
=
a
Data
.
size
();
sal_uInt16
nCount
=
m_
Data
.
size
();
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
i
++
)
{
SbiSymDef
&
r
=
a
Data
[
nCount
-
i
-
1
];
SbiSymDef
&
r
=
*
m_
Data
[
nCount
-
i
-
1
];
if
(
(
!
r
.
nProcId
||
(
r
.
nProcId
==
nProcId
))
&&
(
r
.
aName
.
equalsIgnoreAsciiCase
(
rName
)))
{
...
...
@@ -204,13 +204,13 @@ SbiSymDef* SbiSymPool::Find( const OUString& rName )
SbiSymDef
*
SbiSymPool
::
Get
(
sal_uInt16
n
)
{
if
(
n
>=
aData
.
size
()
)
if
(
m_Data
.
size
()
<=
n
)
{
return
NULL
;
}
else
{
return
&
aData
[
n
]
;
return
m_Data
[
n
].
get
()
;
}
}
...
...
@@ -246,9 +246,9 @@ sal_uInt32 SbiSymPool::Reference( const OUString& rName )
void
SbiSymPool
::
CheckRefs
()
{
for
(
size_t
i
=
0
;
i
<
aData
.
size
();
i
++
)
for
(
size_t
i
=
0
;
i
<
m_Data
.
size
();
++
i
)
{
SbiSymDef
&
r
=
a
Data
[
i
];
SbiSymDef
&
r
=
*
m_
Data
[
i
];
if
(
!
r
.
IsDefined
()
)
{
pParser
->
Error
(
ERRCODE_BASIC_UNDEF_LABEL
,
r
.
GetName
()
);
...
...
@@ -459,7 +459,9 @@ void SbiProcDef::Match( SbiProcDef* pOld )
nPos
=
pOld
->
nPos
;
nId
=
pOld
->
nId
;
pIn
=
pOld
->
pIn
;
pIn
->
aData
.
replace
(
nPos
,
this
).
release
();
std
::
unique_ptr
<
SbiSymDef
>
tmp
(
this
);
std
::
swap
(
pIn
->
m_Data
[
nPos
],
tmp
);
tmp
.
release
();
}
delete
pOld
;
}
...
...
basic/source/inc/symtbl.hxx
Dosyayı görüntüle @
51eb04a1
...
...
@@ -20,8 +20,8 @@
#ifndef INCLUDED_BASIC_SOURCE_INC_SYMTBL_HXX
#define INCLUDED_BASIC_SOURCE_INC_SYMTBL_HXX
#include <memory>
#include <vector>
#include <boost/ptr_container/ptr_vector.hpp>
class
SbiConstDef
;
class
SbiParser
;
...
...
@@ -54,8 +54,7 @@ class SbiSymPool {
friend
class
SbiProcDef
;
protected
:
SbiStringPool
&
rStrings
;
boost
::
ptr_vector
<
SbiSymDef
>
aData
;
std
::
vector
<
std
::
unique_ptr
<
SbiSymDef
>>
m_Data
;
SbiSymPool
*
pParent
;
SbiParser
*
pParser
;
SbiSymScope
eScope
;
...
...
@@ -67,7 +66,7 @@ public:
void
SetParent
(
SbiSymPool
*
p
)
{
pParent
=
p
;
}
void
SetProcId
(
short
n
)
{
nProcId
=
n
;
}
sal_uInt16
GetSize
()
const
{
return
a
Data
.
size
();
}
sal_uInt16
GetSize
()
const
{
return
m_
Data
.
size
();
}
SbiSymScope
GetScope
()
const
{
return
eScope
;
}
void
SetScope
(
SbiSymScope
s
)
{
eScope
=
s
;
}
SbiParser
*
GetParser
()
{
return
pParser
;
}
...
...
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