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
fdc83939
Kaydet (Commit)
fdc83939
authored
Eyl 03, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: replace boost::ptr_deque with std::deque<std::unique_ptr>
Change-Id: Ibb51b67d4d9568577b73a43411322fb5d09bb399
üst
327ab3c0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
32 deletions
+34
-32
fltshell.cxx
sw/source/filter/basflt/fltshell.cxx
+26
-26
fltshell.hxx
sw/source/filter/inc/fltshell.hxx
+8
-6
No files found.
sw/source/filter/basflt/fltshell.cxx
Dosyayı görüntüle @
fdc83939
...
...
@@ -172,7 +172,7 @@ SwFltControlStack::SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl)
SwFltControlStack
::~
SwFltControlStack
()
{
OSL_ENSURE
(
m
a
Entries
.
empty
(),
"There are still Attributes on the stack"
);
OSL_ENSURE
(
m
_
Entries
.
empty
(),
"There are still Attributes on the stack"
);
}
// MoveAttrs() is meant to address the following problem:
...
...
@@ -184,13 +184,13 @@ SwFltControlStack::~SwFltControlStack()
// same paragraph further out by one character.
void
SwFltControlStack
::
MoveAttrs
(
const
SwPosition
&
rPos
)
{
size_t
nCnt
=
m
a
Entries
.
size
();
size_t
nCnt
=
m
_
Entries
.
size
();
sal_uLong
nPosNd
=
rPos
.
nNode
.
GetIndex
();
sal_uInt16
nPosCt
=
rPos
.
nContent
.
GetIndex
()
-
1
;
for
(
size_t
i
=
0
;
i
<
nCnt
;
++
i
)
{
SwFltStackEntry
&
rEntry
=
ma
Entries
[
i
];
SwFltStackEntry
&
rEntry
=
*
m_
Entries
[
i
];
if
(
(
rEntry
.
m_aMkPos
.
m_nNode
.
GetIndex
()
+
1
==
nPosNd
)
&&
(
rEntry
.
m_aMkPos
.
m_nContent
>=
nPosCt
)
...
...
@@ -216,9 +216,9 @@ void SwFltControlStack::MoveAttrs( const SwPosition& rPos )
void
SwFltControlStack
::
MarkAllAttrsOld
()
{
size_t
nCnt
=
m
a
Entries
.
size
();
size_t
nCnt
=
m
_
Entries
.
size
();
for
(
size_t
i
=
0
;
i
<
nCnt
;
++
i
)
m
aEntries
[
i
].
bOld
=
true
;
m
_Entries
[
i
]
->
bOld
=
true
;
}
namespace
...
...
@@ -256,17 +256,17 @@ void SwFltControlStack::NewAttr(const SwPosition& rPos, const SfxPoolItem& rAttr
{
SwFltStackEntry
*
pTmp
=
new
SwFltStackEntry
(
rPos
,
rAttr
.
Clone
()
);
pTmp
->
SetStartCP
(
GetCurrAttrCP
());
m
aEntries
.
push_back
(
pTmp
);
m
_Entries
.
push_back
(
std
::
unique_ptr
<
SwFltStackEntry
>
(
pTmp
)
);
}
}
void
SwFltControlStack
::
DeleteAndDestroy
(
Entries
::
size_type
nCnt
)
{
OSL_ENSURE
(
nCnt
<
m
a
Entries
.
size
(),
"Out of range!"
);
if
(
nCnt
<
m
a
Entries
.
size
())
OSL_ENSURE
(
nCnt
<
m
_
Entries
.
size
(),
"Out of range!"
);
if
(
nCnt
<
m
_
Entries
.
size
())
{
myEIter
aElement
=
m
a
Entries
.
begin
()
+
nCnt
;
m
a
Entries
.
erase
(
aElement
);
myEIter
aElement
=
m
_
Entries
.
begin
()
+
nCnt
;
m
_
Entries
.
erase
(
aElement
);
}
//Clear the para end position recorded in reader intermittently for the least impact on loading performance
//Because the attributes handled based on the unit of para
...
...
@@ -285,12 +285,12 @@ void SwFltControlStack::DeleteAndDestroy(Entries::size_type nCnt)
// graphic apos -> images.
void
SwFltControlStack
::
StealAttr
(
const
SwNodeIndex
&
rNode
,
sal_uInt16
nAttrId
)
{
size_t
nCnt
=
m
a
Entries
.
size
();
size_t
nCnt
=
m
_
Entries
.
size
();
while
(
nCnt
)
{
nCnt
--
;
SwFltStackEntry
&
rEntry
=
ma
Entries
[
nCnt
];
SwFltStackEntry
&
rEntry
=
*
m_
Entries
[
nCnt
];
if
(
rEntry
.
m_aPtPos
.
m_nNode
.
GetIndex
()
+
1
==
rNode
.
GetIndex
()
&&
(
!
nAttrId
||
nAttrId
==
rEntry
.
pAttr
->
Which
()))
{
...
...
@@ -307,11 +307,11 @@ void SwFltControlStack::KillUnlockedAttrs(const SwPosition& rPos)
{
SwFltPosition
aFltPos
(
rPos
);
size_t
nCnt
=
m
a
Entries
.
size
();
size_t
nCnt
=
m
_
Entries
.
size
();
while
(
nCnt
)
{
nCnt
--
;
SwFltStackEntry
&
rEntry
=
ma
Entries
[
nCnt
];
SwFltStackEntry
&
rEntry
=
*
m_
Entries
[
nCnt
];
if
(
!
rEntry
.
bOld
&&
!
rEntry
.
bOpen
&&
(
rEntry
.
m_aMkPos
==
aFltPos
)
...
...
@@ -338,12 +338,12 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
(
RES_FLTRATTR_BEGIN
<=
nAttrId
&&
RES_FLTRATTR_END
>
nAttrId
),
"Wrong id for attribute"
);
myEIter
aI
=
m
a
Entries
.
begin
();
while
(
aI
!=
m
a
Entries
.
end
())
myEIter
aI
=
m
_
Entries
.
begin
();
while
(
aI
!=
m
_
Entries
.
end
())
{
bool
bLastEntry
=
aI
==
m
a
Entries
.
end
()
-
1
;
bool
bLastEntry
=
aI
==
m
_
Entries
.
end
()
-
1
;
SwFltStackEntry
&
rEntry
=
*
aI
;
SwFltStackEntry
&
rEntry
=
*
*
aI
;
if
(
rEntry
.
bOpen
)
{
// set end of attribute
...
...
@@ -413,7 +413,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
}
}
SetAttrInDoc
(
rPos
,
rEntry
);
aI
=
m
a
Entries
.
erase
(
aI
);
aI
=
m
_
Entries
.
erase
(
aI
);
}
return
pRet
;
...
...
@@ -490,7 +490,7 @@ bool SwFltControlStack::HasSdOD()
{
bool
bRet
=
false
;
for
(
Entries
::
iterator
it
=
maEntries
.
begin
();
it
!=
maEntries
.
end
();
++
it
)
for
(
auto
const
&
it
:
m_Entries
)
{
SwFltStackEntry
&
rEntry
=
*
it
;
if
(
rEntry
.
mnStartCP
==
rEntry
.
mnEndCP
)
...
...
@@ -728,13 +728,13 @@ bool SwFltControlStack::CheckSdOD(sal_Int32 /*nStart*/, sal_Int32 /*nEnd*/)
SfxPoolItem
*
SwFltControlStack
::
GetFormatStackAttr
(
sal_uInt16
nWhich
,
sal_uInt16
*
pPos
)
{
size_t
nSize
=
m
a
Entries
.
size
();
size_t
nSize
=
m
_
Entries
.
size
();
while
(
nSize
)
{
// is it the looked-for attribute ? (only applies to locked, meaning
// currently set attributes!!)
SwFltStackEntry
&
rEntry
=
ma
Entries
[
--
nSize
];
SwFltStackEntry
&
rEntry
=
*
m_
Entries
[
--
nSize
];
if
(
rEntry
.
bOpen
&&
rEntry
.
pAttr
->
Which
()
==
nWhich
)
{
if
(
pPos
)
...
...
@@ -749,11 +749,11 @@ const SfxPoolItem* SwFltControlStack::GetOpenStackAttr(const SwPosition& rPos, s
{
SwFltPosition
aFltPos
(
rPos
);
size_t
nSize
=
m
a
Entries
.
size
();
size_t
nSize
=
m
_
Entries
.
size
();
while
(
nSize
)
{
SwFltStackEntry
&
rEntry
=
ma
Entries
[
--
nSize
];
SwFltStackEntry
&
rEntry
=
*
m_
Entries
[
--
nSize
];
if
(
rEntry
.
bOpen
&&
rEntry
.
pAttr
->
Which
()
==
nWhich
&&
rEntry
.
m_aMkPos
==
aFltPos
)
{
return
rEntry
.
pAttr
;
...
...
@@ -779,9 +779,9 @@ void SwFltControlStack::Delete(const SwPaM &rPam)
if
(
aEndNode
!=
aStartNode
)
return
;
for
(
size_t
nSize
=
m
a
Entries
.
size
();
nSize
>
0
;)
for
(
size_t
nSize
=
m
_
Entries
.
size
();
nSize
>
0
;)
{
SwFltStackEntry
&
rEntry
=
ma
Entries
[
--
nSize
];
SwFltStackEntry
&
rEntry
=
*
m_
Entries
[
--
nSize
];
bool
bEntryStartAfterSelStart
=
(
rEntry
.
m_aMkPos
.
m_nNode
==
aStartNode
&&
...
...
sw/source/filter/inc/fltshell.hxx
Dosyayı görüntüle @
fdc83939
...
...
@@ -33,7 +33,9 @@
#include <IDocumentRedlineAccess.hxx>
#include <boost/noncopyable.hpp>
#include <boost/ptr_container/ptr_deque.hpp>
#include <memory>
#include <deque>
class
SwTOXBase
;
class
SwField
;
...
...
@@ -131,9 +133,9 @@ public:
class
SW_DLLPUBLIC
SwFltControlStack
:
private
::
boost
::
noncopyable
{
typedef
boost
::
ptr_deque
<
SwFltStackEntry
>
Entries
;
typedef
std
::
deque
<
std
::
unique_ptr
<
SwFltStackEntry
>
>
Entries
;
typedef
Entries
::
iterator
myEIter
;
Entries
m
a
Entries
;
Entries
m
_
Entries
;
sal_uLong
nFieldFlags
;
vcl
::
KeyCode
aEmptyKeyCode
;
// fuer Bookmarks
...
...
@@ -186,10 +188,10 @@ public:
const
SfxPoolItem
*
GetOpenStackAttr
(
const
SwPosition
&
rPos
,
sal_uInt16
nWhich
);
void
Delete
(
const
SwPaM
&
rPam
);
bool
empty
()
const
{
return
m
a
Entries
.
empty
();
}
Entries
::
size_type
size
()
const
{
return
m
a
Entries
.
size
();
}
bool
empty
()
const
{
return
m
_
Entries
.
empty
();
}
Entries
::
size_type
size
()
const
{
return
m
_
Entries
.
size
();
}
SwFltStackEntry
&
operator
[](
Entries
::
size_type
nIndex
)
{
return
ma
Entries
[
nIndex
];
}
{
return
*
m_
Entries
[
nIndex
];
}
void
DeleteAndDestroy
(
Entries
::
size_type
nCnt
);
};
...
...
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