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
a219bbb6
Kaydet (Commit)
a219bbb6
authored
Eyl 01, 2014
tarafından
Matteo Casalin
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplify by early bailout
Change-Id: I9815ced0495f3066f8b6477794f33bbd77c613ca
üst
6f9f11d4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
82 additions
and
91 deletions
+82
-91
itratr.cxx
sw/source/core/text/itratr.cxx
+82
-91
No files found.
sw/source/core/text/itratr.cxx
Dosyayı görüntüle @
a219bbb6
...
...
@@ -421,125 +421,116 @@ static void lcl_MinMaxNode( SwFrmFmt* pNd, SwMinMaxNodeArgs* pIn )
{
const
SwFmtAnchor
&
rFmtA
=
pNd
->
GetAnchor
();
bool
bCalculate
=
false
;
if
((
FLY_AT_PARA
==
rFmtA
.
GetAnchorId
())
||
(
FLY_AT_CHAR
==
rFmtA
.
GetAnchorId
()))
{
bCalculate
=
true
;
}
if
(
bCalculate
)
{
const
SwPosition
*
pPos
=
rFmtA
.
GetCntntAnchor
();
OSL_ENSURE
(
pPos
&&
pIn
,
"Unexpected NULL arguments"
);
if
(
!
pPos
||
!
pIn
||
pIn
->
nIndx
!=
pPos
->
nNode
.
GetIndex
())
bCalculate
=
false
;
return
;
}
if
(
bCalculate
)
long
nMin
,
nMax
;
SwHTMLTableLayout
*
pLayout
=
0
;
const
bool
bIsDrawFrmFmt
=
pNd
->
Which
()
==
RES_DRAWFRMFMT
;
if
(
!
bIsDrawFrmFmt
)
{
long
nMin
,
nMax
;
SwHTMLTableLayout
*
pLayout
=
0
;
const
bool
bIsDrawFrmFmt
=
pNd
->
Which
()
==
RES_DRAWFRMFMT
;
if
(
!
bIsDrawFrmFmt
)
// Does the frame contain a table at the start or the end?
const
SwNodes
&
rNodes
=
pNd
->
GetDoc
()
->
GetNodes
();
const
SwFmtCntnt
&
rFlyCntnt
=
pNd
->
GetCntnt
();
sal_uLong
nStt
=
rFlyCntnt
.
GetCntntIdx
()
->
GetIndex
();
SwTableNode
*
pTblNd
=
rNodes
[
nStt
+
1
]
->
GetTableNode
();
if
(
!
pTblNd
)
{
// Does the frame contain a table at the start or the end?
const
SwNodes
&
rNodes
=
pNd
->
GetDoc
()
->
GetNodes
();
const
SwFmtCntnt
&
rFlyCntnt
=
pNd
->
GetCntnt
();
sal_uLong
nStt
=
rFlyCntnt
.
GetCntntIdx
()
->
GetIndex
();
SwTableNode
*
pTblNd
=
rNodes
[
nStt
+
1
]
->
GetTableNode
();
if
(
!
pTblNd
)
{
SwNode
*
pNd2
=
rNodes
[
nStt
];
pNd2
=
rNodes
[
pNd2
->
EndOfSectionIndex
()
-
1
];
if
(
pNd2
->
IsEndNode
()
)
pTblNd
=
pNd2
->
StartOfSectionNode
()
->
GetTableNode
();
}
if
(
pTblNd
)
pLayout
=
pTblNd
->
GetTable
().
GetHTMLTableLayout
();
SwNode
*
pNd2
=
rNodes
[
nStt
];
pNd2
=
rNodes
[
pNd2
->
EndOfSectionIndex
()
-
1
];
if
(
pNd2
->
IsEndNode
()
)
pTblNd
=
pNd2
->
StartOfSectionNode
()
->
GetTableNode
();
}
const
SwFmtHoriOrient
&
rOrient
=
pNd
->
GetHoriOrient
();
sal_Int16
eHoriOri
=
rOrient
.
GetHoriOrient
();
if
(
pTblNd
)
pLayout
=
pTblNd
->
GetTable
().
GetHTMLTableLayout
();
}
const
SwFmtHoriOrient
&
rOrient
=
pNd
->
GetHoriOrient
();
sal_Int16
eHoriOri
=
rOrient
.
GetHoriOrient
();
long
nDiff
;
if
(
pLayout
)
long
nDiff
;
if
(
pLayout
)
{
nMin
=
pLayout
->
GetMin
();
nMax
=
pLayout
->
GetMax
();
nDiff
=
nMax
-
nMin
;
}
else
{
if
(
bIsDrawFrmFmt
)
{
nMin
=
pLayout
->
GetMin
();
nMax
=
pLayout
->
GetMax
();
nDiff
=
nMax
-
nMin
;
const
SdrObject
*
pSObj
=
pNd
->
FindSdrObject
();
if
(
pSObj
)
nMin
=
pSObj
->
GetCurrentBoundRect
().
GetWidth
();
else
nMin
=
0
;
}
else
{
if
(
bIsDrawFrmFmt
)
{
const
SdrObject
*
pSObj
=
pNd
->
FindSdrObject
();
if
(
pSObj
)
nMin
=
pSObj
->
GetCurrentBoundRect
().
GetWidth
();
else
nMin
=
0
;
}
else
{
const
SwFmtFrmSize
&
rSz
=
pNd
->
GetFrmSize
();
nMin
=
rSz
.
GetWidth
();
}
nMax
=
nMin
;
nDiff
=
0
;
const
SwFmtFrmSize
&
rSz
=
pNd
->
GetFrmSize
();
nMin
=
rSz
.
GetWidth
();
}
nMax
=
nMin
;
nDiff
=
0
;
}
const
SvxLRSpaceItem
&
rLR
=
pNd
->
GetLRSpace
();
nMin
+=
rLR
.
GetLeft
();
nMin
+=
rLR
.
GetRight
();
nMax
+=
rLR
.
GetLeft
();
nMax
+=
rLR
.
GetRight
();
const
SvxLRSpaceItem
&
rLR
=
pNd
->
GetLRSpace
();
nMin
+=
rLR
.
GetLeft
();
nMin
+=
rLR
.
GetRight
();
nMax
+=
rLR
.
GetLeft
();
nMax
+=
rLR
.
GetRight
();
if
(
SURROUND_THROUGHT
==
pNd
->
GetSurround
().
GetSurround
()
)
{
pIn
->
Minimum
(
nMin
);
return
;
}
if
(
SURROUND_THROUGHT
==
pNd
->
GetSurround
().
GetSurround
()
)
{
pIn
->
Minimum
(
nMin
);
return
;
}
// Frames, which are left- or right-aligned are only party considered
// when calculating the maximum, since the border is already being considered.
// Only if the frame extends into the text body, this part is being added
switch
(
eHoriOri
)
// Frames, which are left- or right-aligned are only party considered
// when calculating the maximum, since the border is already being considered.
// Only if the frame extends into the text body, this part is being added
switch
(
eHoriOri
)
{
case
text
:
:
HoriOrientation
::
RIGHT
:
{
case
text
:
:
HoriOrientation
::
RIGHT
:
if
(
nDiff
)
{
if
(
nDiff
)
{
pIn
->
nRightRest
-=
pIn
->
nRightDiff
;
pIn
->
nRightDiff
=
nDiff
;
}
if
(
text
::
RelOrientation
::
FRAME
!=
rOrient
.
GetRelationOrient
()
)
{
if
(
pIn
->
nRightRest
>
0
)
pIn
->
nRightRest
=
0
;
}
pIn
->
nRightRest
-=
nMin
;
break
;
pIn
->
nRightRest
-=
pIn
->
nRightDiff
;
pIn
->
nRightDiff
=
nDiff
;
}
case
text
:
:
HoriOrientation
::
LEFT
:
if
(
text
::
RelOrientation
::
FRAME
!=
rOrient
.
GetRelationOrient
()
)
{
if
(
nDiff
)
{
pIn
->
nLeftRest
-=
pIn
->
nLeftDiff
;
pIn
->
nLeftDiff
=
nDiff
;
}
if
(
text
::
RelOrientation
::
FRAME
!=
rOrient
.
GetRelationOrient
()
&&
pIn
->
nLeftRest
<
0
)
pIn
->
nLeftRest
=
0
;
pIn
->
nLeftRest
-=
nMin
;
break
;
if
(
pIn
->
nRightRest
>
0
)
pIn
->
nRightRest
=
0
;
}
default:
pIn
->
nRightRest
-=
nMin
;
break
;
}
case
text
:
:
HoriOrientation
::
LEFT
:
{
if
(
nDiff
)
{
pIn
->
n
MaxWidth
+=
nMax
;
pIn
->
Minimum
(
nMin
)
;
pIn
->
n
LeftRest
-=
pIn
->
nLeftDiff
;
pIn
->
nLeftDiff
=
nDiff
;
}
if
(
text
::
RelOrientation
::
FRAME
!=
rOrient
.
GetRelationOrient
()
&&
pIn
->
nLeftRest
<
0
)
pIn
->
nLeftRest
=
0
;
pIn
->
nLeftRest
-=
nMin
;
break
;
}
default:
{
pIn
->
nMaxWidth
+=
nMax
;
pIn
->
Minimum
(
nMin
);
}
}
}
...
...
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