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
7902e30a
Kaydet (Commit)
7902e30a
authored
Ara 01, 2014
tarafından
Bjoern Michaelsen
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
move Ring to sw::Ring
Change-Id: I3109185f747b821ee94aae5c58f86768ca30713a
üst
6172730c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
109 additions
and
106 deletions
+109
-106
pam.hxx
sw/inc/pam.hxx
+1
-1
ring.hxx
sw/inc/ring.hxx
+104
-101
viewsh.hxx
sw/inc/viewsh.hxx
+1
-1
uwriter.cxx
sw/qa/core/uwriter.cxx
+2
-2
doccomp.cxx
sw/source/core/doc/doccomp.cxx
+1
-1
No files found.
sw/inc/pam.hxx
Dosyayı görüntüle @
7902e30a
...
...
@@ -155,7 +155,7 @@ void _InitPam();
class
SwPaM
;
/// PaM is Point and Mark: a selection of the document model.
class
SW_DLLPUBLIC
SwPaM
:
public
Ring
<
SwPaM
>
class
SW_DLLPUBLIC
SwPaM
:
public
sw
::
Ring
<
SwPaM
>
{
SwPosition
m_Bound1
;
SwPosition
m_Bound2
;
...
...
sw/inc/ring.hxx
Dosyayı görüntüle @
7902e30a
...
...
@@ -24,122 +24,125 @@
#include <boost/iterator/iterator_facade.hpp>
#include <boost/intrusive/circular_list_algorithms.hpp>
class
Ring_node_traits
;
template
<
class
T
>
class
RingIterator
;
template
<
class
T
>
class
SW_DLLPUBLIC
Ring
namespace
sw
{
struct
Ring_node_traits
{
typedef
T
node
;
typedef
T
*
node_ptr
;
typedef
const
T
*
const_node_ptr
;
static
node_ptr
get_next
(
const_node_ptr
n
)
{
return
n
->
GetNext
();
};
static
void
set_next
(
node_ptr
n
,
node_ptr
next
)
{
n
->
pNext
=
next
;
};
static
node_ptr
get_previous
(
const_node_ptr
n
)
{
return
n
->
GetPrev
();
};
static
void
set_previous
(
node_ptr
n
,
node_ptr
previous
)
{
n
->
pPrev
=
previous
;
};
};
friend
class
Ring_node_traits
;
typedef
boost
::
intrusive
::
circular_list_algorithms
<
Ring_node_traits
>
algo
;
T
*
pNext
;
T
*
pPrev
;
///< In order to speed up inserting and deleting.
class
Ring_node_traits
;
template
<
class
T
>
class
RingIterator
;
protected
:
Ring
()
{
algo
::
init_header
(
static_cast
<
T
*
>
(
this
));
}
Ring
(
T
*
);
public
:
typedef
RingIterator
<
T
>
iterator
;
typedef
RingIterator
<
T
>
const_iterator
;
virtual
~
Ring
()
{
algo
::
unlink
(
static_cast
<
T
*
>
(
this
));
};
void
MoveTo
(
T
*
pDestRing
);
void
MoveRingTo
(
T
*
pDestRing
);
template
<
class
T
>
class
SW_DLLPUBLIC
Ring
{
struct
Ring_node_traits
{
typedef
T
node
;
typedef
T
*
node_ptr
;
typedef
const
T
*
const_node_ptr
;
static
node_ptr
get_next
(
const_node_ptr
n
)
{
return
n
->
GetNext
();
};
static
void
set_next
(
node_ptr
n
,
node_ptr
next
)
{
n
->
pNext
=
next
;
};
static
node_ptr
get_previous
(
const_node_ptr
n
)
{
return
n
->
GetPrev
();
};
static
void
set_previous
(
node_ptr
n
,
node_ptr
previous
)
{
n
->
pPrev
=
previous
;
};
};
friend
class
Ring_node_traits
;
typedef
boost
::
intrusive
::
circular_list_algorithms
<
Ring_node_traits
>
algo
;
T
*
pNext
;
T
*
pPrev
;
///< In order to speed up inserting and deleting.
T
*
GetNext
()
const
{
return
pNext
;
}
T
*
GetPrev
()
const
{
return
pPrev
;
}
// unfortunately we cant name these STL-conforming, as some derived classes
// also derive from other STL containers (which is bad anyway, but ...)
iterator
beginRing
();
iterator
endRing
();
protected
:
Ring
()
{
algo
::
init_header
(
static_cast
<
T
*
>
(
this
));
}
Ring
(
T
*
);
public
:
typedef
RingIterator
<
T
>
iterator
;
typedef
RingIterator
<
T
>
const_iterator
;
virtual
~
Ring
()
{
algo
::
unlink
(
static_cast
<
T
*
>
(
this
));
};
void
MoveTo
(
T
*
pDestRing
);
void
MoveRingTo
(
T
*
pDestRing
);
sal_uInt32
numberOf
()
const
{
return
algo
::
count
(
static_cast
<
const
T
*
>
(
this
));
}
};
T
*
GetNext
()
const
{
return
pNext
;
}
T
*
GetPrev
()
const
{
return
pPrev
;
}
// unfortunately we cant name these STL-conforming, as some derived classes
// also derive from other STL containers (which is bad anyway, but ...)
iterator
beginRing
();
iterator
endRing
();
template
<
class
T
>
inline
Ring
<
T
>::
Ring
(
T
*
pObj
)
{
T
*
pThis
=
static_cast
<
T
*
>
(
this
);
if
(
!
pObj
)
algo
::
init_header
(
pThis
);
else
algo
::
link_before
(
pObj
,
pThis
);
}
sal_uInt32
numberOf
()
const
{
return
algo
::
count
(
static_cast
<
const
T
*
>
(
this
));
}
};
template
<
class
T
>
inline
void
Ring
<
T
>::
MoveTo
(
T
*
pDestRing
)
{
T
*
pThis
=
static_cast
<
T
*
>
(
this
);
// insert into "new"
if
(
pDestRing
)
template
<
class
T
>
inline
Ring
<
T
>::
Ring
(
T
*
pObj
)
{
if
(
algo
::
unique
(
pThis
))
algo
::
link_before
(
pDestRing
,
pThis
);
T
*
pThis
=
static_cast
<
T
*
>
(
this
);
if
(
!
pObj
)
algo
::
init_header
(
pThis
);
else
algo
::
transfer
(
pDestRing
,
pThis
);
algo
::
link_before
(
pObj
,
pThis
);
}
else
algo
::
unlink
(
pThis
);
}
template
<
class
T
>
inline
void
Ring
<
T
>::
MoveRingTo
(
T
*
pDestRing
)
{
std
::
swap
(
*
(
&
pPrev
->
pNext
),
*
(
&
pDestRing
->
pPrev
->
pNext
));
std
::
swap
(
*
(
&
pPrev
),
*
(
&
pDestRing
->
pPrev
));
}
template
<
class
T
>
class
RingIterator
:
public
boost
::
iterator_facade
<
RingIterator
<
T
>
,
T
,
boost
::
forward_traversal_tag
>
{
public
:
RingIterator
()
:
m_pCurrent
(
nullptr
)
,
m_pStart
(
nullptr
)
{}
explicit
RingIterator
(
T
*
pRing
,
bool
bStart
=
true
)
:
m_pCurrent
(
nullptr
)
,
m_pStart
(
pRing
)
template
<
class
T
>
inline
void
Ring
<
T
>::
MoveTo
(
T
*
pDestRing
)
{
T
*
pThis
=
static_cast
<
T
*
>
(
this
);
// insert into "new"
if
(
pDestRing
)
{
if
(
!
bStart
)
m_pCurrent
=
m_pStart
;
if
(
algo
::
unique
(
pThis
))
algo
::
link_before
(
pDestRing
,
pThis
);
else
algo
::
transfer
(
pDestRing
,
pThis
);
}
private
:
friend
class
boost
::
iterator_core_access
;
void
increment
()
{
m_pCurrent
=
m_pCurrent
?
m_pCurrent
->
GetNext
()
:
m_pStart
->
GetNext
();
}
bool
equal
(
RingIterator
const
&
other
)
const
{
return
m_pCurrent
==
other
.
m_pCurrent
&&
m_pStart
==
m_pStart
;
}
T
&
dereference
()
const
{
return
m_pCurrent
?
*
m_pCurrent
:
*
m_pStart
;
}
T
*
m_pCurrent
;
T
*
m_pStart
;
};
else
algo
::
unlink
(
pThis
);
}
template
<
class
T
>
inline
typename
Ring
<
T
>::
iterator
Ring
<
T
>::
beginRing
()
{
return
Ring
<
T
>::
iterator
(
static_cast
<
T
*
>
(
this
));
};
template
<
class
T
>
inline
void
Ring
<
T
>::
MoveRingTo
(
T
*
pDestRing
)
{
std
::
swap
(
*
(
&
pPrev
->
pNext
),
*
(
&
pDestRing
->
pPrev
->
pNext
));
std
::
swap
(
*
(
&
pPrev
),
*
(
&
pDestRing
->
pPrev
));
}
template
<
class
T
>
class
RingIterator
:
public
boost
::
iterator_facade
<
RingIterator
<
T
>
,
T
,
boost
::
forward_traversal_tag
>
{
public
:
RingIterator
()
:
m_pCurrent
(
nullptr
)
,
m_pStart
(
nullptr
)
{}
explicit
RingIterator
(
T
*
pRing
,
bool
bStart
=
true
)
:
m_pCurrent
(
nullptr
)
,
m_pStart
(
pRing
)
{
if
(
!
bStart
)
m_pCurrent
=
m_pStart
;
}
private
:
friend
class
boost
::
iterator_core_access
;
void
increment
()
{
m_pCurrent
=
m_pCurrent
?
m_pCurrent
->
GetNext
()
:
m_pStart
->
GetNext
();
}
bool
equal
(
RingIterator
const
&
other
)
const
{
return
m_pCurrent
==
other
.
m_pCurrent
&&
m_pStart
==
m_pStart
;
}
T
&
dereference
()
const
{
return
m_pCurrent
?
*
m_pCurrent
:
*
m_pStart
;
}
T
*
m_pCurrent
;
T
*
m_pStart
;
};
template
<
class
T
>
inline
typename
Ring
<
T
>::
iterator
Ring
<
T
>::
beginRing
()
{
return
Ring
<
T
>::
iterator
(
static_cast
<
T
*
>
(
this
));
};
template
<
class
T
>
inline
typename
Ring
<
T
>::
iterator
Ring
<
T
>::
endRing
()
{
return
Ring
<
T
>::
iterator
(
static_cast
<
T
*
>
(
this
),
false
);
};
template
<
class
T
>
inline
typename
Ring
<
T
>::
iterator
Ring
<
T
>::
endRing
()
{
return
Ring
<
T
>::
iterator
(
static_cast
<
T
*
>
(
this
),
false
);
};
}
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sw/inc/viewsh.hxx
Dosyayı görüntüle @
7902e30a
...
...
@@ -95,7 +95,7 @@ enum FrameControlType
typedef
boost
::
shared_ptr
<
SwRootFrm
>
SwRootFrmPtr
;
class
SwViewShell
;
class
SW_DLLPUBLIC
SwViewShell
:
public
Ring
<
SwViewShell
>
class
SW_DLLPUBLIC
SwViewShell
:
public
sw
::
Ring
<
SwViewShell
>
{
friend
void
SetOutDev
(
SwViewShell
*
pSh
,
OutputDevice
*
pOut
);
friend
void
SetOutDevAndWin
(
SwViewShell
*
pSh
,
OutputDevice
*
pOut
,
...
...
sw/qa/core/uwriter.cxx
Dosyayı görüntüle @
7902e30a
...
...
@@ -1275,9 +1275,9 @@ void SwDocTest::testMarkMove()
namespace
{
struct
TestRing
:
public
Ring
<
TestRing
>
struct
TestRing
:
public
sw
::
Ring
<
TestRing
>
{
TestRing
()
:
Ring
<
TestRing
>
()
{};
TestRing
()
:
sw
::
Ring
<
TestRing
>
()
{};
void
debug
()
{
SAL_DEBUG
(
"TestRing at: "
<<
this
<<
" prev: "
<<
GetPrev
()
<<
" next: "
<<
GetNext
());
...
...
sw/source/core/doc/doccomp.cxx
Dosyayı görüntüle @
7902e30a
...
...
@@ -1828,7 +1828,7 @@ long SwDoc::CompareDoc( const SwDoc& rDoc )
}
class
_SaveMergeRedlines
;
class
_SaveMergeRedlines
:
public
Ring
<
_SaveMergeRedlines
>
class
_SaveMergeRedlines
:
public
sw
::
Ring
<
_SaveMergeRedlines
>
{
const
SwRangeRedline
*
pSrcRedl
;
SwRangeRedline
*
pDestRedl
;
...
...
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