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
44853cc8
Kaydet (Commit)
44853cc8
authored
Ock 16, 2018
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
loplugin:useuniqeptr in SbxVariable
Change-Id: I788ec594589d9708e12db83a7371b5a8d9fed38c
üst
000fa4c4
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
21 deletions
+15
-21
sbxmod.cxx
basic/source/classes/sbxmod.cxx
+6
-7
sbxvar.cxx
basic/source/sbx/sbxvar.cxx
+7
-12
sbxvar.hxx
include/basic/sbxvar.hxx
+2
-2
No files found.
basic/source/classes/sbxmod.cxx
Dosyayı görüntüle @
44853cc8
...
...
@@ -2080,7 +2080,7 @@ ErrCode SbMethod::Call( SbxValue* pRet, SbxVariable* pCaller )
// #100883 Own Broadcast for SbMethod
void
SbMethod
::
Broadcast
(
SfxHintId
nHintId
)
{
if
(
pCst
&&
!
IsSet
(
SbxFlagBits
::
NoBroadcast
)
)
if
(
mpBroadcaster
&&
!
IsSet
(
SbxFlagBits
::
NoBroadcast
)
)
{
// Because the method could be called from outside, test here once again
// the authorisation
...
...
@@ -2095,8 +2095,7 @@ void SbMethod::Broadcast( SfxHintId nHintId )
pMod
->
Compile
();
// Block broadcasts while creating new method
SfxBroadcaster
*
pSave
=
pCst
;
pCst
=
nullptr
;
std
::
unique_ptr
<
SfxBroadcaster
>
pSaveBroadcaster
=
std
::
move
(
mpBroadcaster
);
SbMethod
*
pThisCopy
=
new
SbMethod
(
*
this
);
SbMethodRef
xHolder
=
pThisCopy
;
if
(
mpPar
.
is
()
)
...
...
@@ -2108,14 +2107,14 @@ void SbMethod::Broadcast( SfxHintId nHintId )
SetParameters
(
nullptr
);
}
pCst
=
pSave
;
pSave
->
Broadcast
(
SbxHint
(
nHintId
,
pThisCopy
)
);
mpBroadcaster
=
std
::
move
(
pSaveBroadcaster
)
;
mpBroadcaster
->
Broadcast
(
SbxHint
(
nHintId
,
pThisCopy
)
);
SbxFlagBits
nSaveFlags
=
GetFlags
();
SetFlag
(
SbxFlagBits
::
ReadWrite
);
p
Cst
=
nullptr
;
p
SaveBroadcaster
=
std
::
move
(
mpBroadcaster
)
;
Put
(
pThisCopy
->
GetValues_Impl
()
);
pCst
=
pSave
;
mpBroadcaster
=
std
::
move
(
pSaveBroadcaster
)
;
SetFlags
(
nSaveFlags
);
}
}
...
...
basic/source/sbx/sbxvar.cxx
Dosyayı görüntüle @
44853cc8
...
...
@@ -56,7 +56,6 @@ class SbxVariableImpl
SbxVariable
::
SbxVariable
()
:
SbxValue
()
{
pCst
=
nullptr
;
pParent
=
nullptr
;
nUserData
=
0
;
nHash
=
0
;
...
...
@@ -78,7 +77,6 @@ SbxVariable::SbxVariable( const SbxVariable& r )
}
#endif
}
pCst
=
nullptr
;
if
(
r
.
CanRead
()
)
{
pParent
=
r
.
pParent
;
...
...
@@ -111,7 +109,6 @@ void SbxEnsureParentVariable::SetParent(SbxObject* p)
SbxVariable
::
SbxVariable
(
SbxDataType
t
)
:
SbxValue
(
t
)
{
pCst
=
nullptr
;
pParent
=
nullptr
;
nUserData
=
0
;
nHash
=
0
;
...
...
@@ -125,18 +122,18 @@ SbxVariable::~SbxVariable()
removeDimAsNewRecoverItem
(
this
);
}
#endif
delete
pCst
;
mpBroadcaster
.
reset
()
;
}
// Broadcasting
SfxBroadcaster
&
SbxVariable
::
GetBroadcaster
()
{
if
(
!
pCst
)
if
(
!
mpBroadcaster
)
{
pCst
=
new
SfxBroadcaster
;
mpBroadcaster
.
reset
(
new
SfxBroadcaster
)
;
}
return
*
pCst
;
return
*
mpBroadcaster
;
}
SbxArray
*
SbxVariable
::
GetParameters
()
const
...
...
@@ -150,7 +147,7 @@ SbxArray* SbxVariable::GetParameters() const
void
SbxVariable
::
Broadcast
(
SfxHintId
nHintId
)
{
if
(
pCst
&&
!
IsSet
(
SbxFlagBits
::
NoBroadcast
)
)
if
(
mpBroadcaster
&&
!
IsSet
(
SbxFlagBits
::
NoBroadcast
)
)
{
// Because the method could be called from outside, check the
// rights here again
...
...
@@ -174,8 +171,7 @@ void SbxVariable::Broadcast( SfxHintId nHintId )
SbxVariableRef
aBroadcastGuard
(
this
);
// Avoid further broadcasting
SfxBroadcaster
*
pSave
=
pCst
;
pCst
=
nullptr
;
std
::
unique_ptr
<
SfxBroadcaster
>
pSave
=
std
::
move
(
mpBroadcaster
);
SbxFlagBits
nSaveFlags
=
GetFlags
();
SetFlag
(
SbxFlagBits
::
ReadWrite
);
if
(
mpPar
.
is
()
)
...
...
@@ -184,8 +180,7 @@ void SbxVariable::Broadcast( SfxHintId nHintId )
mpPar
->
GetRef
(
0
)
=
this
;
}
pSave
->
Broadcast
(
SbxHint
(
nHintId
,
this
)
);
delete
pCst
;
// who knows already, onto which thoughts someone comes?
pCst
=
pSave
;
mpBroadcaster
=
std
::
move
(
pSave
);
SetFlags
(
nSaveFlags
);
}
}
...
...
include/basic/sbxvar.hxx
Dosyayı görüntüle @
44853cc8
...
...
@@ -224,7 +224,7 @@ class BASIC_DLLPUBLIC SbxVariable : public SbxValue
friend
class
SbMethod
;
std
::
unique_ptr
<
SbxVariableImpl
>
mpImpl
;
// Impl data
SfxBroadcaster
*
pCst
;
// Broadcaster, if needed
std
::
unique_ptr
<
SfxBroadcaster
>
mpBroadcaster
;
// Broadcaster, if needed
OUString
maName
;
// Name, if available
SbxArrayRef
mpPar
;
// Parameter-Array, if set
sal_uInt16
nHash
;
// Hash-ID for search
...
...
@@ -268,7 +268,7 @@ public:
// Sfx-Broadcasting-Support:
// Due to data reduction and better DLL-hierarchy currently via casting
SfxBroadcaster
&
GetBroadcaster
();
bool
IsBroadcaster
()
const
{
return
pCst
!=
nullptr
;
}
bool
IsBroadcaster
()
const
{
return
mpBroadcaster
!=
nullptr
;
}
virtual
void
Broadcast
(
SfxHintId
nHintId
)
override
;
const
SbxObject
*
GetParent
()
const
{
return
pParent
;
}
...
...
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