[Libreoffice-commits] core.git: Branch 'feature/gsoc-writer-char-borders' - 3 commits - sw/source
Zolnai Tamás
zolnaitamas2000 at gmail.com
Wed Jul 17 10:13:36 PDT 2013
sw/source/core/inc/swfont.hxx | 8 ++++----
sw/source/core/layout/paintfrm.cxx | 16 +++++++---------
sw/source/core/text/itrform2.cxx | 8 +++-----
sw/source/core/txtnode/swfont.cxx | 4 ----
4 files changed, 14 insertions(+), 22 deletions(-)
New commits:
commit 87f9cdbfcd716fa6f07316595172ffc603ffd0a6
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Wed Jul 17 19:09:34 2013 +0200
Use SwTxtInfo height and ascent for portions
By now this is the same as the font's ascent and height
but it can change.
Change-Id: Ia40fed5d7a93f85b73b7fa019ec4ede9421d89d1
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 56dcbef..fcd49c1 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -758,10 +758,8 @@ void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
{
// Numbering + InterNetFlds can keep an own font, then their size is
// independent from hard attribute values
- SwFont* pFldFnt = ((SwFldPortion*)pPor)->pFnt;
- SwFontSave aSave( rInf, pFldFnt );
- ((SwFldPortion*)pPor)->Height( pFldFnt->GetHeight( rInf.GetVsh(), *rInf.GetOut() ) );
- ((SwFldPortion*)pPor)->SetAscent( pFldFnt->GetAscent( rInf.GetVsh(), *rInf.GetOut() ) );
+ pPor->Height( rInf.GetTxtHeight() );
+ pPor->SetAscent( rInf.GetAscent() );
}
// #i89179#
// tab portion representing the list tab of a list label gets the
@@ -810,7 +808,7 @@ void SwTxtFormatter::CalcAscent( SwTxtFormatInfo &rInf, SwLinePortion *pPor )
bChg = SeekAndChg( rInf );
}
if( bChg || bFirstPor || !pPor->GetAscent()
- || !rInf.GetLast()->InTxtGrp() )
+ || !pLast->InTxtGrp() )
{
pPor->SetAscent( rInf.GetAscent() );
pPor->Height( rInf.GetTxtHeight() );
commit dedec6c67154df2656beb2d50ea9b2a7fc682863
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Thu Jul 11 10:15:44 2013 +0200
Make some changes in SwFont's borders
Change-Id: I901094a45f339b0702481a3fd60f3b7effc96143
diff --git a/sw/source/core/inc/swfont.hxx b/sw/source/core/inc/swfont.hxx
index a9c5a98..c2dc2d1 100644
--- a/sw/source/core/inc/swfont.hxx
+++ b/sw/source/core/inc/swfont.hxx
@@ -182,10 +182,10 @@ public:
void SetRightBorder( const editeng::SvxBorderLine* pRightBorder );
void SetLeftBorder( const editeng::SvxBorderLine* pLeftBorder );
- const boost::optional<editeng::SvxBorderLine>& GetTopBorder() { return m_aTopBorder; }
- const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() { return m_aBottomBorder; }
- const boost::optional<editeng::SvxBorderLine>& GetRightBorder() { return m_aRightBorder; }
- const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() { return m_aLeftBorder; }
+ const boost::optional<editeng::SvxBorderLine>& GetTopBorder() const { return m_aTopBorder; }
+ const boost::optional<editeng::SvxBorderLine>& GetBottomBorder() const { return m_aBottomBorder; }
+ const boost::optional<editeng::SvxBorderLine>& GetRightBorder() const { return m_aRightBorder; }
+ const boost::optional<editeng::SvxBorderLine>& GetLeftBorder() const { return m_aLeftBorder; }
inline void ChkMagic( ViewShell *pSh, sal_uInt8 nWhich )
{ if( !aSub[ nWhich ].pMagic ) GoMagic( pSh, nWhich ); }
diff --git a/sw/source/core/txtnode/swfont.cxx b/sw/source/core/txtnode/swfont.cxx
index a45aa61..783524a 100644
--- a/sw/source/core/txtnode/swfont.cxx
+++ b/sw/source/core/txtnode/swfont.cxx
@@ -452,10 +452,6 @@ void SwFont::SetDiffFnt( const SfxItemSet *pAttrSet,
SwFont::SwFont()
: pBackColor(0)
- , m_aTopBorder(boost::none)
- , m_aBottomBorder(boost::none)
- , m_aRightBorder(boost::none)
- , m_aLeftBorder(boost::none)
, nActual(SW_LATIN)
{
}
commit cd8598f3d382f0f97d84e8a50b27d34434ba7c4c
Author: Zolnai Tamás <zolnaitamas2000 at gmail.com>
Date: Tue Jul 9 12:41:33 2013 +0200
Decrease scope of some variable
Change-Id: I23319e09bf6c4c0e33b86edc225cdfaa0433b7c6
diff --git a/sw/source/core/layout/paintfrm.cxx b/sw/source/core/layout/paintfrm.cxx
index b19da71..6d99fd3 100644
--- a/sw/source/core/layout/paintfrm.cxx
+++ b/sw/source/core/layout/paintfrm.cxx
@@ -4673,9 +4673,6 @@ static void lcl_PaintLeftRightLine( const bool _bLeft,
{
pLeftRightBorder = bR2L ? rBox.GetLeft() : rBox.GetRight();
}
- // OD 06.05.2003 #107169# - init boolean indicating printer output device.
- const bool bPrtOutputDev =
- ( OUTDEV_PRINTER == pGlobalShell->GetOut()->GetOutDevType() );
if ( !pLeftRightBorder )
{
@@ -4694,9 +4691,7 @@ static void lcl_PaintLeftRightLine( const bool _bLeft,
(aRect.*_rRectFn->fnGetWidth)() );
}
- const sal_Bool bCnt = _rFrm.IsCntntFrm();
-
- if ( bCnt )
+ if ( _rFrm.IsCntntFrm() )
{
::lcl_ExtendLeftAndRight( aRect, _rFrm, _rAttrs, _rRectFn );
@@ -4707,6 +4702,10 @@ static void lcl_PaintLeftRightLine( const bool _bLeft,
if ( !pLeftRightBorder->GetInWidth() )
{
+ // OD 06.05.2003 #107169# - init boolean indicating printer output device.
+ const bool bPrtOutputDev =
+ ( OUTDEV_PRINTER == pGlobalShell->GetOut()->GetOutDevType() );
+
// OD 06.05.2003 #107169# - add 6th parameter
::lcl_SubTopBottom( aRect, rBox, _rAttrs, _rFrm, _rRectFn, bPrtOutputDev );
}
@@ -4730,8 +4729,7 @@ static void lcl_PaintTopBottomLine( const bool _bTop,
{
const SvxBoxItem& rBox = _rAttrs.GetBox();
const SvxBorderLine* pTopBottomBorder = 0;
- const SvxBorderLine* pLeftBorder = rBox.GetLeft();
- const SvxBorderLine* pRightBorder = rBox.GetRight();
+
if ( _bTop )
{
pTopBottomBorder = rBox.GetTop();
@@ -4761,7 +4759,7 @@ static void lcl_PaintTopBottomLine( const bool _bTop,
if ( lcl_GetLineWidth( pTopBottomBorder ) > 0 )
{
lcl_MakeBorderLine(
- aRect, false, _bTop, *pTopBottomBorder, pLeftBorder, pRightBorder);
+ aRect, false, _bTop, *pTopBottomBorder, rBox.GetLeft(), rBox.GetRight());
}
}
More information about the Libreoffice-commits
mailing list