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
9378fc5d
Kaydet (Commit)
9378fc5d
authored
Mar 13, 2015
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
use sw::Ring<>
Change-Id: I1ad4425f557a52dec4e9b068995585b15f61466f
üst
5a0d2a4e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
35 deletions
+17
-35
calbck.hxx
sw/inc/calbck.hxx
+2
-6
calbck.cxx
sw/source/core/attr/calbck.cxx
+15
-29
No files found.
sw/inc/calbck.hxx
Dosyayı görüntüle @
9378fc5d
...
...
@@ -23,6 +23,7 @@
#include <tools/rtti.hxx>
#include "swdllapi.h"
#include <boost/noncopyable.hpp>
#include <ring.hxx>
class
SwModify
;
class
SwClientIter
;
...
...
@@ -202,7 +203,7 @@ protected:
virtual
void
SwClientNotify
(
const
SwModify
&
rModify
,
const
SfxHint
&
rHint
)
SAL_OVERRIDE
;
};
class
SwClientIter
class
SwClientIter
:
public
sw
::
Ring
<
SwClientIter
>
{
friend
SwClient
*
SwModify
::
Remove
(
SwClient
*
);
///< for pointer adjustments
friend
void
SwModify
::
Add
(
SwClient
*
pDepend
);
///< for pointer adjustments
...
...
@@ -217,11 +218,6 @@ class SwClientIter
// this is necessary because iteration requires access to members of the current object
SwClient
*
pDelNext
;
// SwClientIter objects are tracked in linked list so that they can react
// when the current (pAct) or marked down (pDelNext) SwClient is removed
// from its SwModify
SwClientIter
*
pNxtIter
;
// iterator can be limited to return only SwClient objects of a certain type
TypeId
aSrchId
;
...
...
sw/source/core/attr/calbck.cxx
Dosyayı görüntüle @
9378fc5d
...
...
@@ -206,11 +206,10 @@ void SwModify::Add( SwClient* pDepend )
if
(
pDepend
->
pRegisteredIn
!=
this
)
{
#if OSL_DEBUG_LEVEL > 0
SwClientIter
*
pTmp
=
pClientIters
;
while
(
pTmp
)
if
(
pClientIters
)
{
OSL_ENSURE
(
&
pTmp
->
GetModify
()
!=
pRoot
,
"Client added to active ClientIter"
);
pTmp
=
pTmp
->
pNxtIter
;
for
(
auto
&
rIter
:
pClientIters
->
GetRingContainer
())
OSL_ENSURE
(
&
rIter
.
GetModify
()
!=
pRoot
,
"Client added to active ClientIter"
)
;
}
#endif
// deregister new client in case it is already registered elsewhere
...
...
@@ -259,18 +258,18 @@ SwClient* SwModify::Remove( SwClient* pDepend )
pR
->
m_pLeft
=
pL
;
// update ClientIters
SwClientIter
*
pTmp
=
pClientIters
;
while
(
pTmp
)
if
(
pClientIters
)
{
if
(
pTmp
->
pAct
==
pDepend
||
pTmp
->
pDelNext
==
pDepend
)
for
(
auto
&
rIter
:
pClientIters
->
GetRingContainer
()
)
{
// if object being removed is the current or next object in an
// iterator, advance this iterator
pTmp
->
pDelNext
=
static_cast
<
SwClient
*>
(
pR
);
if
(
rIter
.
pAct
==
pDepend
||
rIter
.
pDelNext
==
pDepend
)
{
// if object being removed is the current or next object in an
// iterator, advance this iterator
rIter
.
pDelNext
=
static_cast
<
SwClient
*>
(
pR
);
}
}
pTmp
=
pTmp
->
pNxtIter
;
}
pDepend
->
m_pLeft
=
nullptr
;
pDepend
->
m_pRight
=
nullptr
;
}
...
...
@@ -365,32 +364,19 @@ bool SwDepend::GetInfo( SfxPoolItem& rInfo ) const
SwClientIter
::
SwClientIter
(
const
SwModify
&
rModify
)
:
rRoot
(
rModify
)
,
pNxtIter
(
nullptr
)
,
aSrchId
(
nullptr
)
{
if
(
pClientIters
)
pNxtIter
=
pClientIters
;
MoveTo
(
pClientIters
);
pClientIters
=
this
;
pAct
=
pDelNext
=
const_cast
<
SwClient
*>
(
rRoot
.
GetDepends
());
}
SwClientIter
::~
SwClientIter
()
{
assert
(
pClientIters
);
// reorganize list of ClientIters
if
(
pClientIters
==
this
)
pClientIters
=
pNxtIter
;
else
{
SwClientIter
*
pTmp
=
pClientIters
;
while
(
pTmp
->
pNxtIter
!=
this
)
{
assert
(
pTmp
);
pTmp
=
pTmp
->
pNxtIter
;
}
pTmp
->
pNxtIter
=
pNxtIter
;
}
if
(
pClientIters
==
this
)
pClientIters
=
unique
()
?
nullptr
:
GetNextInRing
();
MoveTo
(
nullptr
);
}
SwClient
*
SwClientIter
::
operator
++
()
...
...
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