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
bb9114f7
Kaydet (Commit)
bb9114f7
authored
May 11, 2014
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
coverity#705926 Dereference before null check
Change-Id: I5a475d357aed24a01cd4e1e45765f1d6e585ee45
üst
fdd91a28
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
61 deletions
+58
-61
tabfrm.cxx
sw/source/core/layout/tabfrm.cxx
+58
-61
No files found.
sw/source/core/layout/tabfrm.cxx
Dosyayı görüntüle @
bb9114f7
...
@@ -479,7 +479,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
...
@@ -479,7 +479,7 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
SwTwips
nCurrentHeight
=
SwTwips
nCurrentHeight
=
lcl_CalcMinRowHeight
(
pTmpLastLineRow
,
lcl_CalcMinRowHeight
(
pTmpLastLineRow
,
rTab
.
IsConsiderObjsForMinCellHeight
()
);
rTab
.
IsConsiderObjsForMinCellHeight
()
);
while
(
pTmpLastLineRow
&&
pTmpLastLineRow
->
GetNext
()
&&
nTmpCut
>
nCurrentHeight
)
while
(
pTmpLastLineRow
->
GetNext
()
&&
nTmpCut
>
nCurrentHeight
)
{
{
nTmpCut
-=
nCurrentHeight
;
nTmpCut
-=
nCurrentHeight
;
pTmpLastLineRow
=
(
SwRowFrm
*
)
pTmpLastLineRow
->
GetNext
();
pTmpLastLineRow
=
(
SwRowFrm
*
)
pTmpLastLineRow
->
GetNext
();
...
@@ -490,74 +490,71 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
...
@@ -490,74 +490,71 @@ static void lcl_PreprocessRowsInCells( SwTabFrm& rTab, SwRowFrm& rLastLine,
}
}
// pTmpLastLineRow does not fit to the line or it is the last line
// pTmpLastLineRow does not fit to the line or it is the last line
if
(
pTmpLastLineRow
)
// Check if we can move pTmpLastLineRow to the follow table,
// or if we have to split the line:
SwFrm
*
pCell
=
pTmpLastLineRow
->
Lower
();
bool
bTableLayoutToComplex
=
false
;
long
nMinHeight
=
0
;
// We have to take into account:
// 1. The fixed height of the row
// 2. The borders of the cells inside the row
// 3. The minimum height of the row
if
(
pTmpLastLineRow
->
HasFixSize
()
)
nMinHeight
=
(
pTmpLastLineRow
->
Frm
().
*
fnRect
->
fnGetHeight
)();
else
{
{
// Check if we can move pTmpLastLineRow to the follow table,
while
(
pCell
)
// or if we have to split the line:
SwFrm
*
pCell
=
pTmpLastLineRow
->
Lower
();
bool
bTableLayoutToComplex
=
false
;
long
nMinHeight
=
0
;
// We have to take into account:
// 1. The fixed height of the row
// 2. The borders of the cells inside the row
// 3. The minimum height of the row
if
(
pTmpLastLineRow
->
HasFixSize
()
)
nMinHeight
=
(
pTmpLastLineRow
->
Frm
().
*
fnRect
->
fnGetHeight
)();
else
{
{
while
(
pCell
)
if
(
((
SwCellFrm
*
)
pCell
)
->
Lower
()
&&
((
SwCellFrm
*
)
pCell
)
->
Lower
()
->
IsRowFrm
()
)
{
{
if
(
((
SwCellFrm
*
)
pCell
)
->
Lower
()
&&
bTableLayoutToComplex
=
true
;
((
SwCellFrm
*
)
pCell
)
->
Lower
()
->
IsRowFrm
()
)
break
;
{
bTableLayoutToComplex
=
true
;
break
;
}
SwBorderAttrAccess
aAccess
(
SwFrm
::
GetCache
(),
pCell
);
const
SwBorderAttrs
&
rAttrs
=
*
aAccess
.
Get
();
nMinHeight
=
std
::
max
(
nMinHeight
,
lcl_CalcTopAndBottomMargin
(
*
(
SwLayoutFrm
*
)
pCell
,
rAttrs
)
);
pCell
=
pCell
->
GetNext
();
}
}
const
SwFmtFrmSize
&
rSz
=
pTmpLastLineRow
->
GetFmt
()
->
GetFrmSize
();
SwBorderAttrAccess
aAccess
(
SwFrm
::
GetCache
(),
pCell
);
if
(
rSz
.
GetHeightSizeType
()
==
ATT_MIN_SIZE
)
const
SwBorderAttrs
&
rAttrs
=
*
aAccess
.
Get
();
nMinHeight
=
std
::
max
(
nMinHeight
,
rSz
.
GetHeight
()
);
nMinHeight
=
std
::
max
(
nMinHeight
,
lcl_CalcTopAndBottomMargin
(
*
(
SwLayoutFrm
*
)
pCell
,
rAttrs
)
);
pCell
=
pCell
->
GetNext
();
}
}
// 1. Case:
const
SwFmtFrmSize
&
rSz
=
pTmpLastLineRow
->
GetFmt
()
->
GetFrmSize
();
// The line completely fits into the master table.
if
(
rSz
.
GetHeightSizeType
()
==
ATT_MIN_SIZE
)
// Nevertheless, we build a follow (otherwise painting problems
nMinHeight
=
std
::
max
(
nMinHeight
,
rSz
.
GetHeight
()
);
// with empty cell).
}
// 2. Case:
// The line has to be split, the minimum height still fits into
// the master table, and the table structure is not to complex.
if
(
nTmpCut
>
nCurrentHeight
||
(
pTmpLastLineRow
->
IsRowSplitAllowed
()
&&
!
bTableLayoutToComplex
&&
nMinHeight
<
nTmpCut
)
)
{
// The line has to be split:
SwRowFrm
*
pNewRow
=
new
SwRowFrm
(
*
pTmpLastLineRow
->
GetTabLine
(),
&
rTab
,
false
);
pNewRow
->
SetFollowFlowRow
(
true
);
pNewRow
->
SetFollowRow
(
pTmpLastLineRow
->
GetFollowRow
()
);
pTmpLastLineRow
->
SetFollowRow
(
pNewRow
);
pNewRow
->
InsertBehind
(
pCurrFollowFlowLineCell
,
0
);
pTmpLastLineRow
=
(
SwRowFrm
*
)
pTmpLastLineRow
->
GetNext
();
}
// The following lines have to be moved:
// 1. Case:
while
(
pTmpLastLineRow
)
// The line completely fits into the master table.
{
// Nevertheless, we build a follow (otherwise painting problems
SwRowFrm
*
pTmp
=
(
SwRowFrm
*
)
pTmpLastLineRow
->
GetNext
();
// with empty cell).
lcl_MoveFootnotes
(
rTab
,
*
rTab
.
GetFollow
(),
*
pTmpLastLineRow
);
pTmpLastLineRow
->
Remove
();
// 2. Case:
pTmpLastLineRow
->
InsertBefore
(
pCurrFollowFlowLineCell
,
0
);
// The line has to be split, the minimum height still fits into
pTmpLastLineRow
->
Shrink
(
(
pTmpLastLineRow
->
Frm
().
*
fnRect
->
fnGetHeight
)()
);
// the master table, and the table structure is not to complex.
pCurrFollowFlowLineCell
->
Grow
(
(
pTmpLastLineRow
->
Frm
().
*
fnRect
->
fnGetHeight
)()
);
if
(
nTmpCut
>
nCurrentHeight
||
pTmpLastLineRow
=
pTmp
;
(
pTmpLastLineRow
->
IsRowSplitAllowed
()
&&
}
!
bTableLayoutToComplex
&&
nMinHeight
<
nTmpCut
)
)
{
// The line has to be split:
SwRowFrm
*
pNewRow
=
new
SwRowFrm
(
*
pTmpLastLineRow
->
GetTabLine
(),
&
rTab
,
false
);
pNewRow
->
SetFollowFlowRow
(
true
);
pNewRow
->
SetFollowRow
(
pTmpLastLineRow
->
GetFollowRow
()
);
pTmpLastLineRow
->
SetFollowRow
(
pNewRow
);
pNewRow
->
InsertBehind
(
pCurrFollowFlowLineCell
,
0
);
pTmpLastLineRow
=
(
SwRowFrm
*
)
pTmpLastLineRow
->
GetNext
();
}
// The following lines have to be moved:
while
(
pTmpLastLineRow
)
{
SwRowFrm
*
pTmp
=
(
SwRowFrm
*
)
pTmpLastLineRow
->
GetNext
();
lcl_MoveFootnotes
(
rTab
,
*
rTab
.
GetFollow
(),
*
pTmpLastLineRow
);
pTmpLastLineRow
->
Remove
();
pTmpLastLineRow
->
InsertBefore
(
pCurrFollowFlowLineCell
,
0
);
pTmpLastLineRow
->
Shrink
(
(
pTmpLastLineRow
->
Frm
().
*
fnRect
->
fnGetHeight
)()
);
pCurrFollowFlowLineCell
->
Grow
(
(
pTmpLastLineRow
->
Frm
().
*
fnRect
->
fnGetHeight
)()
);
pTmpLastLineRow
=
pTmp
;
}
}
}
}
...
...
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