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
77a5c974
Kaydet (Commit)
77a5c974
authored
Mar 30, 2016
tarafından
Noel Grandin
Kaydeden (comit)
Noel Grandin
Mar 31, 2016
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
tdf#84938 convert NA_ constants to scoped enum
Change-Id: Id348f202483d17b63c0762a60f8ddc5f01b8e01f
üst
eb20c5c7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
37 deletions
+36
-37
ftnboss.hxx
sw/source/core/inc/ftnboss.hxx
+6
-7
ftnfrm.cxx
sw/source/core/layout/ftnfrm.cxx
+11
-11
wsfrm.cxx
sw/source/core/layout/wsfrm.cxx
+19
-19
No files found.
sw/source/core/inc/ftnboss.hxx
Dosyayı görüntüle @
77a5c974
...
@@ -39,10 +39,9 @@ public:
...
@@ -39,10 +39,9 @@ public:
~
SwSaveFootnoteHeight
();
~
SwSaveFootnoteHeight
();
};
};
#define NA_ONLY_ADJUST 0
enum
class
SwNeighbourAdjust
{
#define NA_GROW_SHRINK 1
OnlyAdjust
,
GrowShrink
,
GrowAdjust
,
AdjustGrow
#define NA_GROW_ADJUST 2
};
#define NA_ADJUST_GROW 3
typedef
std
::
vector
<
SwFootnoteFrame
*>
SwFootnoteFrames
;
typedef
std
::
vector
<
SwFootnoteFrame
*>
SwFootnoteFrames
;
...
@@ -58,7 +57,7 @@ class SwFootnoteBossFrame: public SwLayoutFrame
...
@@ -58,7 +57,7 @@ class SwFootnoteBossFrame: public SwLayoutFrame
SwFootnoteContFrame
*
MakeFootnoteCont
();
SwFootnoteContFrame
*
MakeFootnoteCont
();
SwFootnoteFrame
*
FindFirstFootnote
();
SwFootnoteFrame
*
FindFirstFootnote
();
sal_uInt8
_NeighbourhoodAdjustment
(
const
SwFrame
*
pFrame
)
const
;
SwNeighbourAdjust
_NeighbourhoodAdjustment
(
const
SwFrame
*
pFrame
)
const
;
protected
:
protected
:
void
InsertFootnote
(
SwFootnoteFrame
*
);
void
InsertFootnote
(
SwFootnoteFrame
*
);
...
@@ -119,8 +118,8 @@ public:
...
@@ -119,8 +118,8 @@ public:
SwTextFootnote
*
pAttr
);
SwTextFootnote
*
pAttr
);
// should AdjustNeighbourhood be called (or Grow/Shrink)?
// should AdjustNeighbourhood be called (or Grow/Shrink)?
sal_uInt8
NeighbourhoodAdjustment
(
const
SwFrame
*
pFrame
)
const
SwNeighbourAdjust
NeighbourhoodAdjustment
(
const
SwFrame
*
pFrame
)
const
{
return
IsPageFrame
()
?
NA_ONLY_ADJUST
:
_NeighbourhoodAdjustment
(
pFrame
);
}
{
return
IsPageFrame
()
?
SwNeighbourAdjust
::
OnlyAdjust
:
_NeighbourhoodAdjustment
(
pFrame
);
}
};
};
inline
const
SwLayoutFrame
*
SwFootnoteBossFrame
::
FindBodyCont
()
const
inline
const
SwLayoutFrame
*
SwFootnoteBossFrame
::
FindBodyCont
()
const
...
...
sw/source/core/layout/ftnfrm.cxx
Dosyayı görüntüle @
77a5c974
...
@@ -336,12 +336,12 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
...
@@ -336,12 +336,12 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
nReal
=
0
;
nReal
=
0
;
if
(
nGrow
>
0
)
if
(
nGrow
>
0
)
{
{
sal_uInt8
nAdjust
=
pBoss
->
NeighbourhoodAdjustment
(
this
);
SwNeighbourAdjust
nAdjust
=
pBoss
->
NeighbourhoodAdjustment
(
this
);
if
(
NA_ONLY_ADJUST
==
nAdjust
)
if
(
SwNeighbourAdjust
::
OnlyAdjust
==
nAdjust
)
nReal
=
AdjustNeighbourhood
(
nGrow
,
bTst
);
nReal
=
AdjustNeighbourhood
(
nGrow
,
bTst
);
else
else
{
{
if
(
NA_GROW_ADJUST
==
nAdjust
)
if
(
SwNeighbourAdjust
::
GrowAdjust
==
nAdjust
)
{
{
SwFrame
*
pFootnote
=
Lower
();
SwFrame
*
pFootnote
=
Lower
();
if
(
pFootnote
)
if
(
pFootnote
)
...
@@ -351,12 +351,12 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
...
@@ -351,12 +351,12 @@ SwTwips SwFootnoteContFrame::GrowFrame( SwTwips nDist, bool bTst, bool )
if
(
static_cast
<
SwFootnoteFrame
*>
(
pFootnote
)
->
GetAttr
()
->
GetFootnote
().
IsEndNote
()
)
if
(
static_cast
<
SwFootnoteFrame
*>
(
pFootnote
)
->
GetAttr
()
->
GetFootnote
().
IsEndNote
()
)
{
{
nReal
=
AdjustNeighbourhood
(
nGrow
,
bTst
);
nReal
=
AdjustNeighbourhood
(
nGrow
,
bTst
);
nAdjust
=
NA_GROW_SHRINK
;
// no more AdjustNeighbourhood
nAdjust
=
SwNeighbourAdjust
::
GrowShrink
;
// no more AdjustNeighbourhood
}
}
}
}
}
}
nReal
+=
pBoss
->
Grow
(
nGrow
-
nReal
,
bTst
);
nReal
+=
pBoss
->
Grow
(
nGrow
-
nReal
,
bTst
);
if
(
(
NA_GROW_ADJUST
==
nAdjust
||
NA_ADJUST_GROW
==
nAdjust
)
if
(
(
SwNeighbourAdjust
::
GrowAdjust
==
nAdjust
||
SwNeighbourAdjust
::
AdjustGrow
==
nAdjust
)
&&
nReal
<
nGrow
)
&&
nReal
<
nGrow
)
nReal
+=
AdjustNeighbourhood
(
nGrow
-
nReal
,
bTst
);
nReal
+=
AdjustNeighbourhood
(
nGrow
-
nReal
,
bTst
);
}
}
...
@@ -2495,27 +2495,27 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const
...
@@ -2495,27 +2495,27 @@ SwTwips SwFootnoteBossFrame::GetVarSpace() const
* @see Grow()
* @see Grow()
* @see Shrink()
* @see Shrink()
*/
*/
sal_uInt8
SwFootnoteBossFrame
::
_NeighbourhoodAdjustment
(
const
SwFrame
*
)
const
SwNeighbourAdjust
SwFootnoteBossFrame
::
_NeighbourhoodAdjustment
(
const
SwFrame
*
)
const
{
{
sal_uInt8
nRet
=
NA_ONLY_ADJUST
;
SwNeighbourAdjust
nRet
=
SwNeighbourAdjust
::
OnlyAdjust
;
if
(
GetUpper
()
&&
!
GetUpper
()
->
IsPageBodyFrame
()
)
if
(
GetUpper
()
&&
!
GetUpper
()
->
IsPageBodyFrame
()
)
{
{
// column sections need grow/shrink
// column sections need grow/shrink
if
(
GetUpper
()
->
IsFlyFrame
()
)
if
(
GetUpper
()
->
IsFlyFrame
()
)
nRet
=
NA_GROW_SHRINK
;
nRet
=
SwNeighbourAdjust
::
GrowShrink
;
else
else
{
{
OSL_ENSURE
(
GetUpper
()
->
IsSctFrame
(),
"NeighbourhoodAdjustment: Unexpected Upper"
);
OSL_ENSURE
(
GetUpper
()
->
IsSctFrame
(),
"NeighbourhoodAdjustment: Unexpected Upper"
);
if
(
!
GetNext
()
&&
!
GetPrev
()
)
if
(
!
GetNext
()
&&
!
GetPrev
()
)
nRet
=
NA_GROW_ADJUST
;
// section with a single column (FootnoteAtEnd)
nRet
=
SwNeighbourAdjust
::
GrowAdjust
;
// section with a single column (FootnoteAtEnd)
else
else
{
{
const
SwFrame
*
pTmp
=
Lower
();
const
SwFrame
*
pTmp
=
Lower
();
OSL_ENSURE
(
pTmp
,
"NeighbourhoodAdjustment: Missing Lower()"
);
OSL_ENSURE
(
pTmp
,
"NeighbourhoodAdjustment: Missing Lower()"
);
if
(
!
pTmp
->
GetNext
()
)
if
(
!
pTmp
->
GetNext
()
)
nRet
=
NA_GROW_SHRINK
;
nRet
=
SwNeighbourAdjust
::
GrowShrink
;
else
if
(
!
GetUpper
()
->
IsColLocked
()
)
else
if
(
!
GetUpper
()
->
IsColLocked
()
)
nRet
=
NA_ADJUST_GROW
;
nRet
=
SwNeighbourAdjust
::
AdjustGrow
;
OSL_ENSURE
(
!
pTmp
->
GetNext
()
||
pTmp
->
GetNext
()
->
IsFootnoteContFrame
(),
OSL_ENSURE
(
!
pTmp
->
GetNext
()
||
pTmp
->
GetNext
()
->
IsFootnoteContFrame
(),
"NeighbourhoodAdjustment: Who's that guy?"
);
"NeighbourhoodAdjustment: Who's that guy?"
);
}
}
...
...
sw/source/core/layout/wsfrm.cxx
Dosyayı görüntüle @
77a5c974
...
@@ -464,7 +464,7 @@ Size SwFrame::ChgSize( const Size& aNewSize )
...
@@ -464,7 +464,7 @@ Size SwFrame::ChgSize( const Size& aNewSize )
if
(
nDiff
)
if
(
nDiff
)
{
{
if
(
GetUpper
()
->
IsFootnoteBossFrame
()
&&
HasFixSize
()
&&
if
(
GetUpper
()
->
IsFootnoteBossFrame
()
&&
HasFixSize
()
&&
NA_GROW_SHRINK
!=
SwNeighbourAdjust
::
GrowShrink
!=
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
)
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
)
{
{
(
maFrame
.
*
fnRect
->
fnSetHeight
)(
nNew
);
(
maFrame
.
*
fnRect
->
fnSetHeight
)(
nNew
);
...
@@ -1076,20 +1076,20 @@ void SwLayoutFrame::Paste( SwFrame* pParent, SwFrame* pSibling)
...
@@ -1076,20 +1076,20 @@ void SwLayoutFrame::Paste( SwFrame* pParent, SwFrame* pSibling)
{
{
// AdjustNeighbourhood is now also called in columns which are not
// AdjustNeighbourhood is now also called in columns which are not
// placed inside a frame
// placed inside a frame
sal_uInt8
nAdjust
=
GetUpper
()
->
IsFootnoteBossFrame
()
?
SwNeighbourAdjust
nAdjust
=
GetUpper
()
->
IsFootnoteBossFrame
()
?
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
:
NA_GROW_SHRINK
;
:
SwNeighbourAdjust
::
GrowShrink
;
SwTwips
nGrow
=
(
Frame
().
*
fnRect
->
fnGetHeight
)();
SwTwips
nGrow
=
(
Frame
().
*
fnRect
->
fnGetHeight
)();
if
(
NA_ONLY_ADJUST
==
nAdjust
)
if
(
SwNeighbourAdjust
::
OnlyAdjust
==
nAdjust
)
AdjustNeighbourhood
(
nGrow
);
AdjustNeighbourhood
(
nGrow
);
else
else
{
{
SwTwips
nReal
=
0
;
SwTwips
nReal
=
0
;
if
(
NA_ADJUST_GROW
==
nAdjust
)
if
(
SwNeighbourAdjust
::
AdjustGrow
==
nAdjust
)
nReal
=
AdjustNeighbourhood
(
nGrow
);
nReal
=
AdjustNeighbourhood
(
nGrow
);
if
(
nReal
<
nGrow
)
if
(
nReal
<
nGrow
)
nReal
+=
pParent
->
Grow
(
nGrow
-
nReal
);
nReal
+=
pParent
->
Grow
(
nGrow
-
nReal
);
if
(
NA_GROW_ADJUST
==
nAdjust
&&
nReal
<
nGrow
)
if
(
SwNeighbourAdjust
::
GrowAdjust
==
nAdjust
&&
nReal
<
nGrow
)
AdjustNeighbourhood
(
nGrow
-
nReal
);
AdjustNeighbourhood
(
nGrow
-
nReal
);
}
}
}
}
...
@@ -1116,13 +1116,13 @@ void SwLayoutFrame::Cut()
...
@@ -1116,13 +1116,13 @@ void SwLayoutFrame::Cut()
{
{
if
(
pUp
->
IsFootnoteBossFrame
()
)
if
(
pUp
->
IsFootnoteBossFrame
()
)
{
{
sal_uInt8
nAdjust
=
static_cast
<
SwFootnoteBossFrame
*>
(
pUp
)
->
NeighbourhoodAdjustment
(
this
);
SwNeighbourAdjust
nAdjust
=
static_cast
<
SwFootnoteBossFrame
*>
(
pUp
)
->
NeighbourhoodAdjustment
(
this
);
if
(
NA_ONLY_ADJUST
==
nAdjust
)
if
(
SwNeighbourAdjust
::
OnlyAdjust
==
nAdjust
)
AdjustNeighbourhood
(
-
nShrink
);
AdjustNeighbourhood
(
-
nShrink
);
else
else
{
{
SwTwips
nReal
=
0
;
SwTwips
nReal
=
0
;
if
(
NA_ADJUST_GROW
==
nAdjust
)
if
(
SwNeighbourAdjust
::
AdjustGrow
==
nAdjust
)
nReal
=
-
AdjustNeighbourhood
(
-
nShrink
);
nReal
=
-
AdjustNeighbourhood
(
-
nShrink
);
if
(
nReal
<
nShrink
)
if
(
nReal
<
nShrink
)
{
{
...
@@ -1131,7 +1131,7 @@ void SwLayoutFrame::Cut()
...
@@ -1131,7 +1131,7 @@ void SwLayoutFrame::Cut()
nReal
+=
pUp
->
Shrink
(
nShrink
-
nReal
);
nReal
+=
pUp
->
Shrink
(
nShrink
-
nReal
);
(
Frame
().
*
fnRect
->
fnSetHeight
)(
nOldHeight
);
(
Frame
().
*
fnRect
->
fnSetHeight
)(
nOldHeight
);
}
}
if
(
NA_GROW_ADJUST
==
nAdjust
&&
nReal
<
nShrink
)
if
(
SwNeighbourAdjust
::
GrowAdjust
==
nAdjust
&&
nReal
<
nShrink
)
AdjustNeighbourhood
(
nReal
-
nShrink
);
AdjustNeighbourhood
(
nReal
-
nShrink
);
}
}
RemoveFromLayout
();
RemoveFromLayout
();
...
@@ -2241,14 +2241,14 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
...
@@ -2241,14 +2241,14 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
{
{
if
(
GetUpper
()
)
if
(
GetUpper
()
)
{
// AdjustNeighbourhood now only for the columns (but not in frames)
{
// AdjustNeighbourhood now only for the columns (but not in frames)
sal_uInt8
nAdjust
=
GetUpper
()
->
IsFootnoteBossFrame
()
?
SwNeighbourAdjust
nAdjust
=
GetUpper
()
->
IsFootnoteBossFrame
()
?
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
:
NA_GROW_SHRINK
;
:
SwNeighbourAdjust
::
GrowShrink
;
if
(
NA_ONLY_ADJUST
==
nAdjust
)
if
(
SwNeighbourAdjust
::
OnlyAdjust
==
nAdjust
)
nReal
=
AdjustNeighbourhood
(
nReal
,
bTst
);
nReal
=
AdjustNeighbourhood
(
nReal
,
bTst
);
else
else
{
{
if
(
NA_ADJUST_GROW
==
nAdjust
)
if
(
SwNeighbourAdjust
::
AdjustGrow
==
nAdjust
)
nReal
+=
AdjustNeighbourhood
(
nReal
,
bTst
);
nReal
+=
AdjustNeighbourhood
(
nReal
,
bTst
);
SwTwips
nGrow
=
0
;
SwTwips
nGrow
=
0
;
...
@@ -2272,7 +2272,7 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
...
@@ -2272,7 +2272,7 @@ SwTwips SwLayoutFrame::GrowFrame( SwTwips nDist, bool bTst, bool bInfo )
nGrow
=
pToGrow
?
pToGrow
->
Grow
(
nReal
,
bTst
,
bInfo
)
:
0
;
nGrow
=
pToGrow
?
pToGrow
->
Grow
(
nReal
,
bTst
,
bInfo
)
:
0
;
}
}
if
(
NA_GROW_ADJUST
==
nAdjust
&&
nGrow
<
nReal
)
if
(
SwNeighbourAdjust
::
GrowAdjust
==
nAdjust
&&
nGrow
<
nReal
)
nReal
+=
AdjustNeighbourhood
(
nReal
-
nGrow
,
bTst
);
nReal
+=
AdjustNeighbourhood
(
nReal
-
nGrow
,
bTst
);
if
(
IsFootnoteFrame
()
&&
(
nGrow
!=
nReal
)
&&
GetNext
()
)
if
(
IsFootnoteFrame
()
&&
(
nGrow
!=
nReal
)
&&
GetNext
()
)
...
@@ -2417,12 +2417,12 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
...
@@ -2417,12 +2417,12 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
bMoveAccFrame
=
true
;
bMoveAccFrame
=
true
;
}
}
sal_uInt8
nAdjust
=
GetUpper
()
&&
GetUpper
()
->
IsFootnoteBossFrame
()
?
SwNeighbourAdjust
nAdjust
=
GetUpper
()
&&
GetUpper
()
->
IsFootnoteBossFrame
()
?
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
static_cast
<
SwFootnoteBossFrame
*>
(
GetUpper
())
->
NeighbourhoodAdjustment
(
this
)
:
NA_GROW_SHRINK
;
:
SwNeighbourAdjust
::
GrowShrink
;
// AdjustNeighbourhood also in columns (but not in frames)
// AdjustNeighbourhood also in columns (but not in frames)
if
(
NA_ONLY_ADJUST
==
nAdjust
)
if
(
SwNeighbourAdjust
::
OnlyAdjust
==
nAdjust
)
{
{
if
(
IsPageBodyFrame
()
&&
!
bBrowse
)
if
(
IsPageBodyFrame
()
&&
!
bBrowse
)
nReal
=
nDist
;
nReal
=
nDist
;
...
@@ -2465,7 +2465,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
...
@@ -2465,7 +2465,7 @@ SwTwips SwLayoutFrame::ShrinkFrame( SwTwips nDist, bool bTst, bool bInfo )
}
}
nReal
=
pToShrink
?
pToShrink
->
Shrink
(
nShrink
,
bTst
,
bInfo
)
:
0
;
nReal
=
pToShrink
?
pToShrink
->
Shrink
(
nShrink
,
bTst
,
bInfo
)
:
0
;
if
(
(
NA_GROW_ADJUST
==
nAdjust
||
NA_ADJUST_GROW
==
nAdjust
)
if
(
(
SwNeighbourAdjust
::
GrowAdjust
==
nAdjust
||
SwNeighbourAdjust
::
AdjustGrow
==
nAdjust
)
&&
nReal
<
nShrink
)
&&
nReal
<
nShrink
)
AdjustNeighbourhood
(
nReal
-
nShrink
);
AdjustNeighbourhood
(
nReal
-
nShrink
);
}
}
...
...
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