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
51e4d1dc
Kaydet (Commit)
51e4d1dc
authored
Kas 12, 2015
tarafından
Noel Grandin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sc: boost::ptr_vector->std::vector<std::unique_ptr>
Change-Id: I32ae2419ce6f7cce6e3da182c582b49be8dd362f
üst
5f87aafe
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
+10
-9
rtfparse.hxx
sc/source/filter/inc/rtfparse.hxx
+3
-2
rtfparse.cxx
sc/source/filter/rtf/rtfparse.cxx
+7
-7
No files found.
sc/source/filter/inc/rtfparse.hxx
Dosyayı görüntüle @
51e4d1dc
...
@@ -22,7 +22,8 @@
...
@@ -22,7 +22,8 @@
#include "eeparser.hxx"
#include "eeparser.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
#include <vector>
#include <memory>
#include <o3tl/sorted_vector.hxx>
#include <o3tl/sorted_vector.hxx>
struct
ScRTFCellDefault
struct
ScRTFCellDefault
...
@@ -48,7 +49,7 @@ class EditEngine;
...
@@ -48,7 +49,7 @@ class EditEngine;
class
ScRTFParser
:
public
ScEEParser
class
ScRTFParser
:
public
ScEEParser
{
{
private
:
private
:
typedef
boost
::
ptr_vector
<
ScRTFCellDefault
>
DefaultList
;
typedef
std
::
vector
<
std
::
unique_ptr
<
ScRTFCellDefault
>
>
DefaultList
;
DefaultList
maDefaultList
;
DefaultList
maDefaultList
;
size_t
mnCurPos
;
size_t
mnCurPos
;
...
...
sc/source/filter/rtf/rtfparse.cxx
Dosyayı görüntüle @
51e4d1dc
...
@@ -207,7 +207,7 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
...
@@ -207,7 +207,7 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
// Not flush on the right? => new table
// Not flush on the right? => new table
if
(
nLastWidth
&&
!
maDefaultList
.
empty
()
)
if
(
nLastWidth
&&
!
maDefaultList
.
empty
()
)
{
{
const
ScRTFCellDefault
&
rD
=
maDefaultList
.
back
();
const
ScRTFCellDefault
&
rD
=
*
maDefaultList
.
back
().
get
();
if
(
rD
.
nTwips
!=
nLastWidth
)
if
(
rD
.
nTwips
!=
nLastWidth
)
{
{
SCCOL
n1
,
n2
;
SCCOL
n1
,
n2
;
...
@@ -224,14 +224,14 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
...
@@ -224,14 +224,14 @@ void ScRTFParser::NewCellRow( ImportInfo* /*pInfo*/ )
// Build up TwipCols only after nLastWidth comparison!
// Build up TwipCols only after nLastWidth comparison!
for
(
size_t
i
=
0
,
n
=
maDefaultList
.
size
();
i
<
n
;
++
i
)
for
(
size_t
i
=
0
,
n
=
maDefaultList
.
size
();
i
<
n
;
++
i
)
{
{
const
ScRTFCellDefault
&
rD
=
maDefaultList
[
i
]
;
const
ScRTFCellDefault
&
rD
=
*
maDefaultList
[
i
].
get
()
;
SCCOL
nCol
;
SCCOL
nCol
;
if
(
!
SeekTwips
(
rD
.
nTwips
,
&
nCol
)
)
if
(
!
SeekTwips
(
rD
.
nTwips
,
&
nCol
)
)
pColTwips
->
insert
(
rD
.
nTwips
);
pColTwips
->
insert
(
rD
.
nTwips
);
}
}
}
}
pDefMerge
=
nullptr
;
pDefMerge
=
nullptr
;
pActDefault
=
maDefaultList
.
empty
()
?
nullptr
:
&
maDefaultList
[
0
]
;
pActDefault
=
maDefaultList
.
empty
()
?
nullptr
:
maDefaultList
[
0
].
get
()
;
mnCurPos
=
0
;
mnCurPos
=
0
;
OSL_ENSURE
(
pActDefault
,
"NewCellRow: pActDefault==0"
);
OSL_ENSURE
(
pActDefault
,
"NewCellRow: pActDefault==0"
);
}
}
...
@@ -270,7 +270,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
...
@@ -270,7 +270,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
case
RTF_TROWD
:
// denotes table row defauls, before RTF_CELLX
case
RTF_TROWD
:
// denotes table row defauls, before RTF_CELLX
{
{
if
(
!
maDefaultList
.
empty
())
if
(
!
maDefaultList
.
empty
())
nLastWidth
=
maDefaultList
.
back
()
.
nTwips
;
nLastWidth
=
maDefaultList
.
back
()
->
nTwips
;
nColCnt
=
0
;
nColCnt
=
0
;
maDefaultList
.
clear
();
maDefaultList
.
clear
();
...
@@ -289,7 +289,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
...
@@ -289,7 +289,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
{
{
if
(
!
pDefMerge
&&
!
maDefaultList
.
empty
())
if
(
!
pDefMerge
&&
!
maDefaultList
.
empty
())
{
{
pDefMerge
=
&
maDefaultList
.
back
();
pDefMerge
=
maDefaultList
.
back
().
get
();
mnCurPos
=
maDefaultList
.
size
()
-
1
;
mnCurPos
=
maDefaultList
.
size
()
-
1
;
}
}
OSL_ENSURE
(
pDefMerge
,
"RTF_CLMRG: pDefMerge==0"
);
OSL_ENSURE
(
pDefMerge
,
"RTF_CLMRG: pDefMerge==0"
);
...
@@ -304,7 +304,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
...
@@ -304,7 +304,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
bNewDef
=
true
;
bNewDef
=
true
;
pInsDefault
->
nCol
=
nColCnt
;
pInsDefault
->
nCol
=
nColCnt
;
pInsDefault
->
nTwips
=
pInfo
->
nTokenValue
;
// Right cell border
pInsDefault
->
nTwips
=
pInfo
->
nTokenValue
;
// Right cell border
maDefaultList
.
push_back
(
pInsDefault
);
maDefaultList
.
push_back
(
std
::
unique_ptr
<
ScRTFCellDefault
>
(
pInsDefault
)
);
// New free-flying pInsDefault
// New free-flying pInsDefault
pInsDefault
=
new
ScRTFCellDefault
(
pPool
);
pInsDefault
=
new
ScRTFCellDefault
(
pPool
);
if
(
++
nColCnt
>
nColMax
)
if
(
++
nColCnt
>
nColMax
)
...
@@ -359,7 +359,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
...
@@ -359,7 +359,7 @@ void ScRTFParser::ProcToken( ImportInfo* pInfo )
pActDefault
=
nullptr
;
pActDefault
=
nullptr
;
if
(
!
maDefaultList
.
empty
()
&&
(
mnCurPos
+
1
)
<
maDefaultList
.
size
())
if
(
!
maDefaultList
.
empty
()
&&
(
mnCurPos
+
1
)
<
maDefaultList
.
size
())
pActDefault
=
&
maDefaultList
[
++
mnCurPos
]
;
pActDefault
=
maDefaultList
[
++
mnCurPos
].
get
()
;
nLastToken
=
pInfo
->
nToken
;
nLastToken
=
pInfo
->
nToken
;
}
}
...
...
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