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
263d7325
Kaydet (Commit)
263d7325
authored
Ock 16, 2018
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:useuniqueptr in SbModule
Change-Id: I20525bd69c91ff35c9e569525a0d4556bc184982
üst
9653ac69
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
33 deletions
+24
-33
sb.cxx
basic/source/classes/sb.cxx
+2
-2
sbxmod.cxx
basic/source/classes/sbxmod.cxx
+12
-17
codegen.cxx
basic/source/comp/codegen.cxx
+3
-7
runtime.cxx
basic/source/runtime/runtime.cxx
+3
-4
sbmod.hxx
include/basic/sbmod.hxx
+4
-3
No files found.
basic/source/classes/sb.cxx
Dosyayı görüntüle @
263d7325
...
...
@@ -626,8 +626,8 @@ SbClassModuleObject::SbClassModuleObject( SbModule* pClassModule )
{
aOUSource
=
pClassModule
->
aOUSource
;
aComment
=
pClassModule
->
aComment
;
pImage
=
pClassModule
->
pImage
;
pBreaks
=
pClassModule
->
pBreaks
;
pImage
=
std
::
move
(
pClassModule
->
pImage
)
;
pBreaks
=
std
::
move
(
pClassModule
->
pBreaks
)
;
SetClassName
(
pClassModule
->
GetName
()
);
...
...
basic/source/classes/sbxmod.cxx
Dosyayı görüntüle @
263d7325
...
...
@@ -461,9 +461,9 @@ SbModule::SbModule( const OUString& rName, bool bVBACompat )
SbModule
::~
SbModule
()
{
SAL_INFO
(
"basic"
,
"Module named "
<<
GetName
()
<<
" is destructing"
);
delete
pImage
;
delete
pBreaks
;
delete
pClassData
;
pImage
.
reset
()
;
pBreaks
.
reset
()
;
pClassData
.
reset
()
;
mxWrapper
=
nullptr
;
}
...
...
@@ -492,7 +492,7 @@ const SbxObject* SbModule::FindType( const OUString& aTypeName ) const
void
SbModule
::
StartDefinitions
()
{
delete
pImage
;
pImage
=
nullptr
;
pImage
.
reset
()
;
if
(
pClassData
)
pClassData
->
clear
();
...
...
@@ -642,7 +642,7 @@ void SbModule::EndDefinitions( bool bNewState )
void
SbModule
::
Clear
()
{
delete
pImage
;
pImage
=
nullptr
;
pImage
.
reset
()
;
if
(
pClassData
)
pClassData
->
clear
();
SbxObject
::
Clear
();
...
...
@@ -1524,7 +1524,7 @@ bool SbModule::SetBP( sal_uInt16 nLine )
if
(
!
IsBreakable
(
nLine
)
)
return
false
;
if
(
!
pBreaks
)
pBreaks
=
new
SbiBreakpoints
;
pBreaks
.
reset
(
new
SbiBreakpoints
)
;
size_t
i
;
for
(
i
=
0
;
i
<
pBreaks
->
size
();
i
++
)
{
...
...
@@ -1562,8 +1562,7 @@ bool SbModule::ClearBP( sal_uInt16 nLine )
}
if
(
pBreaks
->
empty
()
)
{
delete
pBreaks
;
pBreaks
=
nullptr
;
pBreaks
.
reset
();
}
}
return
bRes
;
...
...
@@ -1571,15 +1570,14 @@ bool SbModule::ClearBP( sal_uInt16 nLine )
void
SbModule
::
ClearAllBP
()
{
delete
pBreaks
;
pBreaks
=
nullptr
;
pBreaks
.
reset
();
}
void
SbModule
::
fixUpMethodStart
(
bool
bCvtToLegacy
,
SbiImage
*
pImg
)
const
{
if
(
!
pImg
)
pImg
=
pImage
;
pImg
=
pImage
.
get
()
;
for
(
sal_uInt32
i
=
0
;
i
<
pMethods
->
Count
();
i
++
)
{
SbMethod
*
pMeth
=
dynamic_cast
<
SbMethod
*>
(
pMethods
->
Get
(
static_cast
<
sal_uInt16
>
(
i
)
)
);
...
...
@@ -1606,18 +1604,17 @@ bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
rStrm
.
ReadUChar
(
bImage
);
if
(
bImage
)
{
SbiImage
*
p
=
new
SbiImage
;
std
::
unique_ptr
<
SbiImage
>
p
(
new
SbiImage
)
;
sal_uInt32
nImgVer
=
0
;
if
(
!
p
->
Load
(
rStrm
,
nImgVer
)
)
{
delete
p
;
return
false
;
}
// If the image is in old format, we fix up the method start offsets
if
(
nImgVer
<
B_EXT_IMG_VERSION
)
{
fixUpMethodStart
(
false
,
p
);
fixUpMethodStart
(
false
,
p
.
get
()
);
p
->
ReleaseLegacyBuffer
();
}
aComment
=
p
->
aComment
;
...
...
@@ -1629,15 +1626,13 @@ bool SbModule::LoadData( SvStream& rStrm, sal_uInt16 nVer )
if
(
nVer
==
1
)
{
SetSource32
(
p
->
aOUSource
);
delete
p
;
}
else
pImage
=
p
;
pImage
=
std
::
move
(
p
)
;
}
else
{
SetSource32
(
p
->
aOUSource
);
delete
p
;
}
}
return
true
;
...
...
basic/source/comp/codegen.cxx
Dosyayı görüntüle @
263d7325
...
...
@@ -133,7 +133,7 @@ void SbiCodeGen::Save()
if
(
pParser
->
IsCodeCompleting
()
)
return
;
SbiImage
*
p
=
new
SbiImage
;
std
::
unique_ptr
<
SbiImage
>
p
(
new
SbiImage
)
;
rMod
.
StartDefinitions
();
// OPTION BASE-Value:
p
->
nDimBase
=
pParser
->
nBase
;
...
...
@@ -150,7 +150,7 @@ void SbiCodeGen::Save()
nIfaceCount
=
pParser
->
aIfaceVector
.
size
();
if
(
!
rMod
.
pClassData
)
rMod
.
pClassData
=
new
SbClassData
;
rMod
.
pClassData
.
reset
(
new
SbClassData
)
;
if
(
nIfaceCount
)
{
for
(
int
i
=
0
;
i
<
nIfaceCount
;
i
++
)
...
...
@@ -375,11 +375,7 @@ void SbiCodeGen::Save()
}
if
(
!
p
->
IsError
()
)
{
rMod
.
pImage
=
p
;
}
else
{
delete
p
;
rMod
.
pImage
=
std
::
move
(
p
);
}
rMod
.
EndDefinitions
();
}
...
...
basic/source/runtime/runtime.cxx
Dosyayı görüntüle @
263d7325
...
...
@@ -561,7 +561,7 @@ SbMethod* SbiInstance::GetCaller( sal_uInt16 nLevel )
SbiRuntime
::
SbiRuntime
(
SbModule
*
pm
,
SbMethod
*
pe
,
sal_uInt32
nStart
)
:
rBasic
(
*
static_cast
<
StarBASIC
*>
(
pm
->
pParent
)
),
pInst
(
GetSbData
()
->
pInst
),
pMod
(
pm
),
pMeth
(
pe
),
pImg
(
pMod
->
pImage
),
mpExtCaller
(
nullptr
),
m_nLastTime
(
0
)
pMod
(
pm
),
pMeth
(
pe
),
pImg
(
pMod
->
pImage
.
get
()
),
mpExtCaller
(
nullptr
),
m_nLastTime
(
0
)
{
nFlags
=
pe
?
pe
->
GetDebugFlags
()
:
BasicDebugFlags
::
NONE
;
pIosys
=
pInst
->
GetIoSystem
();
...
...
@@ -3149,10 +3149,9 @@ bool SbiRuntime::implIsClass( SbxObject const * pObj, const OUString& aClass )
{
OUString
aObjClass
=
pObj
->
GetClassName
();
SbModule
*
pClassMod
=
GetSbData
()
->
pClassFac
->
FindClass
(
aObjClass
);
SbClassData
*
pClassData
;
if
(
pClassMod
&&
(
pClassData
=
pClassMod
->
pClassData
)
!=
nullptr
)
if
(
pClassMod
&&
pClassMod
->
pClassData
)
{
SbxVariable
*
pClassVar
=
pClassData
->
mxIfaces
->
Find
(
aClass
,
SbxClassType
::
DontCare
);
SbxVariable
*
pClassVar
=
pClass
Mod
->
pClass
Data
->
mxIfaces
->
Find
(
aClass
,
SbxClassType
::
DontCare
);
bRet
=
(
pClassVar
!=
nullptr
);
}
}
...
...
include/basic/sbmod.hxx
Dosyayı görüntüle @
263d7325
...
...
@@ -28,6 +28,7 @@
#include <rtl/ustring.hxx>
#include <vector>
#include <deque>
#include <memory>
#include <basic/basicdllapi.h>
#include <basic/codecompletecache.hxx>
...
...
@@ -62,9 +63,9 @@ protected:
css
::
uno
::
Reference
<
css
::
script
::
XInvocation
>
mxWrapper
;
OUString
aOUSource
;
OUString
aComment
;
SbiImage
*
pImage
;
// the Image
SbiBreakpoints
*
pBreaks
;
// Breakpoints
SbClassData
*
pClassData
;
std
::
unique_ptr
<
SbiImage
>
pImage
;
// the Image
std
::
unique_ptr
<
SbiBreakpoints
>
pBreaks
;
// Breakpoints
std
::
unique_ptr
<
SbClassData
>
pClassData
;
bool
mbVBACompat
;
sal_Int32
mnType
;
SbxObjectRef
pDocObject
;
// an impl object ( used by Document Modules )
...
...
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