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
01648a39
Kaydet (Commit)
01648a39
authored
Eyl 15, 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: I880526fdcce3be0f9e9149695812e048d95004e6
üst
54045cc8
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
29 additions
and
24 deletions
+29
-24
tblafmt.hxx
sw/inc/tblafmt.hxx
+2
-2
tblafmt.cxx
sw/source/core/doc/tblafmt.cxx
+21
-17
tautofmt.cxx
sw/source/ui/table/tautofmt.cxx
+6
-5
No files found.
sw/inc/tblafmt.hxx
Dosyayı görüntüle @
01648a39
...
@@ -310,9 +310,9 @@ public:
...
@@ -310,9 +310,9 @@ public:
size_t
size
()
const
;
size_t
size
()
const
;
SwTableAutoFormat
const
&
operator
[](
size_t
i
)
const
;
SwTableAutoFormat
const
&
operator
[](
size_t
i
)
const
;
SwTableAutoFormat
&
operator
[](
size_t
i
);
SwTableAutoFormat
&
operator
[](
size_t
i
);
void
InsertAutoFormat
(
size_t
i
,
SwTableAutoFormat
*
pFormat
);
void
InsertAutoFormat
(
size_t
i
,
std
::
unique_ptr
<
SwTableAutoFormat
>
pFormat
);
void
EraseAutoFormat
(
size_t
i
);
void
EraseAutoFormat
(
size_t
i
);
SwTableAutoFormat
*
ReleaseAutoFormat
(
size_t
i
);
std
::
unique_ptr
<
SwTableAutoFormat
>
ReleaseAutoFormat
(
size_t
i
);
bool
Load
();
bool
Load
();
bool
Save
()
const
;
bool
Save
()
const
;
...
...
sw/source/core/doc/tblafmt.cxx
Dosyayı görüntüle @
01648a39
...
@@ -41,9 +41,11 @@
...
@@ -41,9 +41,11 @@
#include <fmtornt.hxx>
#include <fmtornt.hxx>
#include <editsh.hxx>
#include <editsh.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/noncopyable.hpp>
#include <boost/noncopyable.hpp>
#include <memory>
#include <vector>
/*
/*
* XXX: BIG RED NOTICE! Changes MUST be binary file format compatible and MUST
* XXX: BIG RED NOTICE! Changes MUST be binary file format compatible and MUST
* be synchronized with Calc's ScAutoFormat sc/source/core/tool/autoform.cxx
* be synchronized with Calc's ScAutoFormat sc/source/core/tool/autoform.cxx
...
@@ -1006,7 +1008,7 @@ bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
...
@@ -1006,7 +1008,7 @@ bool SwTableAutoFormat::Save( SvStream& rStream, sal_uInt16 fileVersion ) const
struct
SwTableAutoFormatTable
::
Impl
struct
SwTableAutoFormatTable
::
Impl
{
{
boost
::
ptr_vector
<
SwTableAutoFormat
>
m_AutoFormats
;
std
::
vector
<
std
::
unique_ptr
<
SwTableAutoFormat
>
>
m_AutoFormats
;
};
};
size_t
SwTableAutoFormatTable
::
size
()
const
size_t
SwTableAutoFormatTable
::
size
()
const
...
@@ -1016,17 +1018,17 @@ size_t SwTableAutoFormatTable::size() const
...
@@ -1016,17 +1018,17 @@ size_t SwTableAutoFormatTable::size() const
SwTableAutoFormat
const
&
SwTableAutoFormatTable
::
operator
[](
size_t
const
i
)
const
SwTableAutoFormat
const
&
SwTableAutoFormatTable
::
operator
[](
size_t
const
i
)
const
{
{
return
m_pImpl
->
m_AutoFormats
[
i
];
return
*
m_pImpl
->
m_AutoFormats
[
i
];
}
}
SwTableAutoFormat
&
SwTableAutoFormatTable
::
operator
[](
size_t
const
i
)
SwTableAutoFormat
&
SwTableAutoFormatTable
::
operator
[](
size_t
const
i
)
{
{
return
m_pImpl
->
m_AutoFormats
[
i
];
return
*
m_pImpl
->
m_AutoFormats
[
i
];
}
}
void
void
SwTableAutoFormatTable
::
InsertAutoFormat
(
size_t
const
i
,
SwTableAutoFormat
*
const
pFormat
)
SwTableAutoFormatTable
::
InsertAutoFormat
(
size_t
const
i
,
std
::
unique_ptr
<
SwTableAutoFormat
>
pFormat
)
{
{
m_pImpl
->
m_AutoFormats
.
insert
(
m_pImpl
->
m_AutoFormats
.
begin
()
+
i
,
pFormat
);
m_pImpl
->
m_AutoFormats
.
insert
(
m_pImpl
->
m_AutoFormats
.
begin
()
+
i
,
std
::
move
(
pFormat
)
);
}
}
void
SwTableAutoFormatTable
::
EraseAutoFormat
(
size_t
const
i
)
void
SwTableAutoFormatTable
::
EraseAutoFormat
(
size_t
const
i
)
...
@@ -1034,9 +1036,12 @@ void SwTableAutoFormatTable::EraseAutoFormat(size_t const i)
...
@@ -1034,9 +1036,12 @@ void SwTableAutoFormatTable::EraseAutoFormat(size_t const i)
m_pImpl
->
m_AutoFormats
.
erase
(
m_pImpl
->
m_AutoFormats
.
begin
()
+
i
);
m_pImpl
->
m_AutoFormats
.
erase
(
m_pImpl
->
m_AutoFormats
.
begin
()
+
i
);
}
}
SwTableAutoFormat
*
SwTableAutoFormatTable
::
ReleaseAutoFormat
(
size_t
const
i
)
std
::
unique_ptr
<
SwTableAutoFormat
>
SwTableAutoFormatTable
::
ReleaseAutoFormat
(
size_t
const
i
)
{
{
return
m_pImpl
->
m_AutoFormats
.
release
(
m_pImpl
->
m_AutoFormats
.
begin
()
+
i
).
release
();
auto
const
iter
(
m_pImpl
->
m_AutoFormats
.
begin
()
+
i
);
std
::
unique_ptr
<
SwTableAutoFormat
>
pRet
(
std
::
move
(
*
iter
));
m_pImpl
->
m_AutoFormats
.
erase
(
iter
);
return
pRet
;
}
}
SwTableAutoFormatTable
::~
SwTableAutoFormatTable
()
SwTableAutoFormatTable
::~
SwTableAutoFormatTable
()
...
@@ -1047,8 +1052,8 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
...
@@ -1047,8 +1052,8 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
:
m_pImpl
(
new
Impl
)
:
m_pImpl
(
new
Impl
)
{
{
OUString
sNm
;
OUString
sNm
;
SwTableAutoFormat
*
pNew
=
new
SwTableAutoFormat
(
std
::
unique_ptr
<
SwTableAutoFormat
>
pNew
(
new
SwTableAutoFormat
(
SwStyleNameMapper
::
GetUIName
(
RES_POOLCOLL_STANDARD
,
sNm
)
);
SwStyleNameMapper
::
GetUIName
(
RES_POOLCOLL_STANDARD
,
sNm
))
);
SwBoxAutoFormat
aNew
;
SwBoxAutoFormat
aNew
;
...
@@ -1098,7 +1103,7 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
...
@@ -1098,7 +1103,7 @@ SwTableAutoFormatTable::SwTableAutoFormatTable()
const_cast
<
SwBoxAutoFormat
&>
(
pNew
->
GetBoxFormat
(
i
)).
SetBox
(
aBox
);
const_cast
<
SwBoxAutoFormat
&>
(
pNew
->
GetBoxFormat
(
i
)).
SetBox
(
aBox
);
}
}
m_pImpl
->
m_AutoFormats
.
push_back
(
pNew
);
m_pImpl
->
m_AutoFormats
.
push_back
(
std
::
move
(
pNew
)
);
}
}
bool
SwTableAutoFormatTable
::
Load
()
bool
SwTableAutoFormatTable
::
Load
()
...
@@ -1163,7 +1168,6 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream )
...
@@ -1163,7 +1168,6 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream )
{
{
aVersions
.
Load
(
rStream
,
nVal
);
// Item versions
aVersions
.
Load
(
rStream
,
nVal
);
// Item versions
SwTableAutoFormat
*
pNew
;
sal_uInt16
nCount
=
0
;
sal_uInt16
nCount
=
0
;
rStream
.
ReadUInt16
(
nCount
);
rStream
.
ReadUInt16
(
nCount
);
...
@@ -1180,15 +1184,15 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream )
...
@@ -1180,15 +1184,15 @@ bool SwTableAutoFormatTable::Load( SvStream& rStream )
}
}
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
for
(
sal_uInt16
i
=
0
;
i
<
nCount
;
++
i
)
{
{
pNew
=
new
SwTableAutoFormat
(
OUString
()
);
std
::
unique_ptr
<
SwTableAutoFormat
>
pNew
(
new
SwTableAutoFormat
(
OUString
()
));
bRet
=
pNew
->
Load
(
rStream
,
aVersions
);
bRet
=
pNew
->
Load
(
rStream
,
aVersions
);
if
(
bRet
)
if
(
bRet
)
{
{
m_pImpl
->
m_AutoFormats
.
push_back
(
pNew
);
m_pImpl
->
m_AutoFormats
.
push_back
(
std
::
move
(
pNew
)
);
}
}
else
else
{
{
delete
pNew
;
break
;
break
;
}
}
}
}
...
@@ -1221,7 +1225,7 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const
...
@@ -1221,7 +1225,7 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const
return
false
;
return
false
;
// Write this version number for all attributes
// Write this version number for all attributes
m_pImpl
->
m_AutoFormats
[
0
]
.
GetBoxFormat
(
0
).
SaveVersionNo
(
m_pImpl
->
m_AutoFormats
[
0
]
->
GetBoxFormat
(
0
).
SaveVersionNo
(
rStream
,
AUTOFORMAT_FILE_VERSION
);
rStream
,
AUTOFORMAT_FILE_VERSION
);
rStream
.
WriteUInt16
(
m_pImpl
->
m_AutoFormats
.
size
()
-
1
);
rStream
.
WriteUInt16
(
m_pImpl
->
m_AutoFormats
.
size
()
-
1
);
...
@@ -1229,7 +1233,7 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const
...
@@ -1229,7 +1233,7 @@ bool SwTableAutoFormatTable::Save( SvStream& rStream ) const
for
(
sal_uInt16
i
=
1
;
bRet
&&
i
<
m_pImpl
->
m_AutoFormats
.
size
();
++
i
)
for
(
sal_uInt16
i
=
1
;
bRet
&&
i
<
m_pImpl
->
m_AutoFormats
.
size
();
++
i
)
{
{
SwTableAutoFormat
const
&
rFormat
=
m_pImpl
->
m_AutoFormats
[
i
];
SwTableAutoFormat
const
&
rFormat
=
*
m_pImpl
->
m_AutoFormats
[
i
];
bRet
=
rFormat
.
Save
(
rStream
,
AUTOFORMAT_FILE_VERSION
);
bRet
=
rFormat
.
Save
(
rStream
,
AUTOFORMAT_FILE_VERSION
);
}
}
}
}
...
...
sw/source/ui/table/tautofmt.cxx
Dosyayı görüntüle @
01648a39
...
@@ -328,8 +328,8 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, AddHdl, Button*, void)
...
@@ -328,8 +328,8 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, AddHdl, Button*, void)
if
(
n
>=
pTableTable
->
size
()
)
if
(
n
>=
pTableTable
->
size
()
)
{
{
// Format with the name does not already exist, so take up.
// Format with the name does not already exist, so take up.
SwTableAutoFormat
*
pNewData
=
new
std
::
unique_ptr
<
SwTableAutoFormat
>
pNewData
(
SwTableAutoFormat
(
aFormatName
);
new
SwTableAutoFormat
(
aFormatName
)
);
pShell
->
GetTableAutoFormat
(
*
pNewData
);
pShell
->
GetTableAutoFormat
(
*
pNewData
);
// Insert sorted!!
// Insert sorted!!
...
@@ -337,7 +337,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, AddHdl, Button*, void)
...
@@ -337,7 +337,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, AddHdl, Button*, void)
if
(
(
*
pTableTable
)[
n
].
GetName
()
>
aFormatName
)
if
(
(
*
pTableTable
)[
n
].
GetName
()
>
aFormatName
)
break
;
break
;
pTableTable
->
InsertAutoFormat
(
n
,
pNewData
);
pTableTable
->
InsertAutoFormat
(
n
,
std
::
move
(
pNewData
)
);
m_pLbFormat
->
InsertEntry
(
aFormatName
,
nDfltStylePos
+
n
);
m_pLbFormat
->
InsertEntry
(
aFormatName
,
nDfltStylePos
+
n
);
m_pLbFormat
->
SelectEntryPos
(
nDfltStylePos
+
n
);
m_pLbFormat
->
SelectEntryPos
(
nDfltStylePos
+
n
);
bFormatInserted
=
true
;
bFormatInserted
=
true
;
...
@@ -423,7 +423,8 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void)
...
@@ -423,7 +423,8 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void)
{
{
// no format with this name exists, so rename it
// no format with this name exists, so rename it
m_pLbFormat
->
RemoveEntry
(
nDfltStylePos
+
nIndex
);
m_pLbFormat
->
RemoveEntry
(
nDfltStylePos
+
nIndex
);
SwTableAutoFormat
*
p
=
pTableTable
->
ReleaseAutoFormat
(
nIndex
);
std
::
unique_ptr
<
SwTableAutoFormat
>
p
(
pTableTable
->
ReleaseAutoFormat
(
nIndex
));
p
->
SetName
(
aFormatName
);
p
->
SetName
(
aFormatName
);
...
@@ -434,7 +435,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void)
...
@@ -434,7 +435,7 @@ IMPL_LINK_NOARG_TYPED(SwAutoFormatDlg, RenameHdl, Button*, void)
break
;
break
;
}
}
pTableTable
->
InsertAutoFormat
(
n
,
p
);
pTableTable
->
InsertAutoFormat
(
n
,
std
::
move
(
p
)
);
m_pLbFormat
->
InsertEntry
(
aFormatName
,
nDfltStylePos
+
n
);
m_pLbFormat
->
InsertEntry
(
aFormatName
,
nDfltStylePos
+
n
);
m_pLbFormat
->
SelectEntryPos
(
nDfltStylePos
+
n
);
m_pLbFormat
->
SelectEntryPos
(
nDfltStylePos
+
n
);
...
...
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