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
79d93c7d
Kaydet (Commit)
79d93c7d
authored
Mar 01, 2017
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix leak
Change-Id: I985d422f4c0b41937e4df616fb3154bb7cbad28d
üst
3dcde4bb
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
98 additions
and
114 deletions
+98
-114
lwpcelllayout.cxx
lotuswordpro/source/filter/lwpcelllayout.cxx
+19
-20
lwpcelllayout.hxx
lotuswordpro/source/filter/lwpcelllayout.hxx
+3
-3
lwprowlayout.cxx
lotuswordpro/source/filter/lwprowlayout.cxx
+20
-20
lwptablelayout.cxx
lotuswordpro/source/filter/lwptablelayout.cxx
+26
-27
xfrow.cxx
lotuswordpro/source/filter/xfilter/xfrow.cxx
+9
-15
xfrow.hxx
lotuswordpro/source/filter/xfilter/xfrow.hxx
+3
-2
xftable.cxx
lotuswordpro/source/filter/xfilter/xftable.cxx
+16
-25
xftable.hxx
lotuswordpro/source/filter/xfilter/xftable.hxx
+2
-2
No files found.
lotuswordpro/source/filter/lwpcelllayout.cxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -310,7 +310,7 @@ OUString const & LwpCellLayout::GetCellStyleName(sal_uInt16 nRow, sal_uInt16 nCo
* @param bIsRightCol - whether current cell is the rightest column
* @return XFCell*
*/
XFCell
*
LwpCellLayout
::
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
rtl
::
Reference
<
XFCell
>
LwpCellLayout
::
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
{
// if cell layout is aTableID's default cell layout
// it can't have any content, bypass these code
...
...
@@ -320,7 +320,7 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI
assert
(
false
);
return
nullptr
;
}
XFCell
*
pXFCell
=
new
XFCell
(
);
rtl
::
Reference
<
XFCell
>
xXFCell
(
new
XFCell
);
OUString
aStyleName
=
m_StyleName
;
// if cell layout is aTableID's default cell layout
...
...
@@ -334,12 +334,12 @@ XFCell* LwpCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow, sal_uI
LwpStory
*
pStory
=
dynamic_cast
<
LwpStory
*>
(
m_Content
.
obj
().
get
());
if
(
pStory
)
{
pStory
->
XFConvert
(
pXFCell
);
pStory
->
XFConvert
(
xXFCell
.
get
()
);
}
ApplyProtect
(
pXFCell
,
aTableID
);
p
XFCell
->
SetStyleName
(
aStyleName
);
return
p
XFCell
;
ApplyProtect
(
xXFCell
.
get
()
,
aTableID
);
x
XFCell
->
SetStyleName
(
aStyleName
);
return
x
XFCell
;
}
LwpPara
*
LwpCellLayout
::
GetLastParaOfPreviousStory
()
...
...
@@ -824,21 +824,20 @@ void LwpConnectedCellLayout::Read()
m_pObjStrm
->
SkipExtra
();
}
XFCell
*
LwpConnectedCellLayout
::
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
rtl
::
Reference
<
XFCell
>
LwpConnectedCellLayout
::
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
{
XFCell
*
pXFCell
=
LwpCellLayout
::
ConvertCell
(
aTableID
,
nRow
,
nCol
);
pXFCell
->
SetColumnSpaned
(
cnumcols
);
// if(!m_bSplitFlag)
// {
// }
return
pXFCell
;
rtl
::
Reference
<
XFCell
>
xXFCell
=
LwpCellLayout
::
ConvertCell
(
aTableID
,
nRow
,
nCol
);
xXFCell
->
SetColumnSpaned
(
cnumcols
);
return
xXFCell
;
}
/**
* @short parse connected cell layout
* @param pOutputStream - output stream
* @return
*/
void
LwpConnectedCellLayout
::
Parse
(
IXFStream
*
/*pOutputStream*/
)
void
LwpConnectedCellLayout
::
Parse
(
IXFStream
*
/*pOutputStream*/
)
{
}
...
...
@@ -876,7 +875,7 @@ void LwpHiddenCellLayout::Read()
* @return XFCell * - pointer to converted cell
*/
XFCell
*
LwpHiddenCellLayout
::
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
rtl
::
Reference
<
XFCell
>
LwpHiddenCellLayout
::
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
{
if
(
!
cconnectedlayout
.
obj
().
is
())
return
nullptr
;
...
...
@@ -886,26 +885,26 @@ XFCell* LwpHiddenCellLayout::ConvertCell(LwpObjectID aTableID, sal_uInt16 nRow,
return
nullptr
;
// if the hidden cell should be displayed for limit of SODC
// use the default cell layout
XFCell
*
pXFCell
=
nullptr
;
rtl
::
Reference
<
XFCell
>
xXFCell
;
LwpTable
*
pTable
=
dynamic_cast
<
LwpTable
*>
(
aTableID
.
obj
().
get
());
if
(
pTable
)
{
LwpCellLayout
*
pDefault
=
dynamic_cast
<
LwpCellLayout
*>
(
pTable
->
GetDefaultCellStyle
().
obj
().
get
());
if
(
pDefault
)
{
p
XFCell
=
pDefault
->
ConvertCell
(
aTableID
,
nRow
,
nCol
);
x
XFCell
=
pDefault
->
ConvertCell
(
aTableID
,
nRow
,
nCol
);
}
else
{
p
XFCell
=
pConnCell
->
ConvertCell
(
aTableID
,
nRow
,
nCol
);
x
XFCell
=
pConnCell
->
ConvertCell
(
aTableID
,
nRow
,
nCol
);
}
p
XFCell
->
SetColumnSpaned
(
pConnCell
->
GetNumcols
());
x
XFCell
->
SetColumnSpaned
(
pConnCell
->
GetNumcols
());
}
else
{
assert
(
false
);
}
return
p
XFCell
;
return
x
XFCell
;
}
/**
* @short parse hidden cell layout
...
...
lotuswordpro/source/filter/lwpcelllayout.hxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -89,7 +89,7 @@ public:
LwpCellLayout
(
LwpObjectHeader
&
objHdr
,
LwpSvStream
*
pStrm
);
virtual
~
LwpCellLayout
()
override
;
virtual
LWP_LAYOUT_TYPE
GetLayoutType
()
override
{
return
LWP_CELL_LAYOUT
;}
virtual
XFCell
*
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
);
virtual
rtl
::
Reference
<
XFCell
>
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
);
sal_uInt16
GetRowID
(){
return
crowid
;}
sal_uInt8
GetColID
(){
return
ccolid
;}
void
RegisterStyle
()
override
;
...
...
@@ -147,7 +147,7 @@ public:
virtual
~
LwpHiddenCellLayout
()
override
;
virtual
LWP_LAYOUT_TYPE
GetLayoutType
()
override
{
return
LWP_HIDDEN_CELL_LAYOUT
;}
virtual
void
Parse
(
IXFStream
*
pOutputStream
)
override
;
virtual
XFCell
*
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
override
;
virtual
rtl
::
Reference
<
XFCell
>
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
override
;
void
RegisterStyle
()
override
{}
virtual
void
SetCellMap
()
override
;
protected
:
...
...
@@ -166,7 +166,7 @@ public:
virtual
~
LwpConnectedCellLayout
()
override
;
virtual
LWP_LAYOUT_TYPE
GetLayoutType
()
override
{
return
LWP_CONNECTED_CELL_LAYOUT
;}
virtual
void
Parse
(
IXFStream
*
pOutputStream
)
override
;
virtual
XFCell
*
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
override
;
virtual
rtl
::
Reference
<
XFCell
>
ConvertCell
(
LwpObjectID
aTableID
,
sal_uInt16
nRow
,
sal_uInt16
nCol
)
override
;
sal_uInt16
GetNumrows
(){
return
m_nRealrowspan
;}
sal_uInt8
GetNumcols
(){
return
m_nRealcolspan
;}
virtual
void
SetCellMap
()
override
;
...
...
lotuswordpro/source/filter/lwprowlayout.cxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -194,13 +194,13 @@ void LwpRowLayout::ConvertRow(rtl::Reference<XFTable> const & pXFTable,sal_uInt8
//register connect row style
sal_uInt16
nRowMark
=
crowid
+
GetCurMaxSpannedRows
(
nStartCol
,
nEndCol
);
XFRow
*
pXFRow
=
new
XFRow
;
RegisterCurRowStyle
(
pXFRow
,
nRowMark
);
rtl
::
Reference
<
XFRow
>
xXFRow
(
new
XFRow
)
;
RegisterCurRowStyle
(
xXFRow
.
get
(),
nRowMark
);
//if there is connected cell
for
(
sal_uInt8
i
=
nStartCol
;
i
<
nEndCol
;
)
{
XFCell
*
p
XFCell
;
rtl
::
Reference
<
XFCell
>
x
XFCell
;
sal_uInt8
nColMark
;
if
(
nMarkConnCell
==
-
1
)
...
...
@@ -210,18 +210,18 @@ void LwpRowLayout::ConvertRow(rtl::Reference<XFTable> const & pXFTable,sal_uInt8
if
(
nColMark
>
i
)
//create subtable
{
pXFCell
=
new
XFCell
;
p
XFCell
->
SetColumnSpaned
(
nColMark
-
i
);
xXFCell
.
set
(
new
XFCell
)
;
x
XFCell
->
SetColumnSpaned
(
nColMark
-
i
);
XFTable
*
pSubTable
=
new
XFTable
;
pTableLayout
->
ConvertTable
(
pSubTable
,
crowid
,
nRowMark
,
i
,
nColMark
);
p
XFCell
->
Add
(
pSubTable
);
x
XFCell
->
Add
(
pSubTable
);
i
=
nColMark
;
}
else
{
sal_uInt8
nColID
=
m_ConnCellList
[
nMarkConnCell
]
->
GetColID
()
+
m_ConnCellList
[
nMarkConnCell
]
->
GetNumcols
()
-
1
;
p
XFCell
=
m_ConnCellList
[
nMarkConnCell
]
->
ConvertCell
(
x
XFCell
=
m_ConnCellList
[
nMarkConnCell
]
->
ConvertCell
(
pTable
->
GetObjectID
(),
crowid
+
m_ConnCellList
[
nMarkConnCell
]
->
GetNumrows
()
-
1
,
m_ConnCellList
[
nMarkConnCell
]
->
GetColID
());
...
...
@@ -229,16 +229,16 @@ void LwpRowLayout::ConvertRow(rtl::Reference<XFTable> const & pXFTable,sal_uInt8
//set all cell in this merge cell to cellsmap
for
(
sal_uInt16
nRowLoop
=
crowid
;
nRowLoop
<
nRowMark
;
nRowLoop
++
)
for
(
sal_uInt8
nColLoop
=
i
;
nColLoop
<
nColID
+
1
;
nColLoop
++
)
pTableLayout
->
SetCellsMap
(
nRowLoop
,
nColLoop
,
pXFCell
);
pTableLayout
->
SetCellsMap
(
nRowLoop
,
nColLoop
,
xXFCell
.
get
()
);
i
+=
m_ConnCellList
[
nMarkConnCell
]
->
GetNumcols
();
nMarkConnCell
=
FindNextMarkConnCell
(
static_cast
<
sal_uInt16
>
(
nMarkConnCell
),
nEndCol
);
}
if
(
p
XFCell
)
pXFRow
->
AddCell
(
p
XFCell
);
if
(
x
XFCell
)
xXFRow
->
AddCell
(
x
XFCell
);
}
pXFTable
->
AddRow
(
p
XFRow
);
pXFTable
->
AddRow
(
x
XFRow
);
}
/**
...
...
@@ -367,10 +367,9 @@ void LwpRowLayout::ConvertCommonRow(rtl::Reference<XFTable> const & pXFTable, sa
if
(
!
pTableLayout
)
return
;
XFRow
*
pRow
=
new
XFRow
;
p
Row
->
SetStyleName
(
m_StyleName
);
rtl
::
Reference
<
XFRow
>
xRow
(
new
XFRow
)
;
x
Row
->
SetStyleName
(
m_StyleName
);
XFCell
*
pCell
=
nullptr
;
LwpTable
*
pTable
=
pTableLayout
->
GetTable
();
sal_uInt8
nCellStartCol
,
nCellEndCol
;
...
...
@@ -381,6 +380,7 @@ void LwpRowLayout::ConvertCommonRow(rtl::Reference<XFTable> const & pXFTable, sa
LwpCellLayout
*
pCellLayout
=
dynamic_cast
<
LwpCellLayout
*>
(
rCellID
.
obj
().
get
());
nCellStartCol
=
i
;
//mark the begin position of cell
nCellEndCol
=
i
;
//mark the end position of cell
rtl
::
Reference
<
XFCell
>
xCell
;
while
(
pCellLayout
)
{
if
(
pCellLayout
->
GetColID
()
==
i
)
...
...
@@ -391,7 +391,7 @@ void LwpRowLayout::ConvertCommonRow(rtl::Reference<XFTable> const & pXFTable, sa
nCellEndCol
=
i
+
pConnCell
->
GetNumcols
()
-
1
;
i
=
nCellEndCol
;
}
p
Cell
=
pCellLayout
->
ConvertCell
(
pTable
->
GetObjectID
(),
crowid
,
i
);
x
Cell
=
pCellLayout
->
ConvertCell
(
pTable
->
GetObjectID
(),
crowid
,
i
);
break
;
}
rCellID
=
pCellLayout
->
GetNext
();
...
...
@@ -404,21 +404,21 @@ void LwpRowLayout::ConvertCommonRow(rtl::Reference<XFTable> const & pXFTable, sa
LwpCellLayout
*
pDefaultCell
=
pTableLayout
->
GetDefaultCellLayout
();
if
(
pDefaultCell
)
{
p
Cell
=
pDefaultCell
->
ConvertCell
(
x
Cell
=
pDefaultCell
->
ConvertCell
(
pTable
->
GetObjectID
(),
crowid
,
i
);
}
else
{
pCell
=
new
XFCell
;
xCell
.
set
(
new
XFCell
)
;
}
}
pRow
->
AddCell
(
p
Cell
);
xRow
->
AddCell
(
x
Cell
);
for
(
sal_uInt8
j
=
nCellStartCol
;
j
<=
nCellEndCol
;
j
++
)
pTableLayout
->
SetCellsMap
(
crowid
,
j
,
pCell
);
//set to cellsmap
pTableLayout
->
SetCellsMap
(
crowid
,
j
,
xCell
.
get
()
);
//set to cellsmap
}
pXFTable
->
AddRow
(
p
Row
);
pXFTable
->
AddRow
(
x
Row
);
}
/**
* @short collect merge cell info when register row styles
...
...
lotuswordpro/source/filter/lwptablelayout.cxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -918,49 +918,48 @@ void LwpTableLayout::SplitRowToCells(XFTable* pTmpTable, rtl::Reference<XFTable>
pXFRow
->
SetStyleName
(
pXFStyleManager
->
AddStyle
(
pRowStyle
).
m_pStyle
->
GetStyleName
());
//construct heading row
XFCell
*
pXFCell1
=
new
XFCell
;
XFCell
*
pXFCell2
=
new
XFCell
;
rtl
::
Reference
<
XFCell
>
xXFCell1
(
new
XFCell
)
;
rtl
::
Reference
<
XFCell
>
xXFCell2
(
new
XFCell
)
;
XFTable
*
pSubTable1
=
new
XFTable
;
XFTable
*
pSubTable2
=
new
XFTable
;
XFRow
*
pNewRow
;
XFRow
*
pOldRow
;
XFCell
*
p
NewCell
;
rtl
::
Reference
<
XFCell
>
x
NewCell
;
for
(
i
=
1
;
i
<=
nRowNum
;
i
++
)
{
pOldRow
=
pTmpTable
->
GetRow
(
i
);
pNewRow
=
new
XFRow
;
p
NewRow
->
SetStyleName
(
pOldRow
->
GetStyleName
());
rtl
::
Reference
<
XFRow
>
xNewRow
(
new
XFRow
)
;
x
NewRow
->
SetStyleName
(
pOldRow
->
GetStyleName
());
for
(
j
=
1
;
j
<=
pCellMark
[
i
];
j
++
)
{
p
NewCell
=
pOldRow
->
GetCell
(
j
);
pNewRow
->
AddCell
(
p
NewCell
);
x
NewCell
=
pOldRow
->
GetCell
(
j
);
xNewRow
->
AddCell
(
x
NewCell
);
}
pSubTable1
->
AddRow
(
p
NewRow
);
pSubTable1
->
AddRow
(
x
NewRow
);
}
ConvertColumn
(
pSubTable1
,
0
,
nFirstColSpann
);
//add column info
p
XFCell1
->
Add
(
pSubTable1
);
p
XFCell1
->
SetColumnSpaned
(
nFirstColSpann
);
pXFRow
->
AddCell
(
p
XFCell1
);
x
XFCell1
->
Add
(
pSubTable1
);
x
XFCell1
->
SetColumnSpaned
(
nFirstColSpann
);
pXFRow
->
AddCell
(
x
XFCell1
);
for
(
i
=
1
;
i
<=
nRowNum
;
i
++
)
{
pOldRow
=
pTmpTable
->
GetRow
(
i
);
pNewRow
=
new
XFRow
;
p
NewRow
->
SetStyleName
(
pOldRow
->
GetStyleName
());
rtl
::
Reference
<
XFRow
>
xNewRow
(
new
XFRow
)
;
x
NewRow
->
SetStyleName
(
pOldRow
->
GetStyleName
());
for
(
j
=
pCellMark
[
i
]
+
1
;
j
<=
pOldRow
->
GetCellCount
();
j
++
)
{
p
NewCell
=
pOldRow
->
GetCell
(
j
);
pNewRow
->
AddCell
(
p
NewCell
);
x
NewCell
=
pOldRow
->
GetCell
(
j
);
xNewRow
->
AddCell
(
x
NewCell
);
}
pSubTable2
->
AddRow
(
p
NewRow
);
pSubTable2
->
AddRow
(
x
NewRow
);
}
ConvertColumn
(
pSubTable2
,
nFirstColSpann
,
nCol
);
//add column info
p
XFCell2
->
Add
(
pSubTable2
);
p
XFCell2
->
SetColumnSpaned
(
nCol
-
nFirstColSpann
);
pXFRow
->
AddCell
(
p
XFCell2
);
x
XFCell2
->
Add
(
pSubTable2
);
x
XFCell2
->
SetColumnSpaned
(
nCol
-
nFirstColSpann
);
pXFRow
->
AddCell
(
x
XFCell2
);
pXFTable
->
AddHeaderRow
(
pXFRow
);
...
...
@@ -1341,27 +1340,27 @@ void LwpTableLayout::ConvertDefaultRow(rtl::Reference<XFTable> const & pXFTable,
sal_uInt8
nEndCol
,
sal_uInt16
nRowID
)
{
// current row doesn't exist in the file
XFRow
*
pRow
=
new
XFRow
(
);
p
Row
->
SetStyleName
(
m_DefaultRowStyleName
);
rtl
::
Reference
<
XFRow
>
xRow
(
new
XFRow
);
x
Row
->
SetStyleName
(
m_DefaultRowStyleName
);
for
(
sal_uInt16
j
=
0
;
j
<
nEndCol
-
nStartCol
;
j
++
)
{
// if table has default cell layout, use it to ConvertCell
// otherwise use blank cell
XFCell
*
pCell
=
nullptr
;
rtl
::
Reference
<
XFCell
>
xCell
;
if
(
m_pDefaultCellLayout
)
{
p
Cell
=
m_pDefaultCellLayout
->
ConvertCell
(
x
Cell
=
m_pDefaultCellLayout
->
ConvertCell
(
GetTable
()
->
GetObjectID
(),
nRowID
,
j
+
nStartCol
);
}
else
{
pCell
=
new
XFCell
(
);
xCell
.
set
(
new
XFCell
);
}
pRow
->
AddCell
(
p
Cell
);
xRow
->
AddCell
(
x
Cell
);
}
pXFTable
->
AddRow
(
p
Row
);
pXFTable
->
AddRow
(
x
Row
);
}
/**
* @short set cell map info
...
...
lotuswordpro/source/filter/xfilter/xfrow.cxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -75,25 +75,19 @@ XFRow::XFRow()
XFRow
::~
XFRow
()
{
std
::
map
<
sal_Int32
,
XFCell
*>::
iterator
it
;
for
(
it
=
m_aCells
.
begin
();
it
!=
m_aCells
.
end
();
++
it
)
{
XFCell
*
pCell
=
(
*
it
).
second
;
delete
pCell
;
}
}
void
XFRow
::
AddCell
(
XFCell
*
p
Cell
)
void
XFRow
::
AddCell
(
rtl
::
Reference
<
XFCell
>&
r
Cell
)
{
if
(
!
pCell
)
if
(
!
rCell
)
return
;
sal_Int32
col
=
m_aCells
.
size
()
+
1
;
p
Cell
->
SetCol
(
col
);
p
Cell
->
SetOwnerRow
(
this
);
m_aCells
[
col
]
=
p
Cell
;
r
Cell
->
SetCol
(
col
);
r
Cell
->
SetOwnerRow
(
this
);
m_aCells
[
col
]
=
r
Cell
;
}
sal_Int32
XFRow
::
GetCellCount
()
const
sal_Int32
XFRow
::
GetCellCount
()
const
{
return
m_aCells
.
size
();
}
...
...
@@ -103,7 +97,7 @@ XFCell* XFRow::GetCell(sal_Int32 col) const
if
(
m_aCells
.
find
(
col
)
==
m_aCells
.
end
()
)
return
nullptr
;
else
return
m_aCells
.
find
(
col
)
->
second
;
return
m_aCells
.
find
(
col
)
->
second
.
get
()
;
}
void
XFRow
::
ToXml
(
IXFStream
*
pStrm
)
...
...
@@ -118,11 +112,11 @@ void XFRow::ToXml(IXFStream *pStrm)
pAttrList
->
AddAttribute
(
"table:number-rows-repeated"
,
OUString
::
number
(
m_nRepeat
)
);
pStrm
->
StartElement
(
"table:table-row"
);
std
::
map
<
sal_Int32
,
XFCell
*>::
iterator
it
=
m_aCells
.
begin
();
auto
it
=
m_aCells
.
begin
();
for
(
;
it
!=
m_aCells
.
end
();
++
it
)
{
int
col
=
(
*
it
).
first
;
XFCell
*
pCell
=
(
*
it
).
second
;
XFCell
*
pCell
=
(
*
it
).
second
.
get
()
;
if
(
!
pCell
)
continue
;
if
(
col
>
lastCol
+
1
)
...
...
lotuswordpro/source/filter/xfilter/xfrow.hxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -61,6 +61,7 @@
#define INCLUDED_LOTUSWORDPRO_SOURCE_FILTER_XFILTER_XFROW_HXX
#include "xfcontent.hxx"
#include <rtl/ref.hxx>
#include <map>
class
XFCell
;
...
...
@@ -73,7 +74,7 @@ public:
virtual
~
XFRow
()
override
;
public
:
void
AddCell
(
XFCell
*
p
Cell
);
void
AddCell
(
rtl
::
Reference
<
XFCell
>&
r
Cell
);
void
SetRepeated
(
sal_Int32
repeat
);
...
...
@@ -95,7 +96,7 @@ public:
private
:
XFTable
*
m_pOwnerTable
;
std
::
map
<
sal_Int32
,
XFCell
*
>
m_aCells
;
std
::
map
<
sal_Int32
,
rtl
::
Reference
<
XFCell
>
>
m_aCells
;
sal_Int32
m_nRepeat
;
sal_Int32
m_nRow
;
};
...
...
lotuswordpro/source/filter/xfilter/xftable.cxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -72,12 +72,6 @@ XFTable::XFTable()
XFTable
::~
XFTable
()
{
std
::
map
<
sal_uInt16
,
XFRow
*>::
iterator
it
;
for
(
it
=
m_aRows
.
begin
();
it
!=
m_aRows
.
end
();
++
it
)
{
XFRow
*
pRow
=
(
*
it
).
second
;
delete
pRow
;
}
m_aRows
.
clear
();
m_aColumns
.
clear
();
}
...
...
@@ -87,28 +81,26 @@ void XFTable::SetColumnStyle(sal_Int32 col, const OUString& style)
m_aColumns
[
col
]
=
style
;
}
void
XFTable
::
AddRow
(
XFRow
*
p
Row
)
void
XFTable
::
AddRow
(
rtl
::
Reference
<
XFRow
>&
r
Row
)
{
assert
(
pRow
);
assert
(
rRow
.
get
()
);
for
(
sal_Int32
i
=
0
;
i
<
p
Row
->
GetCellCount
();
++
i
)
for
(
sal_Int32
i
=
0
;
i
<
r
Row
->
GetCellCount
();
++
i
)
{
XFCell
*
pFirstCell
=
p
Row
->
GetCell
(
i
+
1
);
//starts at 1, not 0
XFCell
*
pFirstCell
=
r
Row
->
GetCell
(
i
+
1
);
//starts at 1, not 0
if
(
pFirstCell
->
GetSubTable
()
==
this
)
throw
std
::
runtime_error
(
"table is a subtable of itself"
);
}
int
row
=
p
Row
->
GetRow
();
int
row
=
r
Row
->
GetRow
();
if
(
row
<
1
)
p
Row
->
SetRow
(
m_aRows
.
size
()
+
1
);
r
Row
->
SetRow
(
m_aRows
.
size
()
+
1
);
row
=
pRow
->
GetRow
();
if
(
m_aRows
.
find
(
row
)
!=
m_aRows
.
end
()
)
delete
m_aRows
[
row
];
row
=
rRow
->
GetRow
();
p
Row
->
SetOwnerTable
(
this
);
m_aRows
[
row
]
=
p
Row
;
r
Row
->
SetOwnerTable
(
this
);
m_aRows
[
row
]
=
r
Row
;
}
void
XFTable
::
AddHeaderRow
(
XFRow
*
pRow
)
...
...
@@ -133,8 +125,7 @@ OUString XFTable::GetTableName()
sal_uInt16
XFTable
::
GetRowCount
()
{
sal_uInt16
rowMax
=
0
;
std
::
map
<
sal_uInt16
,
XFRow
*>::
iterator
it
;
for
(
it
=
m_aRows
.
begin
();
it
!=
m_aRows
.
end
();
++
it
)
for
(
auto
it
=
m_aRows
.
begin
();
it
!=
m_aRows
.
end
();
++
it
)
{
if
(
it
->
first
>
rowMax
)
rowMax
=
it
->
first
;
...
...
@@ -145,7 +136,7 @@ sal_uInt16 XFTable::GetRowCount()
XFRow
*
XFTable
::
GetRow
(
sal_Int32
row
)
{
return
m_aRows
[
row
];
return
m_aRows
[
row
]
.
get
()
;
}
sal_Int32
XFTable
::
GetColumnCount
()
...
...
@@ -226,11 +217,11 @@ void XFTable::ToXml(IXFStream *pStrm)
{
int
lastRow
=
0
;
std
::
map
<
sal_uInt16
,
XFRow
*
>::
iterator
it
=
m_aRows
.
begin
();
auto
it
=
m_aRows
.
begin
();
for
(
;
it
!=
m_aRows
.
end
();
++
it
)
{
int
row
=
(
*
it
).
first
;
XFRow
*
pRow
=
(
*
it
).
second
;
XFRow
*
pRow
=
(
*
it
).
second
.
get
()
;
//null row repeated:
if
(
row
>
lastRow
+
1
)
...
...
@@ -239,9 +230,9 @@ void XFTable::ToXml(IXFStream *pStrm)
pNullRow
->
SetStyleName
(
m_strDefRowStyle
);
if
(
row
>
lastRow
+
2
)
pNullRow
->
SetRepeated
(
row
-
lastRow
-
1
);
XFCell
*
pCell
=
new
XFCell
(
);
p
Cell
->
SetStyleName
(
m_strDefCellStyle
);
pNullRow
->
AddCell
(
p
Cell
);
rtl
::
Reference
<
XFCell
>
xCell
(
new
XFCell
);
x
Cell
->
SetStyleName
(
m_strDefCellStyle
);
pNullRow
->
AddCell
(
x
Cell
);
pNullRow
->
ToXml
(
pStrm
);
}
pRow
->
ToXml
(
pStrm
);
...
...
lotuswordpro/source/filter/xfilter/xftable.hxx
Dosyayı görüntüle @
79d93c7d
...
...
@@ -79,7 +79,7 @@ public:
void
SetColumnStyle
(
sal_Int32
col
,
const
OUString
&
style
);
void
AddRow
(
XFRow
*
p
Row
);
void
AddRow
(
rtl
::
Reference
<
XFRow
>&
r
Row
);
void
AddHeaderRow
(
XFRow
*
pRow
);
...
...
@@ -110,7 +110,7 @@ private:
bool
m_bSubTable
;
XFCell
*
m_pOwnerCell
;
rtl
::
Reference
<
XFContentContainer
>
m_aHeaderRows
;
std
::
map
<
sal_uInt16
,
XFRow
*
>
m_aRows
;
std
::
map
<
sal_uInt16
,
rtl
::
Reference
<
XFRow
>
>
m_aRows
;
std
::
map
<
sal_Int32
,
OUString
>
m_aColumns
;
OUString
m_strDefCellStyle
;
OUString
m_strDefRowStyle
;
...
...
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