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
a8f3f3ee
Kaydet (Commit)
a8f3f3ee
authored
Nis 24, 2012
tarafından
Noel Grandin
Kaydeden (comit)
Michael Stahl
May 09, 2012
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Convert SV_DECL_PTRARR_DEL(SwXMLTableCells_Impl) to ptr_vector
This also triggered the need for some const-ness cleanups.
üst
eb834824
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
18 deletions
+33
-18
xmltbli.cxx
sw/source/filter/xml/xmltbli.cxx
+31
-17
xmltbli.hxx
sw/source/filter/xml/xmltbli.hxx
+2
-1
No files found.
sw/source/filter/xml/xmltbli.cxx
Dosyayı görüntüle @
a8f3f3ee
...
...
@@ -286,9 +286,7 @@ inline void SwXMLTableCell_Impl::Dispose()
// ---------------------------------------------------------------------
typedef
SwXMLTableCell_Impl
*
SwXMLTableCellPtr
;
SV_DECL_PTRARR_DEL
(
SwXMLTableCells_Impl
,
SwXMLTableCellPtr
,
5
)
SV_IMPL_PTRARR
(
SwXMLTableCells_Impl
,
SwXMLTableCellPtr
)
typedef
boost
::
ptr_vector
<
SwXMLTableCell_Impl
>
SwXMLTableCells_Impl
;
class
SwXMLTableRow_Impl
{
...
...
@@ -307,7 +305,8 @@ public:
const
OUString
&
i_rXmlId
=
OUString
()
);
~
SwXMLTableRow_Impl
()
{}
inline
SwXMLTableCell_Impl
*
GetCell
(
sal_uInt32
nCol
)
const
;
inline
const
SwXMLTableCell_Impl
*
GetCell
(
sal_uInt32
nCol
)
const
;
inline
SwXMLTableCell_Impl
*
GetCell
(
sal_uInt32
nCol
);
inline
void
Set
(
const
OUString
&
rStyleName
,
const
OUString
&
rDfltCellStyleName
,
...
...
@@ -342,18 +341,28 @@ SwXMLTableRow_Impl::SwXMLTableRow_Impl( const OUString& rStyleName,
for
(
sal_uInt16
i
=
0U
;
i
<
nCells
;
i
++
)
{
aCells
.
Insert
(
new
SwXMLTableCell_Impl
,
aCells
.
Count
()
);
aCells
.
push_back
(
new
SwXMLTableCell_Impl
);
}
}
inline
SwXMLTableCell_Impl
*
SwXMLTableRow_Impl
::
GetCell
(
sal_uInt32
nCol
)
const
inline
const
SwXMLTableCell_Impl
*
SwXMLTableRow_Impl
::
GetCell
(
sal_uInt32
nCol
)
const
{
OSL_ENSURE
(
nCol
<
USHRT_MAX
,
"SwXMLTableRow_Impl::GetCell: column number is to big"
);
// #i95726# - some fault tolerance
OSL_ENSURE
(
nCol
<
aCells
.
Count
(),
"SwXMLTableRow_Impl::GetCell: column number is out of bound"
);
return
nCol
<
aCells
.
Count
()
?
aCells
[(
sal_uInt16
)
nCol
]
:
0
;
return
nCol
<
aCells
.
size
()
?
&
aCells
[(
sal_uInt16
)
nCol
]
:
0
;
}
inline
SwXMLTableCell_Impl
*
SwXMLTableRow_Impl
::
GetCell
(
sal_uInt32
nCol
)
{
OSL_ENSURE
(
nCol
<
USHRT_MAX
,
"SwXMLTableRow_Impl::GetCell: column number is to big"
);
// #i95726# - some fault tolerance
OSL_ENSURE
(
nCol
<
aCells
.
Count
(),
"SwXMLTableRow_Impl::GetCell: column number is out of bound"
);
return
nCol
<
aCells
.
size
()
?
&
aCells
[(
sal_uInt16
)
nCol
]
:
0
;
}
void
SwXMLTableRow_Impl
::
Expand
(
sal_uInt32
nCells
,
sal_Bool
bOneCell
)
...
...
@@ -363,12 +372,11 @@ void SwXMLTableRow_Impl::Expand( sal_uInt32 nCells, sal_Bool bOneCell )
if
(
nCells
>
USHRT_MAX
)
nCells
=
USHRT_MAX
;
sal_uInt32
nColSpan
=
nCells
-
aCells
.
Count
();
for
(
sal_uInt16
i
=
aCells
.
Count
();
i
<
nCells
;
i
++
)
sal_uInt32
nColSpan
=
nCells
-
aCells
.
size
();
for
(
sal_uInt16
i
=
aCells
.
size
();
i
<
nCells
;
i
++
)
{
aCells
.
Insert
(
new
SwXMLTableCell_Impl
(
1UL
,
bOneCell
?
nColSpan
:
1UL
),
aCells
.
Count
()
);
aCells
.
push_back
(
new
SwXMLTableCell_Impl
(
1UL
,
bOneCell
?
nColSpan
:
1UL
)
);
nColSpan
--
;
}
...
...
@@ -387,8 +395,8 @@ inline void SwXMLTableRow_Impl::Set( const OUString& rStyleName,
void
SwXMLTableRow_Impl
::
Dispose
()
{
for
(
sal_uInt16
i
=
0
;
i
<
aCells
.
Count
();
i
++
)
aCells
[
i
]
->
Dispose
();
for
(
sal_uInt16
i
=
0
;
i
<
aCells
.
size
();
i
++
)
aCells
[
i
]
.
Dispose
();
}
// ---------------------------------------------------------------------
...
...
@@ -1272,12 +1280,18 @@ public:
typedef
boost
::
ptr_vector
<
SwXMLTableRow_Impl
>
SwXMLTableRows_Impl
;
SwXMLTableCell_Impl
*
SwXMLTableContext
::
GetCell
(
sal_uInt32
nRow
,
const
SwXMLTableCell_Impl
*
SwXMLTableContext
::
GetCell
(
sal_uInt32
nRow
,
sal_uInt32
nCol
)
const
{
return
(
*
pRows
)[(
sal_uInt16
)
nRow
].
GetCell
(
(
sal_uInt16
)
nCol
);
}
SwXMLTableCell_Impl
*
SwXMLTableContext
::
GetCell
(
sal_uInt32
nRow
,
sal_uInt32
nCol
)
{
return
(
*
pRows
)[(
sal_uInt16
)
nRow
].
GetCell
(
(
sal_uInt16
)
nCol
);
}
TYPEINIT1
(
SwXMLTableContext
,
XMLTextTableContext
);
SwXMLTableContext
::
SwXMLTableContext
(
SwXMLImport
&
rImport
,
...
...
@@ -1992,7 +2006,7 @@ SwTableBox *SwXMLTableContext::MakeTableBox( SwTableLine *pUpper,
{
sal_uInt32
nMaxRowSpan
=
0UL
;
SwXMLTableRow_Impl
*
pStartRow
=
&
(
*
pRows
)[(
sal_uInt16
)
nStartRow
];
SwXMLTableCell_Impl
*
pCell
;
const
SwXMLTableCell_Impl
*
pCell
;
for
(
i
=
nLeftCol
;
i
<
nRightCol
;
i
++
)
if
(
(
pCell
=
pStartRow
->
GetCell
(
i
),
pCell
->
GetRowSpan
()
>
nMaxRowSpan
)
)
...
...
@@ -2403,7 +2417,7 @@ void SwXMLTableContext::_MakeTable( SwTableBox *pBox )
if
(
pRows
->
size
()
>
nCurRow
)
{
SwXMLTableRow_Impl
*
pPrevRow
=
&
(
*
pRows
)[(
sal_uInt16
)
nCurRow
-
1U
];
SwXMLTableCell_Impl
*
pCell
;
const
SwXMLTableCell_Impl
*
pCell
;
for
(
sal_uLong
i
=
0
;
i
<
aColumnWidths
.
size
();
++
i
)
{
if
(
(
pCell
=
pPrevRow
->
GetCell
(
i
),
pCell
->
GetRowSpan
()
>
1UL
)
)
...
...
sw/source/filter/xml/xmltbli.hxx
Dosyayı görüntüle @
a8f3f3ee
...
...
@@ -194,7 +194,8 @@ public:
const
::
rtl
::
OUString
&
i_rXmlId
=
::
rtl
::
OUString
()
);
void
FinishRow
();
void
InsertRepRows
(
sal_uInt32
nCount
);
SwXMLTableCell_Impl
*
GetCell
(
sal_uInt32
nRow
,
sal_uInt32
nCol
)
const
;
const
SwXMLTableCell_Impl
*
GetCell
(
sal_uInt32
nRow
,
sal_uInt32
nCol
)
const
;
SwXMLTableCell_Impl
*
GetCell
(
sal_uInt32
nRow
,
sal_uInt32
nCol
);
const
SwStartNode
*
InsertTableSection
(
const
SwStartNode
*
pPrevSttNd
=
0
);
virtual
void
EndElement
();
...
...
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