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
9304ce96
Kaydet (Commit)
9304ce96
authored
Kas 11, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sd: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: Ie0073c439cdfe37e5340081f16afb906d32a8369
üst
85d26ef9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
17 deletions
+22
-17
propread.cxx
sd/source/filter/ppt/propread.cxx
+18
-15
propread.hxx
sd/source/filter/ppt/propread.hxx
+4
-2
No files found.
sd/source/filter/ppt/propread.cxx
Dosyayı görüntüle @
9304ce96
...
...
@@ -21,6 +21,7 @@
#include "rtl/tencinfo.h"
#include "rtl/textenc.h"
#include <osl/diagnose.h>
#include <o3tl/make_unique.hxx>
PropEntry
::
PropEntry
(
sal_uInt32
nId
,
const
sal_uInt8
*
pBuf
,
sal_uInt32
nBufSize
,
sal_uInt16
nTextEnc
)
:
mnId
(
nId
),
...
...
@@ -207,11 +208,12 @@ PropItem& PropItem::operator=( PropItem& rPropItem )
}
Section
::
Section
(
const
Section
&
rSection
)
:
mnTextEnc
(
rSection
.
mnTextEnc
),
maEntries
(
rSection
.
maEntries
.
clone
())
:
mnTextEnc
(
rSection
.
mnTextEnc
)
{
for
(
int
i
=
0
;
i
<
16
;
i
++
)
aFMTID
[
i
]
=
rSection
.
aFMTID
[
i
];
for
(
const
std
::
unique_ptr
<
PropEntry
>&
rEntry
:
rSection
.
maEntries
)
maEntries
.
push_back
(
o3tl
::
make_unique
<
PropEntry
>
(
*
rEntry
.
get
()));
}
Section
::
Section
(
const
sal_uInt8
*
pFMTID
)
...
...
@@ -225,10 +227,10 @@ bool Section::GetProperty( sal_uInt32 nId, PropItem& rPropItem )
{
if
(
nId
)
{
boost
::
ptr_vector
<
PropEntry
>::
const_iterator
iter
;
std
::
vector
<
std
::
unique_ptr
<
PropEntry
>
>::
const_iterator
iter
;
for
(
iter
=
maEntries
.
begin
();
iter
!=
maEntries
.
end
();
++
iter
)
{
if
(
iter
->
mnId
==
nId
)
if
(
(
*
iter
)
->
mnId
==
nId
)
break
;
}
...
...
@@ -236,7 +238,7 @@ bool Section::GetProperty( sal_uInt32 nId, PropItem& rPropItem )
{
rPropItem
.
Clear
();
rPropItem
.
SetTextEncoding
(
mnTextEnc
);
rPropItem
.
Write
(
iter
->
mpBuf
,
iter
->
mnSize
);
rPropItem
.
Write
(
(
*
iter
)
->
mpBuf
,
(
*
iter
)
->
mnSize
);
rPropItem
.
Seek
(
STREAM_SEEK_TO_BEGIN
);
return
true
;
}
...
...
@@ -254,34 +256,34 @@ void Section::AddProperty( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBu
nId
=
0
;
// do not allow same PropId's, sort
boost
::
ptr_vector
<
PropEntry
>::
iterator
iter
;
std
::
vector
<
std
::
unique_ptr
<
PropEntry
>
>::
iterator
iter
;
for
(
iter
=
maEntries
.
begin
();
iter
!=
maEntries
.
end
();
++
iter
)
{
if
(
iter
->
mnId
==
nId
)
maEntries
.
replace
(
iter
,
new
PropEntry
(
nId
,
pBuf
,
nBufSize
,
mnTextEnc
));
else
if
(
iter
->
mnId
>
nId
)
maEntries
.
insert
(
iter
,
new
PropEntry
(
nId
,
pBuf
,
nBufSize
,
mnTextEnc
));
if
(
(
*
iter
)
->
mnId
==
nId
)
(
*
iter
).
reset
(
new
PropEntry
(
nId
,
pBuf
,
nBufSize
,
mnTextEnc
));
else
if
(
(
*
iter
)
->
mnId
>
nId
)
maEntries
.
insert
(
iter
,
o3tl
::
make_unique
<
PropEntry
>
(
nId
,
pBuf
,
nBufSize
,
mnTextEnc
));
else
continue
;
return
;
}
maEntries
.
push_back
(
new
PropEntry
(
nId
,
pBuf
,
nBufSize
,
mnTextEnc
)
);
maEntries
.
push_back
(
o3tl
::
make_unique
<
PropEntry
>
(
nId
,
pBuf
,
nBufSize
,
mnTextEnc
)
);
}
void
Section
::
GetDictionary
(
Dictionary
&
rDict
)
{
boost
::
ptr_vector
<
PropEntry
>::
iterator
iter
;
std
::
vector
<
std
::
unique_ptr
<
PropEntry
>
>::
iterator
iter
;
for
(
iter
=
maEntries
.
begin
();
iter
!=
maEntries
.
end
();
++
iter
)
{
if
(
iter
->
mnId
==
0
)
if
(
(
*
iter
)
->
mnId
==
0
)
break
;
}
if
(
iter
==
maEntries
.
end
())
return
;
SvMemoryStream
aStream
(
iter
->
mpBuf
,
iter
->
mnSize
,
StreamMode
::
READ
);
SvMemoryStream
aStream
(
(
*
iter
)
->
mpBuf
,
(
*
iter
)
->
mnSize
,
StreamMode
::
READ
);
aStream
.
Seek
(
STREAM_SEEK_TO_BEGIN
);
sal_uInt32
nDictCount
(
0
);
aStream
.
ReadUInt32
(
nDictCount
);
...
...
@@ -537,7 +539,8 @@ Section& Section::operator=( const Section& rSection )
{
memcpy
(
static_cast
<
void
*>
(
aFMTID
),
static_cast
<
void
const
*>
(
rSection
.
aFMTID
),
16
);
maEntries
=
rSection
.
maEntries
.
clone
();
for
(
const
std
::
unique_ptr
<
PropEntry
>&
rEntry
:
rSection
.
maEntries
)
maEntries
.
push_back
(
o3tl
::
make_unique
<
PropEntry
>
(
*
rEntry
.
get
()));
}
return
*
this
;
}
...
...
sd/source/filter/ppt/propread.hxx
Dosyayı görüntüle @
9304ce96
...
...
@@ -21,6 +21,8 @@
#define INCLUDED_SD_SOURCE_FILTER_PPT_PROPREAD_HXX
#include <map>
#include <vector>
#include <memory>
#include <boost/ptr_container/ptr_vector.hpp>
#include <sal/types.h>
...
...
@@ -108,7 +110,7 @@ public:
void
Clear
();
void
SetTextEncoding
(
sal_uInt16
nTextEnc
){
mnTextEnc
=
nTextEnc
;
};
bool
Read
(
OUString
&
rString
,
sal_uInt32
nType
=
VT_EMPTY
,
bool
bDwordAlign
=
true
);
bool
Read
(
OUString
&
rString
,
sal_uInt32
nType
=
VT_EMPTY
,
bool
bDwordAlign
=
true
);
PropItem
&
operator
=
(
PropItem
&
rPropItem
);
using
SvStream
::
Read
;
...
...
@@ -117,7 +119,7 @@ public:
class
Section
{
sal_uInt16
mnTextEnc
;
boost
::
ptr_vector
<
PropEntry
>
maEntries
;
std
::
vector
<
std
::
unique_ptr
<
PropEntry
>
>
maEntries
;
protected
:
...
...
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