summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorMichael Stahl <Michael.Stahl@cib.de>2018-06-01 20:34:02 +0200
committerMichael Stahl <Michael.Stahl@cib.de>2018-06-08 21:51:35 +0200
commit2c350b0caa5f152cae38f8aaf7af45a997a738fd (patch)
tree5f64eeffd5e8bdd6cd20ed2b25fa9b6a4f1d262c /sw
parente7a03bc3f6a94c7e5ab2901dd7008be056658a94 (diff)
sw_redlinehide: trivial GetNode() in text
Change-Id: Ied6e80e30ced49b11952c44c36e86e8575e42c0f
Diffstat (limited to 'sw')
-rw-r--r--sw/source/core/text/frmcrsr.cxx2
-rw-r--r--sw/source/core/text/guess.cxx5
-rw-r--r--sw/source/core/text/inftxt.cxx2
-rw-r--r--sw/source/core/text/itradj.cxx5
-rw-r--r--sw/source/core/text/itrcrsr.cxx11
-rw-r--r--sw/source/core/text/itrform2.cxx10
-rw-r--r--sw/source/core/text/porlay.cxx4
-rw-r--r--sw/source/core/text/txtfly.cxx4
-rw-r--r--sw/source/core/text/txtfrm.cxx8
-rw-r--r--sw/source/core/text/txtftn.cxx25
10 files changed, 38 insertions, 38 deletions
diff --git a/sw/source/core/text/frmcrsr.cxx b/sw/source/core/text/frmcrsr.cxx
index c7c53d83e4f9..c57764acb569 100644
--- a/sw/source/core/text/frmcrsr.cxx
+++ b/sw/source/core/text/frmcrsr.cxx
@@ -1368,7 +1368,7 @@ void SwTextFrame::FillCursorPos( SwFillData& rFill ) const
aSet.Put( *GetTextNodeForParaProps()->GetpSwAttrSet() );
aSet.SetParent( pSet );
pSet = &aSet;
- pFnt = new SwFont( pSet, GetNode()->getIDocumentSettingAccess() );
+ pFnt = new SwFont( pSet, &GetDoc().getIDocumentSettingAccess() );
}
else
{
diff --git a/sw/source/core/text/guess.cxx b/sw/source/core/text/guess.cxx
index 9bcb7bd33fe3..14b1de671f54 100644
--- a/sw/source/core/text/guess.cxx
+++ b/sw/source/core/text/guess.cxx
@@ -80,7 +80,8 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
// for LTR mode only
if ( !rInf.GetTextFrame()->IsRightToLeft() )
{
- if ( rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS ) )
+ if (rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
+ DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS))
{
if ( rAdjust == SvxAdjust::Right || rAdjust == SvxAdjust::Center )
{
@@ -380,7 +381,7 @@ bool SwTextGuess::Guess( const SwTextPortion& rPor, SwTextFormatInfo &rInf,
}
const ForbiddenCharacters aForbidden(
- *rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->getForbiddenCharacters( aLang, true ) );
+ *rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().getForbiddenCharacters(aLang, true));
const bool bAllowHanging = rInf.IsHanging() && ! rInf.IsMulti() &&
! rInf.GetTextFrame()->IsInTab() &&
diff --git a/sw/source/core/text/inftxt.cxx b/sw/source/core/text/inftxt.cxx
index 4a0aef64c070..a0e7c1c06131 100644
--- a/sw/source/core/text/inftxt.cxx
+++ b/sw/source/core/text/inftxt.cxx
@@ -1168,7 +1168,7 @@ void SwTextPaintInfo::DrawBackBrush( const SwLinePortion &rPor ) const
// for LTR mode only
if ( !GetTextFrame()->IsRightToLeft() )
{
- if ( GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get( DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS ) )
+ if (GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::MS_WORD_COMP_TRAILING_BLANKS))
{
bool draw = false;
bool full = false;
diff --git a/sw/source/core/text/itradj.cxx b/sw/source/core/text/itradj.cxx
index 428c8d93fe51..76e115318422 100644
--- a/sw/source/core/text/itradj.cxx
+++ b/sw/source/core/text/itradj.cxx
@@ -19,6 +19,7 @@
#include <vcl/outdev.hxx>
#include <IDocumentSettingAccess.hxx>
+#include <doc.hxx>
#include <frame.hxx>
#include <paratr.hxx>
@@ -281,7 +282,7 @@ void SwTextAdjuster::CalcNewBlock( SwLineLayout *pCurrent,
// #i49277#
const bool bDoNotJustifyLinesWithManualBreak =
- GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
+ GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::DO_NOT_JUSTIFY_LINES_WITH_MANUAL_BREAK);
SwLinePortion *pPos = pCurrent->GetPortion();
@@ -588,7 +589,7 @@ void SwTextAdjuster::CalcFlyAdjust( SwLineLayout *pCurrent )
// If we only have one line, the text portion is consecutive and we center, then ...
bool bComplete = TextFrameIndex(0) == m_nStart;
- const bool bTabCompat = GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::TAB_COMPAT);
+ const bool bTabCompat = GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(DocumentSettingId::TAB_COMPAT);
bool bMultiTab = false;
while( pPos )
diff --git a/sw/source/core/text/itrcrsr.cxx b/sw/source/core/text/itrcrsr.cxx
index b89ade928e9e..4103b8505b77 100644
--- a/sw/source/core/text/itrcrsr.cxx
+++ b/sw/source/core/text/itrcrsr.cxx
@@ -1769,10 +1769,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect
{
SwRect aRect( aTmpFrame );
aRect.Intersection( rRect );
- // rNode without const to create SwPaMs
- SwContentNode &rNode = const_cast<SwContentNode&>( *GetNode() );
- SwNodeIndex aIdx( rNode );
- SwPosition aPosL( aIdx, SwIndex( &rNode, 0 ) );
+ SwPosition aPosL( MapViewToModelPos(TextFrameIndex(0)) );
if( IsEmpty() )
{
SwPaM *pPam = new SwPaM( aPosL, aPosL );
@@ -1780,7 +1777,7 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect
}
else if( aRect.HasArea() )
{
- sal_Int32 nOld = -1;
+ SwPosition aOld(aPosL.nNode.GetNodes().GetEndOfContent());
SwPosition aPosR( aPosL );
Point aPoint;
SwTextInfo aInf( const_cast<SwTextFrame*>(this) );
@@ -1844,11 +1841,11 @@ bool SwTextFrame::FillSelection( SwSelectionList& rSelList, const SwRect& rRect
// which could happen e.g. for field portions or fly frames
// a SwPaM will be inserted with these positions
if( GetCursorOfst( &aPosR, aPoint, &aState ) &&
- nOld != aPosL.nContent.GetIndex() )
+ aOld != aPosL)
{
SwPaM *pPam = new SwPaM( aPosL, aPosR );
rSelList.insertPaM( pPam );
- nOld = aPosL.nContent.GetIndex();
+ aOld = aPosL;
}
}
}
diff --git a/sw/source/core/text/itrform2.cxx b/sw/source/core/text/itrform2.cxx
index 4080c85ce0ae..10aa3be6ff72 100644
--- a/sw/source/core/text/itrform2.cxx
+++ b/sw/source/core/text/itrform2.cxx
@@ -382,8 +382,8 @@ void SwTextFormatter::BuildPortions( SwTextFormatInfo &rInf )
GRID_LINES_CHARS == pGrid->GetGridType();
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
- const sal_uInt16 nGridWidth = bHasGrid ? GetGridWidth(*pGrid, *pDoc) : 0;
+ const SwDoc & rDoc = rInf.GetTextFrame()->GetDoc();
+ const sal_uInt16 nGridWidth = bHasGrid ? GetGridWidth(*pGrid, rDoc) : 0;
// used for grid mode only:
// the pointer is stored, because after formatting of non-asian text,
@@ -1392,7 +1392,7 @@ SwLinePortion *SwTextFormatter::NewPortion( SwTextFormatInfo &rInf )
if ( pTextFootnote )
{
SwFormatFootnote& rFootnote = const_cast<SwFormatFootnote&>(pTextFootnote->GetFootnote());
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
+ const SwDoc *const pDoc = &rInf.GetTextFrame()->GetDoc();
const SwEndNoteInfo* pInfo;
if( rFootnote.IsEndNote() )
pInfo = &pDoc->GetEndNoteInfo();
@@ -2432,8 +2432,8 @@ void SwTextFormatter::CalcFlyWidth( SwTextFormatInfo &rInf )
aRectFnSet.GetPrtLeft(*pBody) :
aRectFnSet.GetPrtLeft(*pPageFrame);
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
- const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, *pDoc);
+ const SwDoc & rDoc = rInf.GetTextFrame()->GetDoc();
+ const sal_uInt16 nGridWidth = GetGridWidth(*pGrid, rDoc);
SwTwips nStartX = GetLeftMargin();
if ( aRectFnSet.IsVert() )
diff --git a/sw/source/core/text/porlay.cxx b/sw/source/core/text/porlay.cxx
index 4834ca64739f..06baf68a148c 100644
--- a/sw/source/core/text/porlay.cxx
+++ b/sw/source/core/text/porlay.cxx
@@ -50,6 +50,7 @@
#include <redline.hxx>
#include <section.hxx>
#include <calbck.hxx>
+#include <doc.hxx>
#include <IDocumentRedlineAccess.hxx>
#include <IDocumentSettingAccess.hxx>
#include <IDocumentContentOperations.hxx>
@@ -322,7 +323,8 @@ void SwLineLayout::CalcLine( SwTextFormatter &rLine, SwTextFormatInfo &rInf )
// #i3952#
const bool bIgnoreBlanksAndTabsForLineHeightCalculation =
- rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess()->get(DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
+ rInf.GetTextFrame()->GetDoc().getIDocumentSettingAccess().get(
+ DocumentSettingId::IGNORE_TABS_AND_BLANKS_FOR_LINE_CALCULATION);
bool bHasBlankPortion = false;
bool bHasOnlyBlankPortions = true;
diff --git a/sw/source/core/text/txtfly.cxx b/sw/source/core/text/txtfly.cxx
index b0e43f9c6298..c7d3f891fa0d 100644
--- a/sw/source/core/text/txtfly.cxx
+++ b/sw/source/core/text/txtfly.cxx
@@ -1376,8 +1376,8 @@ css::text::WrapTextMode SwTextFly::GetSurroundForTextWrap( const SwAnchoredObjec
else
nRight = 0;
}
- const int textMin = GetMaster()->GetNode()
- ->getIDocumentSettingAccess()->get(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL )
+ const int textMin = GetMaster()->GetDoc()
+ .getIDocumentSettingAccess().get(DocumentSettingId::SURROUND_TEXT_WRAP_SMALL )
? TEXT_MIN_SMALL : TEXT_MIN;
// In case there is no space on either side, then css::text::WrapTextMode_PARALLEL
diff --git a/sw/source/core/text/txtfrm.cxx b/sw/source/core/text/txtfrm.cxx
index 7e9398bd5392..9dabd4d230bb 100644
--- a/sw/source/core/text/txtfrm.cxx
+++ b/sw/source/core/text/txtfrm.cxx
@@ -2029,7 +2029,7 @@ void SwTextFrame::SwClientNotify(SwModify const& rModify, SfxHint const& rHint)
} // switch
if( bSetFieldsDirty )
- GetNode()->getIDocumentFieldsAccess().SetFieldsDirty( true, GetNode(), 1 );
+ GetDoc().getIDocumentFieldsAccess().SetFieldsDirty( true, &rNode, 1 );
if ( bRecalcFootnoteFlag )
CalcFootnoteFlag();
@@ -2115,7 +2115,7 @@ void SwTextFrame::PrepWidows( const sal_uInt16 nNeed, bool bNotify )
static bool lcl_ErgoVadis(SwTextFrame* pFrame, TextFrameIndex & rPos, const PrepareHint ePrep)
{
- const SwFootnoteInfo &rFootnoteInfo = pFrame->GetNode()->GetDoc()->GetFootnoteInfo();
+ const SwFootnoteInfo &rFootnoteInfo = pFrame->GetDoc().GetFootnoteInfo();
if( ePrep == PREP_ERGOSUM )
{
if( rFootnoteInfo.aErgoSum.isEmpty() )
@@ -2266,7 +2266,7 @@ bool SwTextFrame::Prepare( const PrepareHint ePrep, const void* pVoid,
{
// We're the last Footnote; we need to update the
// QuoVadis texts now
- const SwFootnoteInfo &rFootnoteInfo = GetNode()->GetDoc()->GetFootnoteInfo();
+ const SwFootnoteInfo &rFootnoteInfo = GetDoc().GetFootnoteInfo();
if( !pPara->UpdateQuoVadis( rFootnoteInfo.aQuoVadis ) )
{
TextFrameIndex nPos = pPara->GetParLen();
@@ -3186,7 +3186,7 @@ void SwTextFrame::ChgThisLines()
{
// not necessary to format here (GerFormatted etc.), because we have to come from there!
sal_uLong nNew = 0;
- const SwLineNumberInfo &rInf = GetNode()->GetDoc()->GetLineNumberInfo();
+ const SwLineNumberInfo &rInf = GetDoc().GetLineNumberInfo();
if ( !GetText().isEmpty() && HasPara() )
{
SwTextSizeInfo aInf( this );
diff --git a/sw/source/core/text/txtftn.cxx b/sw/source/core/text/txtftn.cxx
index bd9cf48c0967..cb0ab2f2fdb4 100644
--- a/sw/source/core/text/txtftn.cxx
+++ b/sw/source/core/text/txtftn.cxx
@@ -123,7 +123,7 @@ bool SwTextFrame::CalcPrepFootnoteAdjust()
OSL_ENSURE( HasFootnote(), "Who´s calling me?" );
SwFootnoteBossFrame *pBoss = FindFootnoteBossFrame( true );
const SwFootnoteFrame *pFootnote = pBoss->FindFirstFootnote( this );
- if( pFootnote && FTNPOS_CHAPTER != GetNode()->GetDoc()->GetFootnoteInfo().ePos &&
+ if (pFootnote && FTNPOS_CHAPTER != GetDoc().GetFootnoteInfo().ePos &&
( !pBoss->GetUpper()->IsSctFrame() ||
!static_cast<SwSectionFrame*>(pBoss->GetUpper())->IsFootnoteAtEnd() ) )
{
@@ -411,8 +411,7 @@ void SwTextFrame::RemoveFootnote(TextFrameIndex const nStart, TextFrameIndex con
bool bRemove = false;
SwFootnoteBossFrame *pFootnoteBoss = nullptr;
SwFootnoteBossFrame *pEndBoss = nullptr;
- bool bFootnoteEndDoc
- = FTNPOS_CHAPTER == GetNode()->GetDoc()->GetFootnoteInfo().ePos;
+ bool bFootnoteEndDoc = FTNPOS_CHAPTER == GetDoc().GetFootnoteInfo().ePos;
SwTextNode const* pNode(nullptr);
sw::MergedAttrIterReverse iter(*this);
for (SwTextAttr const* pHt = iter.PrevAttr(&pNode); pHt; pHt = iter.PrevAttr(&pNode))
@@ -512,7 +511,7 @@ void SwTextFrame::RemoveFootnote(TextFrameIndex const nStart, TextFrameIndex con
else
{
if (!bEndDoc || ( bEndn && pEndBoss->IsInSct() &&
- !SwLayouter::Collecting( GetNode()->GetDoc(),
+ !SwLayouter::Collecting( &GetDoc(),
pEndBoss->FindSctFrame(), nullptr ) ))
{
if( bEndn )
@@ -602,7 +601,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
pSect = pBoss->FindSctFrame();
bool bDocEnd = bEnd ? !( pSect && pSect->IsEndnAtEnd() ) :
( !( pSect && pSect->IsFootnoteAtEnd() ) &&
- FTNPOS_CHAPTER == GetNode()->GetDoc()->GetFootnoteInfo().ePos );
+ FTNPOS_CHAPTER == GetDoc().GetFootnoteInfo().ePos);
// Footnote can be registered with the Follow
SwContentFrame *pSrcFrame = FindFootnoteRef( pFootnote );
@@ -624,7 +623,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
SwFootnoteFrame *pFootnoteFrame = pSrcFrame ? SwFootnoteBossFrame::FindFootnote( pSrcFrame, pFootnote ) : nullptr;
if( pFootnoteFrame && !pFootnoteFrame->GetUpper() )
pFootnoteFrame = nullptr;
- SwDoc *pDoc = GetNode()->GetDoc();
+ SwDoc *const pDoc = &GetDoc();
if( SwLayouter::Collecting( pDoc, pSect, pFootnoteFrame ) )
{
if( !pSrcFrame )
@@ -632,7 +631,7 @@ void SwTextFrame::ConnectFootnote( SwTextFootnote *pFootnote, const SwTwips nDea
SwFootnoteFrame *pNew = new SwFootnoteFrame(pDoc->GetDfltFrameFormat(),this,this,pFootnote);
SwNodeIndex aIdx( *pFootnote->GetStartNode(), 1 );
::InsertCnt_( pNew, pDoc, aIdx.GetIndex() );
- GetNode()->getIDocumentLayoutAccess().GetLayouter()->CollectEndnote( pNew );
+ pDoc->getIDocumentLayoutAccess().GetLayouter()->CollectEndnote( pNew );
}
else if( pSrcFrame != this )
SwFootnoteBossFrame::ChangeFootnoteRef( pSrcFrame, pFootnote, this );
@@ -776,7 +775,7 @@ SwFootnotePortion *SwTextFormatter::NewFootnotePortion( SwTextFormatInfo &rInf,
SwTextFootnote *pFootnote = static_cast<SwTextFootnote*>(pHint);
const SwFormatFootnote& rFootnote = pFootnote->GetFootnote();
- SwDoc *pDoc = m_pFrame->GetNode()->GetDoc();
+ SwDoc *const pDoc = &m_pFrame->GetDoc();
if( rInf.IsTest() )
return new SwFootnotePortion( rFootnote.GetViewNumStr( *pDoc ), pFootnote );
@@ -917,7 +916,7 @@ SwNumberPortion *SwTextFormatter::NewFootnoteNumPortion( SwTextFormatInfo const
// Aha! So we're in the Footnote Area!
SwFormatFootnote& rFootnote = const_cast<SwFormatFootnote&>(pFootnote->GetFootnote());
- SwDoc *pDoc = m_pFrame->GetNode()->GetDoc();
+ SwDoc *const pDoc = &m_pFrame->GetDoc();
OUString aFootnoteText( rFootnote.GetViewNumStr( *pDoc, true ));
const SwEndNoteInfo* pInfo;
@@ -971,7 +970,7 @@ SwErgoSumPortion *SwTextFormatter::NewErgoSumPortion( SwTextFormatInfo const &rI
return nullptr;
// we are in the footnote container
- const SwFootnoteInfo &rFootnoteInfo = m_pFrame->GetNode()->GetDoc()->GetFootnoteInfo();
+ const SwFootnoteInfo &rFootnoteInfo = m_pFrame->GetDoc().GetFootnoteInfo();
SwTextFrame *pQuoFrame = m_pFrame->FindQuoVadisFrame();
if( !pQuoFrame )
return nullptr;
@@ -1021,7 +1020,7 @@ TextFrameIndex SwTextFormatter::FormatQuoVadis(TextFrameIndex const nOffset)
}
SwTextFormatInfo &rInf = GetInfo();
- const SwFootnoteInfo &rFootnoteInfo = m_pFrame->GetNode()->GetDoc()->GetFootnoteInfo();
+ const SwFootnoteInfo &rFootnoteInfo = m_pFrame->GetDoc().GetFootnoteInfo();
if( rFootnoteInfo.aQuoVadis.isEmpty() )
return nOffset;
@@ -1240,7 +1239,7 @@ SwFootnoteSave::SwFootnoteSave( const SwTextSizeInfo &rInf,
pOld->GetTox() = pFnt->GetTox();
pFnt->GetTox() = 0;
SwFormatFootnote& rFootnote = const_cast<SwFormatFootnote&>(pTextFootnote->GetFootnote());
- const SwDoc *pDoc = rInf.GetTextFrame()->GetNode()->GetDoc();
+ const SwDoc *const pDoc = &rInf.GetTextFrame()->GetDoc();
// #i98418#
if ( bApplyGivenScriptType )
@@ -1260,7 +1259,7 @@ SwFootnoteSave::SwFootnoteSave( const SwTextSizeInfo &rInf,
else
pInfo = &pDoc->GetFootnoteInfo();
const SwAttrSet& rSet = pInfo->GetAnchorCharFormat(const_cast<SwDoc&>(*pDoc))->GetAttrSet();
- pFnt->SetDiffFnt( &rSet, rInf.GetTextFrame()->GetNode()->getIDocumentSettingAccess() );
+ pFnt->SetDiffFnt( &rSet, &pDoc->getIDocumentSettingAccess() );
// we reduce footnote size, if we are inside a double line portion
if ( ! pOld->GetEscapement() && 50 == pOld->GetPropr() )