[Libreoffice-commits] core.git: 8 commits - sw/source
Miklos Vajna
vmiklos at collabora.co.uk
Thu Jun 25 08:57:38 PDT 2015
sw/source/core/inc/layact.hxx | 2 -
sw/source/core/layout/layact.cxx | 24 +++++++--------
sw/source/core/text/frmform.cxx | 10 +++---
sw/source/core/text/inftxt.cxx | 62 ++++++++++++++++++++++++++++++++++-----
sw/source/core/text/inftxt.hxx | 49 +++++-------------------------
sw/source/core/text/txtfrm.cxx | 8 ++---
sw/source/core/text/txtftn.cxx | 2 -
sw/source/core/text/txthyph.cxx | 3 +
8 files changed, 88 insertions(+), 72 deletions(-)
New commits:
commit 54106fae68149c0b1dbb4f6ece133fefacacc322
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 17:38:24 2015 +0200
SwTextFormatInfo::SwTextFormatInfo: use vcl::RenderContext
Change-Id: I8ff1647bdf8c46d395c398c97b97066d7b128cdb
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 79cf3f3..c42f059 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -491,7 +491,7 @@ com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > SwTextFrm::Get
com::sun::star::uno::Sequence< ::com::sun::star::style::TabStop > tabs(1);
::com::sun::star::style::TabStop ts;
- SwTextFormatInfo aInf( this );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
SwTextFormatter aLine( this, &aInf );
SwTextCursor TextCursor( this, &aInf );
const Point aCharPos( TextCursor.GetTopLeft() );
@@ -855,7 +855,7 @@ bool SwTextFrm::CalcPreps()
{
SWAP_IF_NOT_SWAPPED swap( this );
- SwTextFormatInfo aInf( this );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
SwTextFormatter aLine( this, &aInf );
WidowsAndOrphans aFrmBreak( this );
@@ -1650,7 +1650,7 @@ void SwTextFrm::_Format( SwParaPortion *pPara )
if ( IsVertical() )
SwapWidthAndHeight();
- SwTextFormatInfo aInf( this );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
SwTextFormatter aLine( this, &aInf );
HideAndShowObjects();
@@ -1877,7 +1877,7 @@ bool SwTextFrm::FormatQuick( bool bForceQuickFormat )
SwFrmSwapper aSwapper( this, true );
TextFrmLockGuard aLock(this);
- SwTextFormatInfo aInf( this, false, true );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true );
if( 0 != aInf.MaxHyph() ) // Respect MaxHyphen!
return false;
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 741bef7..ae679c3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1467,10 +1467,10 @@ void SwTextFormatInfo::Init()
SetPaintOfst(0);
}
-SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL,
+SwTextFormatInfo::SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrm *pFrame, const bool bInterHyphL,
const bool bQuickL, const bool bTst)
{
- CtorInitTextFormatInfo(pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, bInterHyphL, bQuickL, bTst);
+ CtorInitTextFormatInfo(pRenderContext, pFrame, bInterHyphL, bQuickL, bTst);
}
/**
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index b7e33f4..107e6cb 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -563,7 +563,7 @@ class SwTextFormatInfo : public SwTextPaintInfo
public:
void CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, const bool bInterHyph = false,
const bool bQuick = false, const bool bTst = false );
- SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
+ SwTextFormatInfo(OutputDevice* pRenderContext, SwTextFrm *pFrame, const bool bInterHyphL = false,
const bool bQuickL = false, const bool bTst = false);
// For the formatting inside a double line in a line (multi-line portion)
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index c5fe920..18f8979 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -754,7 +754,7 @@ void SwTextFrm::CalcLineSpace()
Size aNewSize( Prt().SSize() );
- SwTextFormatInfo aInf( this );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
SwTextFormatter aLine( this, &aInf );
if( aLine.GetDropLines() )
{
@@ -1876,7 +1876,7 @@ SwTestFormat::SwTestFormat( SwTextFrm* pTextFrm, const SwFrm* pPre, SwTwips nMax
if ( pFrm->IsVertical() )
pFrm->SwapWidthAndHeight();
- SwTextFormatInfo aInf( pFrm, false, true, true );
+ SwTextFormatInfo aInf( pFrm->getRootFrm()->GetCurrShell()->GetOut(), pFrm, false, true, true );
SwTextFormatter aLine( pFrm, &aInf );
pFrm->_Format( aLine, aInf );
@@ -2110,7 +2110,7 @@ SwTwips SwTextFrm::CalcFitToContent()
// #i31490#
TextFrmLockGuard aLock( this );
- SwTextFormatInfo aInf( this, false, true, true );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true, true );
aInf.SetIgnoreFly( true );
SwTextFormatter aLine( this, &aInf );
SwHookOut aHook( aInf );
@@ -2170,7 +2170,7 @@ void SwTextFrm::CalcAdditionalFirstLineOffset()
TextFrmLockGuard aLock( this );
// simulate text formatting
- SwTextFormatInfo aInf( this, false, true, true );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, false, true, true );
aInf.SetIgnoreFly( true );
SwTextFormatter aLine( this, &aInf );
SwHookOut aHook( aInf );
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index 2365d6b..dc1a2f7 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -144,7 +144,7 @@ bool SwTextFrm::CalcPrepFootnoteAdjust()
bReArrange = false;
if( !pCont || !pFootnote || bReArrange != (pFootnote->FindFootnoteBossFrm() == pBoss) )
{
- SwTextFormatInfo aInf( this );
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this );
SwTextFormatter aLine( this, &aInf );
aLine.TruncLines();
SetPara( 0 ); // May be deleted!
diff --git a/sw/source/core/text/txthyph.cxx b/sw/source/core/text/txthyph.cxx
index 8a410b3..5bf7d25 100644
--- a/sw/source/core/text/txthyph.cxx
+++ b/sw/source/core/text/txthyph.cxx
@@ -28,6 +28,7 @@
#include <itrform2.hxx>
#include <guess.hxx>
#include <splargs.hxx>
+#include <rootfrm.hxx>
using namespace ::com::sun::star;
using namespace ::com::sun::star::uno;
@@ -78,7 +79,7 @@ bool SwTextFrm::Hyphenate( SwInterHyphInfo &rHyphInf )
if ( IsVertical() )
SwapWidthAndHeight();
- SwTextFormatInfo aInf( this, true ); // true for interactive hyph!
+ SwTextFormatInfo aInf( getRootFrm()->GetCurrShell()->GetOut(), this, true ); // true for interactive hyph!
SwTextFormatter aLine( this, &aInf );
aLine.CharToLine( rHyphInf.nStart );
commit a5fe6ea091ae7e897b11b62b9b749b6194d34585
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 17:12:55 2015 +0200
SwTextFormatInfo::CtorInitTextFormatInfo: use vcl::RenderContext
Change-Id: I0f775bdfaf6a098be25d053f87b1bcf86d533297
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index eb61728..79cf3f3 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -1609,7 +1609,7 @@ void SwTextFrm::FormatOnceMore( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
// If something went wrong, we need to reformat again
if( !bGoOn )
{
- rInf.CtorInitTextFormatInfo( this );
+ rInf.CtorInitTextFormatInfo( getRootFrm()->GetCurrShell()->GetOut(), this );
rLine.CtorInitTextFormatter( this, &rInf );
rLine.SetDropLines( 1 );
rLine.CalcDropHeight( 1 );
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index bac9704..741bef7 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1351,10 +1351,10 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
return bAuto;
}
-void SwTextFormatInfo::CtorInitTextFormatInfo( SwTextFrm *pNewFrm, const bool bNewInterHyph,
+void SwTextFormatInfo::CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pNewFrm, const bool bNewInterHyph,
const bool bNewQuick, const bool bTst )
{
- CtorInitTextPaintInfo( pNewFrm->getRootFrm()->GetCurrShell()->GetOut(), pNewFrm, SwRect() );
+ CtorInitTextPaintInfo( pRenderContext, pNewFrm, SwRect() );
bQuick = bNewQuick;
bInterHyph = bNewInterHyph;
@@ -1470,7 +1470,7 @@ void SwTextFormatInfo::Init()
SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL,
const bool bQuickL, const bool bTst)
{
- CtorInitTextFormatInfo(pFrame, bInterHyphL, bQuickL, bTst);
+ CtorInitTextFormatInfo(pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, bInterHyphL, bQuickL, bTst);
}
/**
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 5cb0e50..b7e33f4 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -561,7 +561,7 @@ class SwTextFormatInfo : public SwTextPaintInfo
bool _CheckFootnotePortion( SwLineLayout* pCurr );
public:
- void CtorInitTextFormatInfo( SwTextFrm *pFrm, const bool bInterHyph = false,
+ void CtorInitTextFormatInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, const bool bInterHyph = false,
const bool bQuick = false, const bool bTst = false );
SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
const bool bQuickL = false, const bool bTst = false);
commit d3456256eafa376abaad50dc980ab94032185af6
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 17:06:30 2015 +0200
sw: outline SwTextFormatInfo ctor
Change-Id: I07b3a7768def547a34cbcdd8966157065605d5fb
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 06bdcc0..bac9704 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1467,6 +1467,12 @@ void SwTextFormatInfo::Init()
SetPaintOfst(0);
}
+SwTextFormatInfo::SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL,
+ const bool bQuickL, const bool bTst)
+{
+ CtorInitTextFormatInfo(pFrame, bInterHyphL, bQuickL, bTst);
+}
+
/**
* There are a few differences between a copy constructor
* and the following constructor for multi-line formatting.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 0241824..5cb0e50 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -563,9 +563,8 @@ class SwTextFormatInfo : public SwTextPaintInfo
public:
void CtorInitTextFormatInfo( SwTextFrm *pFrm, const bool bInterHyph = false,
const bool bQuick = false, const bool bTst = false );
- inline SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
- const bool bQuickL = false, const bool bTst = false)
- { CtorInitTextFormatInfo( pFrame, bInterHyphL, bQuickL, bTst ); }
+ SwTextFormatInfo(SwTextFrm *pFrame, const bool bInterHyphL = false,
+ const bool bQuickL = false, const bool bTst = false);
// For the formatting inside a double line in a line (multi-line portion)
// we need a modified text-format-info:
commit 0c33e10b594aa07c4e9adadae59e5c03a4fdc29c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 16:44:55 2015 +0200
SwTextPaintInfo::CtorInitTextPaintInfo: use vcl::RenderContext
Change-Id: I1931ec139798d2f2eb956fd0590ab98ce1a65c3c
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 2ff3518..06bdcc0 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -487,9 +487,9 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos )
return pTextNode->GetTextAttrForCharAt(nPos);
}
-void SwTextPaintInfo::CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
+void SwTextPaintInfo::CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, const SwRect &rPaint )
{
- CtorInitTextSizeInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame );
+ CtorInitTextSizeInfo( pRenderContext, pFrame );
aTextFly.CtorInitTextFly( pFrame ),
aPaintRect = rPaint;
nSpaceIdx = 0;
@@ -533,7 +533,7 @@ SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf )
SwTextPaintInfo::SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
{
- CtorInitTextPaintInfo( pFrame, rPaint );
+ CtorInitTextPaintInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame, rPaint );
}
extern Color aGlobalRetoucheColor;
@@ -1354,7 +1354,7 @@ bool SwTextFormatInfo::InitHyph( const bool bAutoHyphen )
void SwTextFormatInfo::CtorInitTextFormatInfo( SwTextFrm *pNewFrm, const bool bNewInterHyph,
const bool bNewQuick, const bool bTst )
{
- CtorInitTextPaintInfo( pNewFrm, SwRect() );
+ CtorInitTextPaintInfo( pNewFrm->getRootFrm()->GetCurrShell()->GetOut(), pNewFrm, SwRect() );
bQuick = bNewQuick;
bInterHyph = bNewInterHyph;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 261392f..0241824 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -403,7 +403,7 @@ public:
SwTextPaintInfo( const SwTextPaintInfo &rInf );
SwTextPaintInfo( const SwTextPaintInfo &rInf, const OUString* pText );
- void CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint );
+ void CtorInitTextPaintInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, const SwRect &rPaint );
void SetBack( const SvxBrushItem *pItem,
const SwRect &rRect ) { pBrushItem = pItem; aItemRect = rRect;}
commit 9829d6ab01e15be7e81f971eac6ba5e402ca5189
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 16:33:37 2015 +0200
sw: outline SwTextPaintInfo ctor
Change-Id: Ie57e1f5abc91286662804e7528afd062d1427fee
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 3e41ec5..2ff3518 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -531,6 +531,11 @@ SwTextPaintInfo::SwTextPaintInfo( const SwTextPaintInfo &rInf )
nSpaceIdx( rInf.GetSpaceIdx() )
{ }
+SwTextPaintInfo::SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
+{
+ CtorInitTextPaintInfo( pFrame, rPaint );
+}
+
extern Color aGlobalRetoucheColor;
/// Returns if the current background color is dark.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 262fbb1..261392f 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -410,8 +410,7 @@ public:
const SvxBrushItem *GetBrushItem() const { return pBrushItem; }
const SwRect &GetBrushRect() const { return aItemRect; }
- inline SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
- { CtorInitTextPaintInfo( pFrame, rPaint ); }
+ SwTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint );
inline SwTwips X() const { return aPos.X(); }
inline void X( const long nNew ) { aPos.X() = nNew; }
commit 8af3974013dbae4aa83b13c6fd6c6e8fd04ac072
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 16:23:25 2015 +0200
SwTextSizeInfo::CtorInitTextSizeInfo: use vcl::RenderContext
Change-Id: I6dfceb02b57d886dd8025520e5ed21a2ad46a5b1
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 3dae3d3..3e41ec5 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -251,7 +251,7 @@ SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew )
#endif
}
-void SwTextSizeInfo::CtorInitTextSizeInfo( SwTextFrm *pFrame, SwFont *pNewFnt,
+void SwTextSizeInfo::CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextFrm *pFrame, SwFont *pNewFnt,
const sal_Int32 nNewIdx, const sal_Int32 nNewLen )
{
m_pKanaComp = NULL;
@@ -264,9 +264,9 @@ void SwTextSizeInfo::CtorInitTextSizeInfo( SwTextFrm *pFrame, SwFont *pNewFnt,
// Get the output and reference device
if ( m_pVsh )
{
- m_pOut = m_pVsh->GetOut();
+ m_pOut = pRenderContext;
m_pRef = &m_pVsh->GetRefDev();
- m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType();
+ m_bOnWin = m_pVsh->GetWin() || OUTDEV_WINDOW == m_pOut->GetOutDevType() || m_pVsh->isOutputToWindow();
}
else
{
@@ -368,7 +368,7 @@ SwTextSizeInfo::SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt,
const sal_Int32 nLength )
: m_bOnWin(false)
{
- CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength );
+ CtorInitTextSizeInfo( pTextFrm->getRootFrm()->GetCurrShell()->GetOut(), pTextFrm, pTextFnt, nIndex, nLength );
}
void SwTextSizeInfo::SelectFont()
@@ -489,7 +489,7 @@ bool SwTextSizeInfo::_HasHint( const SwTextNode* pTextNode, sal_Int32 nPos )
void SwTextPaintInfo::CtorInitTextPaintInfo( SwTextFrm *pFrame, const SwRect &rPaint )
{
- CtorInitTextSizeInfo( pFrame );
+ CtorInitTextSizeInfo( pFrame->getRootFrm()->GetCurrShell()->GetOut(), pFrame );
aTextFly.CtorInitTextFly( pFrame ),
aPaintRect = rPaint;
nSpaceIdx = 0;
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index f6f1194..262fbb1 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -191,7 +191,7 @@ protected:
sal_uInt8 m_nDirection : 2; // writing direction: 0/90/180/270 degree
protected:
- void CtorInitTextSizeInfo( SwTextFrm *pFrm, SwFont *pFnt = 0,
+ void CtorInitTextSizeInfo( OutputDevice* pRenderContext, SwTextFrm *pFrm, SwFont *pFnt = 0,
const sal_Int32 nIdx = 0,
const sal_Int32 nLen = COMPLETE_STRING );
SwTextSizeInfo();
commit d7eacc579fb0874e9602b5c0714ac00bd520322a
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 15:47:15 2015 +0200
sw: outline SwTextSizeInfo ctors
Change-Id: I8964701bf5b1ecdb11851d7cc8540175e007dd2b
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 861f412..3dae3d3 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -188,6 +188,35 @@ inline sal_Int32 GetMinLen( const SwTextSizeInfo &rInf )
return std::min(nTextLen, nInfLen);
}
+SwTextSizeInfo::SwTextSizeInfo()
+: m_pKanaComp(0)
+, m_pVsh(0)
+, m_pOut(0)
+, m_pRef(0)
+, m_pFnt(0)
+, m_pUnderFnt(0)
+, m_pFrm(0)
+, m_pOpt(0)
+, m_pText(0)
+, m_nIdx(0)
+, m_nLen(0)
+, m_nKanaIdx(0)
+, m_bOnWin (false)
+, m_bNotEOL (false)
+, m_bURLNotify(false)
+, m_bStopUnderflow(false)
+, m_bFootnoteInside(false)
+, m_bOtherThanFootnoteInside(false)
+, m_bMulti(false)
+, m_bFirstMulti(false)
+, m_bRuby(false)
+, m_bHanging(false)
+, m_bScriptSpace(false)
+, m_bForbiddenChars(false)
+, m_bSnapToGrid(false)
+, m_nDirection(0)
+{}
+
SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew )
: SwTextInfo( rNew ),
m_pKanaComp(rNew.GetpKanaComp()),
@@ -334,6 +363,14 @@ SwTextSizeInfo::SwTextSizeInfo( const SwTextSizeInfo &rNew, const OUString* pTex
SetLen( GetMinLen( *this ) );
}
+SwTextSizeInfo::SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt,
+ const sal_Int32 nIndex,
+ const sal_Int32 nLength )
+ : m_bOnWin(false)
+{
+ CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength );
+}
+
void SwTextSizeInfo::SelectFont()
{
// The path needs to go via ChgPhysFnt or the FontMetricCache gets confused.
diff --git a/sw/source/core/text/inftxt.hxx b/sw/source/core/text/inftxt.hxx
index 150ef16..f6f1194 100644
--- a/sw/source/core/text/inftxt.hxx
+++ b/sw/source/core/text/inftxt.hxx
@@ -194,34 +194,7 @@ protected:
void CtorInitTextSizeInfo( SwTextFrm *pFrm, SwFont *pFnt = 0,
const sal_Int32 nIdx = 0,
const sal_Int32 nLen = COMPLETE_STRING );
- SwTextSizeInfo()
- : m_pKanaComp(0)
- , m_pVsh(0)
- , m_pOut(0)
- , m_pRef(0)
- , m_pFnt(0)
- , m_pUnderFnt(0)
- , m_pFrm(0)
- , m_pOpt(0)
- , m_pText(0)
- , m_nIdx(0)
- , m_nLen(0)
- , m_nKanaIdx(0)
- , m_bOnWin (false)
- , m_bNotEOL (false)
- , m_bURLNotify(false)
- , m_bStopUnderflow(false)
- , m_bFootnoteInside(false)
- , m_bOtherThanFootnoteInside(false)
- , m_bMulti(false)
- , m_bFirstMulti(false)
- , m_bRuby(false)
- , m_bHanging(false)
- , m_bScriptSpace(false)
- , m_bForbiddenChars(false)
- , m_bSnapToGrid(false)
- , m_nDirection(0)
- {}
+ SwTextSizeInfo();
public:
SwTextSizeInfo( const SwTextSizeInfo &rInf );
SwTextSizeInfo( const SwTextSizeInfo &rInf, const OUString* pText,
@@ -230,11 +203,7 @@ public:
SwTextSizeInfo( SwTextFrm *pTextFrm, SwFont *pTextFnt = 0,
const sal_Int32 nIndex = 0,
- const sal_Int32 nLength = COMPLETE_STRING )
- : m_bOnWin(false)
- {
- CtorInitTextSizeInfo( pTextFrm, pTextFnt, nIndex, nLength );
- }
+ const sal_Int32 nLength = COMPLETE_STRING );
// GetMultiAttr returns the text attribute of the multiportion,
// if rPos is inside any multi-line part.
commit b13fbaf697b1cbd1f8b019e3f5500b53e2a39c6c
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Thu Jun 25 14:48:09 2015 +0200
SwLayAction::FormatLayout: use vcl::RenderContext
Change-Id: I3bc993b00940732fd9ca26ccec7d025c8558516a
diff --git a/sw/source/core/inc/layact.hxx b/sw/source/core/inc/layact.hxx
index 53e3c25..1dca776 100644
--- a/sw/source/core/inc/layact.hxx
+++ b/sw/source/core/inc/layact.hxx
@@ -100,7 +100,7 @@ class SwLayAction
inline bool _PaintContent( const SwContentFrm *, const SwPageFrm *,
const SwRect & );
- bool FormatLayout( SwLayoutFrm *, bool bAddRect = true );
+ bool FormatLayout( OutputDevice* pRenderContext, SwLayoutFrm *, bool bAddRect = true );
bool FormatLayoutTab( SwTabFrm *, bool bAddRect = true );
bool FormatContent( const SwPageFrm* pPage );
void _FormatContent( const SwContentFrm* pContent,
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index af2dcdc..f25208b 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -572,7 +572,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
break;
}
- FormatLayout( pPage );
+ FormatLayout( pRenderContext, pPage );
XCHECKPAGE;
}
// #i28701# - change condition
@@ -755,7 +755,7 @@ void SwLayAction::InternalAction(OutputDevice* pRenderContext)
break;
}
- FormatLayout( pPg );
+ FormatLayout( pRenderContext, pPg );
XCHECKPAGE;
}
@@ -1026,7 +1026,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
}
}
else
- FormatLayout( prPage );
+ FormatLayout( pSh->GetOut(), prPage );
if ( IsAgain() )
return false;
}
@@ -1216,7 +1216,7 @@ bool SwLayAction::IsShortCut( SwPageFrm *&prPage )
}
// OD 15.11.2002 #105155# - introduce support for vertical layout
-bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
+bool SwLayAction::FormatLayout( OutputDevice *pRenderContext, SwLayoutFrm *pLay, bool bAddRect )
{
OSL_ENSURE( !IsAgain(), "Attention to the invalid page." );
if ( IsAgain() )
@@ -1236,7 +1236,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
SwRect aOldRect( aOldFrame );
if( pLay->IsPageFrm() )
{
- aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut());
+ aOldRect = static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext);
}
pLay->Calc();
@@ -1264,7 +1264,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
if ( pLay->IsPageFrm() )
{
SwPageFrm* pPageFrm = static_cast<SwPageFrm*>(pLay);
- aPaint = pPageFrm->GetBoundRect(pPageFrm->getRootFrm()->GetCurrShell()->GetOut());
+ aPaint = pPageFrm->GetBoundRect(pRenderContext);
}
bool bPageInBrowseMode = pLay->IsPageFrm();
@@ -1320,7 +1320,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
if(pSh)
{
SwPageFrm::GetBorderAndShadowBoundRect(aPageRect, pSh,
- pSh->GetOut(),
+ pRenderContext,
aPageRect, pPageFrm->IsLeftShadowNeeded(), pPageFrm->IsRightShadowNeeded(),
pPageFrm->SidebarPosition() == sw::sidebarwindows::SidebarPosition::RIGHT);
}
@@ -1335,7 +1335,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
pImp->GetShell()->AddPaintRect( aSpaceToPrevPage );
if (pSh)
- pSh->GetOut()->DrawRect( aSpaceToPrevPage.SVRect() );
+ pRenderContext->DrawRect( aSpaceToPrevPage.SVRect() );
// left
aSpaceToPrevPage = aPageRect;
@@ -1400,7 +1400,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect );
// Skip the ones already registered for deletion
else if( !pLow->IsSctFrm() || static_cast<SwSectionFrm*>(pLow)->GetSection() )
- bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect );
+ bChanged |= FormatLayout( pRenderContext, static_cast<SwLayoutFrm*>(pLow), bAddRect );
}
else if ( pImp->GetShell()->IsPaintLocked() )
// Shortcut to minimize the cycles. With Lock, the
@@ -1414,7 +1414,7 @@ bool SwLayAction::FormatLayout( SwLayoutFrm *pLay, bool bAddRect )
// OD 11.11.2002 #104414# - add complete frame area as paint area, if frame
// area has been already added and after formatting its lowers the frame area
// is enlarged.
- SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pLay->getRootFrm()->GetCurrShell()->GetOut()) : pLay->Frm() );
+ SwRect aBoundRect(pLay->IsPageFrm() ? static_cast<SwPageFrm*>(pLay)->GetBoundRect(pRenderContext) : pLay->Frm() );
if ( bAlreadyPainted &&
( aBoundRect.Width() > aFrmAtCompletePaint.Width() ||
@@ -1468,7 +1468,7 @@ bool SwLayAction::FormatLayoutFly( SwFlyFrm* pFly )
if ( pLow->IsTabFrm() )
bTabChanged |= FormatLayoutTab( static_cast<SwTabFrm*>(pLow), bAddRect );
else
- bChanged |= FormatLayout( static_cast<SwLayoutFrm*>(pLow), bAddRect );
+ bChanged |= FormatLayout( pImp->GetShell()->GetOut(), static_cast<SwLayoutFrm*>(pLow), bAddRect );
}
pLow = pLow->GetNext();
}
@@ -1615,7 +1615,7 @@ bool SwLayAction::FormatLayoutTab( SwTabFrm *pTab, bool bAddRect )
SwLayoutFrm *pLow = static_cast<SwLayoutFrm*>(pTab->Lower());
while ( pLow )
{
- bChanged |= FormatLayout( pLow, bAddRect );
+ bChanged |= FormatLayout( pImp->GetShell()->GetOut(), pLow, bAddRect );
if ( IsAgain() )
return false;
pLow = static_cast<SwLayoutFrm*>(pLow->GetNext());
More information about the Libreoffice-commits
mailing list