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
191ca975
Kaydet (Commit)
191ca975
authored
Eki 27, 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: I9adb9a445844ead91eefec8c57b879b0cc11c686
üst
384d9e41
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
20 deletions
+23
-20
wrtww8.cxx
sw/source/filter/ww8/wrtww8.cxx
+21
-19
wrtww8.hxx
sw/source/filter/ww8/wrtww8.hxx
+2
-1
No files found.
sw/source/filter/ww8/wrtww8.cxx
Dosyayı görüntüle @
191ca975
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
#include <hintids.hxx>
#include <hintids.hxx>
#include <string.h>
#include <string.h>
#include <osl/endian.h>
#include <osl/endian.h>
#include <o3tl/make_unique.hxx>
#include <docsh.hxx>
#include <docsh.hxx>
#include <drawdoc.hxx>
#include <drawdoc.hxx>
...
@@ -1235,10 +1236,10 @@ void WW8_WrPct::AppendPc(WW8_FC nStartFc)
...
@@ -1235,10 +1236,10 @@ void WW8_WrPct::AppendPc(WW8_FC nStartFc)
WW8_CP
nStartCp
=
nStartFc
-
nOldFc
;
// subtract the beginning of the text
WW8_CP
nStartCp
=
nStartFc
-
nOldFc
;
// subtract the beginning of the text
if
(
!
nStartCp
)
if
(
!
nStartCp
)
{
{
if
(
!
aPcts
.
empty
()
)
if
(
!
m_Pcts
.
empty
()
)
{
{
OSL_ENSURE
(
1
==
aPcts
.
size
(),
"Leeres Piece !
!"
);
OSL_ENSURE
(
1
==
m_Pcts
.
size
(),
"empty Piece
!"
);
aPcts
.
pop_back
(
);
m_Pcts
.
pop_back
(
);
}
}
}
}
...
@@ -1246,39 +1247,40 @@ void WW8_WrPct::AppendPc(WW8_FC nStartFc)
...
@@ -1246,39 +1247,40 @@ void WW8_WrPct::AppendPc(WW8_FC nStartFc)
nStartCp
>>=
1
;
// for Unicode: number of characters / 2
nStartCp
>>=
1
;
// for Unicode: number of characters / 2
if
(
!
aPcts
.
empty
()
)
if
(
!
m_Pcts
.
empty
())
nStartCp
+=
aPcts
.
back
().
GetStartCp
();
{
nStartCp
+=
m_Pcts
.
back
()
->
GetStartCp
();
}
WW8_WrPc
*
pPc
=
new
WW8_WrPc
(
nStartFc
,
nStartCp
);
m_Pcts
.
push_back
(
o3tl
::
make_unique
<
WW8_WrPc
>
(
nStartFc
,
nStartCp
));
aPcts
.
push_back
(
pPc
);
}
}
void
WW8_WrPct
::
WritePc
(
WW8Export
&
rWrt
)
void
WW8_WrPct
::
WritePc
(
WW8Export
&
rWrt
)
{
{
sal_uLong
nPctStart
;
sal_uLong
nPctStart
;
sal_uLong
nOldPos
,
nEndPos
;
sal_uLong
nOldPos
,
nEndPos
;
boost
::
ptr_vector
<
WW8_WrPc
>::
iterator
aIter
;
nPctStart
=
rWrt
.
pTableStrm
->
Tell
();
// Start piece table
nPctStart
=
rWrt
.
pTableStrm
->
Tell
();
// Start piece table
rWrt
.
pTableStrm
->
WriteChar
(
(
char
)
0x02
);
// Status byte PCT
rWrt
.
pTableStrm
->
WriteChar
(
(
char
)
0x02
);
// Status byte PCT
nOldPos
=
nPctStart
+
1
;
// remember Position
nOldPos
=
nPctStart
+
1
;
// remember Position
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
0
);
// then the length
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
0
);
// then the length
for
(
aIter
=
aPcts
.
begin
();
aIter
!=
aPcts
.
end
();
++
aIter
)
// ranges
for
(
auto
const
&
it
:
m_Pcts
)
// ranges
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
{
aIter
->
GetStartCp
()
);
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
it
->
GetStartCp
()
);
}
// calculate the last Pos
// calculate the last Pos
sal_uLong
nStartCp
=
rWrt
.
pFib
->
fcMac
-
nOldFc
;
sal_uLong
nStartCp
=
rWrt
.
pFib
->
fcMac
-
nOldFc
;
nStartCp
>>=
1
;
// For Unicode: number of characters / 2
nStartCp
>>=
1
;
// For Unicode: number of characters / 2
nStartCp
+=
aPcts
.
back
().
GetStartCp
();
nStartCp
+=
m_Pcts
.
back
()
->
GetStartCp
();
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
nStartCp
);
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
nStartCp
);
// piece references
// piece references
for
(
aIter
=
aPcts
.
begin
();
aIter
!=
aPcts
.
end
();
++
aIter
)
for
(
auto
const
&
it
:
m_Pcts
)
{
{
SwWW8Writer
::
WriteShort
(
*
rWrt
.
pTableStrm
,
aIter
->
GetStatus
());
SwWW8Writer
::
WriteShort
(
*
rWrt
.
pTableStrm
,
it
->
GetStatus
());
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
aIter
->
GetStartFc
());
SwWW8Writer
::
WriteLong
(
*
rWrt
.
pTableStrm
,
it
->
GetStartFc
());
SwWW8Writer
::
WriteShort
(
*
rWrt
.
pTableStrm
,
0
);
// PRM=0
SwWW8Writer
::
WriteShort
(
*
rWrt
.
pTableStrm
,
0
);
// PRM=0
}
}
...
@@ -1295,18 +1297,18 @@ void WW8_WrPct::WritePc( WW8Export& rWrt )
...
@@ -1295,18 +1297,18 @@ void WW8_WrPct::WritePc( WW8Export& rWrt )
void
WW8_WrPct
::
SetParaBreak
()
void
WW8_WrPct
::
SetParaBreak
()
{
{
OSL_ENSURE
(
!
aPcts
.
empty
(),
"SetParaBreak : a
Pcts.empty()"
);
OSL_ENSURE
(
!
m_Pcts
.
empty
(),
"SetParaBreak : m_
Pcts.empty()"
);
aPcts
.
back
().
SetStatus
();
m_Pcts
.
back
()
->
SetStatus
();
}
}
WW8_CP
WW8_WrPct
::
Fc2Cp
(
sal_uLong
nFc
)
const
WW8_CP
WW8_WrPct
::
Fc2Cp
(
sal_uLong
nFc
)
const
{
{
OSL_ENSURE
(
nFc
>=
(
sal_uLong
)
nOldFc
,
"FilePos lies in front of last piece"
);
OSL_ENSURE
(
nFc
>=
(
sal_uLong
)
nOldFc
,
"FilePos lies in front of last piece"
);
OSL_ENSURE
(
!
a
Pcts
.
empty
(),
"Fc2Cp no piece available"
);
OSL_ENSURE
(
!
m_
Pcts
.
empty
(),
"Fc2Cp no piece available"
);
nFc
-=
nOldFc
;
nFc
-=
nOldFc
;
nFc
/=
2
;
// Unicode
nFc
/=
2
;
// Unicode
return
nFc
+
aPcts
.
back
().
GetStartCp
();
return
nFc
+
m_Pcts
.
back
()
->
GetStartCp
();
}
}
void
WW8Export
::
AppendBookmarks
(
const
SwTextNode
&
rNd
,
sal_Int32
nAktPos
,
sal_Int32
nLen
)
void
WW8Export
::
AppendBookmarks
(
const
SwTextNode
&
rNd
,
sal_Int32
nAktPos
,
sal_Int32
nLen
)
...
...
sw/source/filter/ww8/wrtww8.hxx
Dosyayı görüntüle @
191ca975
...
@@ -41,6 +41,7 @@
...
@@ -41,6 +41,7 @@
#include <boost/optional.hpp>
#include <boost/optional.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <memory>
#include <map>
#include <map>
#include <vector>
#include <vector>
...
@@ -276,7 +277,7 @@ public:
...
@@ -276,7 +277,7 @@ public:
// class WW8_WrPct to construct the piece table
// class WW8_WrPct to construct the piece table
class
WW8_WrPct
class
WW8_WrPct
{
{
boost
::
ptr_vector
<
WW8_WrPc
>
a
Pcts
;
std
::
vector
<
std
::
unique_ptr
<
WW8_WrPc
>>
m_
Pcts
;
WW8_FC
nOldFc
;
WW8_FC
nOldFc
;
public
:
public
:
explicit
WW8_WrPct
(
WW8_FC
nStartFc
);
explicit
WW8_WrPct
(
WW8_FC
nStartFc
);
...
...
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