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
68daf1e8
Kaydet (Commit)
68daf1e8
authored
Eki 05, 2015
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: replace boost::ptr_vector with std::vector<std::unique_ptr>
Change-Id: I44f3ff3779ea9c35fadc02ae6f2970d33aeb2f25
üst
b6b32516
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
22 deletions
+24
-22
redlndlg.hxx
sw/source/uibase/inc/redlndlg.hxx
+4
-2
redlndlg.cxx
sw/source/uibase/misc/redlndlg.cxx
+20
-20
No files found.
sw/source/uibase/inc/redlndlg.hxx
Dosyayı görüntüle @
68daf1e8
...
...
@@ -33,6 +33,9 @@
#include <boost/ptr_container/ptr_vector.hpp>
#include <o3tl/sorted_vector.hxx>
#include <memory>
#include <vector>
class
SwChildWinWrapper
;
struct
SwRedlineDataChild
...
...
@@ -62,8 +65,7 @@ typedef boost::ptr_vector<SwRedlineDataChild> SwRedlineDataChildArr;
class
SW_DLLPUBLIC
SwRedlineAcceptDlg
{
VclPtr
<
vcl
::
Window
>
pParentDlg
;
boost
::
ptr_vector
<
SwRedlineDataParent
>
aRedlineParents
;
std
::
vector
<
std
::
unique_ptr
<
SwRedlineDataParent
>>
m_RedlineParents
;
SwRedlineDataChildArr
aRedlineChildren
;
SwRedlineDataParentSortArr
aUsedSeqNo
;
VclPtr
<
SvxAcceptChgCtr
>
aTabPagesCTRL
;
...
...
sw/source/uibase/misc/redlndlg.cxx
Dosyayı görüntüle @
68daf1e8
...
...
@@ -231,12 +231,12 @@ void SwRedlineAcceptDlg::Init(sal_uInt16 nStart)
aUsedSeqNo
.
clear
();
if
(
nStart
)
RemoveParents
(
nStart
,
a
RedlineParents
.
size
()
-
1
);
RemoveParents
(
nStart
,
m_
RedlineParents
.
size
()
-
1
);
else
{
pTable
->
Clear
();
aRedlineChildren
.
clear
();
aRedlineParents
.
erase
(
aRedlineParents
.
begin
()
+
nStart
,
a
RedlineParents
.
end
());
m_RedlineParents
.
erase
(
m_RedlineParents
.
begin
()
+
nStart
,
m_
RedlineParents
.
end
());
}
// insert parents
...
...
@@ -400,21 +400,20 @@ void SwRedlineAcceptDlg::Activate()
sal_uInt16
nCount
=
pSh
->
GetRedlineCount
();
// check the number of pointers
SwRedlineDataParent
*
pParent
=
0
;
sal_uInt16
i
;
for
(
i
=
0
;
i
<
nCount
;
i
++
)
{
const
SwRangeRedline
&
rRedln
=
pSh
->
GetRedline
(
i
);
if
(
i
>=
a
RedlineParents
.
size
())
if
(
i
>=
m_
RedlineParents
.
size
())
{
// new entries have been appended
Init
(
i
);
return
;
}
pParent
=
&
aRedlineParents
[
i
]
;
SwRedlineDataParent
*
const
pParent
=
m_RedlineParents
[
i
].
get
()
;
if
(
&
rRedln
.
GetRedlineData
()
!=
pParent
->
pData
)
{
// Redline-Parents were inserted, changed or deleted
...
...
@@ -450,7 +449,7 @@ void SwRedlineAcceptDlg::Activate()
}
}
if
(
nCount
!=
a
RedlineParents
.
size
())
if
(
nCount
!=
m_
RedlineParents
.
size
())
{
// Redlines were deleted at the end
Init
(
nCount
);
...
...
@@ -461,7 +460,7 @@ void SwRedlineAcceptDlg::Activate()
for
(
i
=
0
;
i
<
nCount
;
i
++
)
{
const
SwRangeRedline
&
rRedln
=
pSh
->
GetRedline
(
i
);
pParent
=
&
aRedlineParents
[
i
]
;
SwRedlineDataParent
*
const
pParent
=
m_RedlineParents
[
i
].
get
()
;
if
(
rRedln
.
GetComment
()
!=
pParent
->
sComment
)
{
...
...
@@ -490,7 +489,7 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, bool bChild)
SwView
*
pView
=
::
GetActiveView
();
SwWrtShell
*
pSh
=
pView
->
GetWrtShellPtr
();
sal_uInt16
nAutoFormat
=
HasRedlineAutoFormat
()
?
nsRedlineType_t
::
REDLINE_FORM_AUTOFMT
:
0
;
SwRedlineDataParent
*
pParent
=
&
aRedlineParents
[
nStart
]
;
SwRedlineDataParent
*
const
pParent
=
m_RedlineParents
[
nStart
].
get
()
;
const
SwRangeRedline
&
rRedln
=
pSh
->
GetRedline
(
nStart
);
if
(
bChild
)
// should actually never happen, but just in case...
...
...
@@ -525,10 +524,9 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, bool bChild)
// have entries been deleted?
const
SwRedlineData
*
pRedlineData
=
&
rRedln
.
GetRedlineData
();
sal_uInt16
i
;
for
(
i
=
nStart
+
1
;
i
<
aRedlineParents
.
size
();
i
++
)
for
(
sal_uInt16
i
=
nStart
+
1
;
i
<
m_RedlineParents
.
size
();
i
++
)
{
if
(
aRedlineParents
[
i
].
pData
==
pRedlineData
)
if
(
m_RedlineParents
[
i
]
->
pData
==
pRedlineData
)
{
// remove entries from nStart to i-1
RemoveParents
(
nStart
,
i
-
1
);
...
...
@@ -539,9 +537,9 @@ sal_uInt16 SwRedlineAcceptDlg::CalcDiff(sal_uInt16 nStart, bool bChild)
// entries been inserted?
sal_uInt16
nCount
=
pSh
->
GetRedlineCount
();
pRedlineData
=
aRedlineParents
[
nStart
].
pData
;
pRedlineData
=
m_RedlineParents
[
nStart
]
->
pData
;
for
(
i
=
nStart
+
1
;
i
<
nCount
;
i
++
)
for
(
sal_uInt16
i
=
nStart
+
1
;
i
<
nCount
;
i
++
)
{
if
(
&
pSh
->
GetRedline
(
i
).
GetRedlineData
()
==
pRedlineData
)
{
...
...
@@ -657,12 +655,12 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
// set the cursor after the last entry because otherwise performance problem in TLB.
// TLB would otherwise reset the cursor at every Remove (expensive)
sal_uInt16
nPos
=
std
::
min
((
sal_uInt16
)
nCount
,
(
sal_uInt16
)
a
RedlineParents
.
size
());
sal_uInt16
nPos
=
std
::
min
((
sal_uInt16
)
nCount
,
(
sal_uInt16
)
m_
RedlineParents
.
size
());
SvTreeListEntry
*
pCurEntry
=
NULL
;
while
(
(
pCurEntry
==
NULL
)
&&
(
nPos
>
0
)
)
{
--
nPos
;
pCurEntry
=
aRedlineParents
[
nPos
].
pTLBParent
;
pCurEntry
=
m_RedlineParents
[
nPos
]
->
pTLBParent
;
}
if
(
pCurEntry
)
...
...
@@ -672,9 +670,10 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
for
(
sal_uInt16
i
=
nStart
;
i
<=
nEnd
;
i
++
)
{
if
(
!
bChildrenRemoved
&&
aRedlineParents
[
i
].
pNext
)
if
(
!
bChildrenRemoved
&&
m_RedlineParents
[
i
]
->
pNext
)
{
SwRedlineDataChild
*
pChildPtr
=
const_cast
<
SwRedlineDataChild
*>
(
aRedlineParents
[
i
].
pNext
);
SwRedlineDataChild
*
pChildPtr
=
const_cast
<
SwRedlineDataChild
*>
(
m_RedlineParents
[
i
]
->
pNext
);
for
(
SwRedlineDataChildArr
::
iterator
it
=
aRedlineChildren
.
begin
();
it
!=
aRedlineChildren
.
end
();
++
it
)
if
(
&*
it
==
pChildPtr
)
...
...
@@ -691,7 +690,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
break
;
}
}
SvTreeListEntry
*
pEntry
=
aRedlineParents
[
i
].
pTLBParent
;
SvTreeListEntry
*
const
pEntry
=
m_RedlineParents
[
i
]
->
pTLBParent
;
if
(
pEntry
)
{
long
nIdx
=
aLBoxArr
.
size
()
-
1L
;
...
...
@@ -713,7 +712,7 @@ void SwRedlineAcceptDlg::RemoveParents(sal_uInt16 nStart, sal_uInt16 nEnd)
// unfortunately by Remove it was selected from the TLB always again ...
pTable
->
SelectAll
(
false
);
aRedlineParents
.
erase
(
aRedlineParents
.
begin
()
+
nStart
,
a
RedlineParents
.
begin
()
+
nEnd
+
1
);
m_RedlineParents
.
erase
(
m_RedlineParents
.
begin
()
+
nStart
,
m_
RedlineParents
.
begin
()
+
nEnd
+
1
);
}
void
SwRedlineAcceptDlg
::
InsertParents
(
sal_uInt16
nStart
,
sal_uInt16
nEnd
)
...
...
@@ -756,7 +755,8 @@ void SwRedlineAcceptDlg::InsertParents(sal_uInt16 nStart, sal_uInt16 nEnd)
pRedlineParent
->
pNext
=
0
;
OUString
sComment
(
rRedln
.
GetComment
());
pRedlineParent
->
sComment
=
sComment
.
replace
(
'\n'
,
' '
);
aRedlineParents
.
insert
(
aRedlineParents
.
begin
()
+
i
,
pRedlineParent
);
m_RedlineParents
.
insert
(
m_RedlineParents
.
begin
()
+
i
,
std
::
unique_ptr
<
SwRedlineDataParent
>
(
pRedlineParent
));
RedlinData
*
pData
=
new
RedlinData
;
pData
->
pData
=
pRedlineParent
;
...
...
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