summaryrefslogtreecommitdiff
path: root/sw/source/filter
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-10-01 20:53:10 +0100
committerCaolán McNamara <caolanm@redhat.com>2020-10-02 14:19:32 +0200
commit792eb7a903b48a6209b2d08dd728dcf9a8096449 (patch)
treec254147c430d4cfac8249d73f8d336e5eac01965 /sw/source/filter
parentd2f9c55e065d559de903d540da28502646714a24 (diff)
SwWW8FltAnchorStack ctor never given a null SwDoc*
and similar Change-Id: I046be0e41b79f2fd51ebec0da20fccb17d947732 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103823 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw/source/filter')
-rw-r--r--sw/source/filter/basflt/fltshell.cxx84
-rw-r--r--sw/source/filter/inc/fltshell.hxx12
-rw-r--r--sw/source/filter/ww8/writerhelper.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par.cxx32
-rw-r--r--sw/source/filter/ww8/ww8par.hxx16
-rw-r--r--sw/source/filter/ww8/ww8par5.cxx2
-rw-r--r--sw/source/filter/ww8/ww8par6.cxx4
7 files changed, 76 insertions, 76 deletions
diff --git a/sw/source/filter/basflt/fltshell.cxx b/sw/source/filter/basflt/fltshell.cxx
index ceae383380af..4093ae3999be 100644
--- a/sw/source/filter/basflt/fltshell.cxx
+++ b/sw/source/filter/basflt/fltshell.cxx
@@ -51,14 +51,14 @@
using namespace com::sun::star;
-static SwContentNode* GetContentNode(SwDoc* pDoc, SwNodeIndex& rIdx, bool bNext)
+static SwContentNode* GetContentNode(SwDoc& rDoc, SwNodeIndex& rIdx, bool bNext)
{
SwContentNode * pCNd = rIdx.GetNode().GetContentNode();
- if(!pCNd && nullptr == (pCNd = bNext ? pDoc->GetNodes().GoNext(&rIdx)
+ if(!pCNd && nullptr == (pCNd = bNext ? rDoc.GetNodes().GoNext(&rIdx)
: SwNodes::GoPrevious(&rIdx)))
{
pCNd = bNext ? SwNodes::GoPrevious(&rIdx)
- : pDoc->GetNodes().GoNext(&rIdx);
+ : rDoc.GetNodes().GoNext(&rIdx);
OSL_ENSURE(pCNd, "no ContentNode found");
}
return pCNd;
@@ -105,7 +105,7 @@ void SwFltStackEntry::SetEndPos(const SwPosition& rEndPos)
m_aPtPos.SetPos(rEndPos);
}
-bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, RegionMode const eCheck,
+bool SwFltStackEntry::MakeRegion(SwDoc& rDoc, SwPaM& rRegion, RegionMode const eCheck,
const SwFltPosition &rMkPos, const SwFltPosition &rPtPos, bool bIsParaEnd,
sal_uInt16 nWhich)
{
@@ -131,7 +131,7 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, RegionMode const e
}
// The content indices always apply to the node!
rRegion.GetPoint()->nNode = rMkPos.m_nNode.GetIndex() + 1;
- SwContentNode* pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, true);
+ SwContentNode* pCNd = GetContentNode(rDoc, rRegion.GetPoint()->nNode, true);
SAL_WARN_IF(pCNd->Len() < rMkPos.m_nContent, "sw.ww8",
"invalid content index " << rMkPos.m_nContent << " but text node has only " << pCNd->Len());
@@ -145,7 +145,7 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, RegionMode const e
if (n >= rNodes.Count())
return false;
rRegion.GetPoint()->nNode = n;
- pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, false);
+ pCNd = GetContentNode(rDoc, rRegion.GetPoint()->nNode, false);
}
SAL_WARN_IF(pCNd->Len() < rPtPos.m_nContent, "sw.ww8",
"invalid content index " << rPtPos.m_nContent << " but text node has only " << pCNd->Len());
@@ -167,14 +167,14 @@ bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, RegionMode const e
return bRet;
}
-bool SwFltStackEntry::MakeRegion(SwDoc* pDoc, SwPaM& rRegion, RegionMode eCheck) const
+bool SwFltStackEntry::MakeRegion(SwDoc& rDoc, SwPaM& rRegion, RegionMode eCheck) const
{
- return MakeRegion(pDoc, rRegion, eCheck, m_aMkPos, m_aPtPos, bIsParaEnd,
+ return MakeRegion(rDoc, rRegion, eCheck, m_aMkPos, m_aPtPos, bIsParaEnd,
pAttr->Which());
}
-SwFltControlStack::SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl)
- : nFieldFlags(nFieldFl),bHasSdOD(true), bSdODChecked(false), pDoc(pDo), bIsEndStack(false)
+SwFltControlStack::SwFltControlStack(SwDoc& rDo, sal_uLong nFieldFl)
+ : nFieldFlags(nFieldFl),bHasSdOD(true), bSdODChecked(false), rDoc(rDo), bIsEndStack(false)
{
}
@@ -206,7 +206,7 @@ void SwFltControlStack::MoveAttrs(const SwPosition& rPos, MoveAttrsMode eMode)
{
rEntry.m_aMkPos.m_nContent++;
OSL_ENSURE( rEntry.m_aMkPos.m_nContent
- <= pDoc->GetNodes()[nPosNd]->GetContentNode()->Len(),
+ <= rDoc.GetNodes()[nPosNd]->GetContentNode()->Len(),
"Attribute ends after end of line" );
}
if (
@@ -227,7 +227,7 @@ void SwFltControlStack::MoveAttrs(const SwPosition& rPos, MoveAttrsMode eMode)
}
rEntry.m_aPtPos.m_nContent++;
OSL_ENSURE( rEntry.m_aPtPos.m_nContent
- <= pDoc->GetNodes()[nPosNd]->GetContentNode()->Len(),
+ <= rDoc.GetNodes()[nPosNd]->GetContentNode()->Len(),
"Attribute ends after end of line" );
}
}
@@ -444,7 +444,7 @@ SwFltStackEntry* SwFltControlStack::SetAttr(const SwPosition& rPos,
return pRet;
}
-static bool MakePoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
+static bool MakePoint(const SwFltStackEntry& rEntry, SwDoc& rDoc,
SwPaM& rRegion)
{
// the anchor is the Pam's Point. It's modified when inserting
@@ -458,7 +458,7 @@ static bool MakePoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
return false;
rRegion.GetPoint()->nNode = nMk;
- SwContentNode* pCNd = GetContentNode(pDoc, rRegion.GetPoint()->nNode, true);
+ SwContentNode* pCNd = GetContentNode(rDoc, rRegion.GetPoint()->nNode, true);
rRegion.GetPoint()->nContent.Assign(pCNd, rEntry.m_aMkPos.m_nContent);
return true;
}
@@ -466,10 +466,10 @@ static bool MakePoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
// MakeBookRegionOrPoint() behaves like MakeRegionOrPoint, except that
// it adheres to certain restrictions on bookmarks in tables (cannot
// span more than one cell)
-static bool MakeBookRegionOrPoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
+static bool MakeBookRegionOrPoint(const SwFltStackEntry& rEntry, SwDoc& rDoc,
SwPaM& rRegion )
{
- if (rEntry.MakeRegion(pDoc, rRegion, SwFltStackEntry::RegionMode::CheckNodes))
+ if (rEntry.MakeRegion(rDoc, rRegion, SwFltStackEntry::RegionMode::CheckNodes))
{
if (rRegion.GetPoint()->nNode.GetNode().FindTableBoxStartNode()
!= rRegion.GetMark()->nNode.GetNode().FindTableBoxStartNode())
@@ -479,7 +479,7 @@ static bool MakeBookRegionOrPoint(const SwFltStackEntry& rEntry, SwDoc* pDoc,
}
return true;
}
- return MakePoint(rEntry, pDoc, rRegion);
+ return MakePoint(rEntry, rDoc, rRegion);
}
// IterateNumrulePiece() looks for the first range valid for Numrules
@@ -542,13 +542,13 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
SwFrameFormat* pFormat = static_cast<SwFltAnchor*>(rEntry.pAttr.get())->GetFrameFormat();
if (pFormat != nullptr)
{
- MakePoint(rEntry, pDoc, aRegion);
+ MakePoint(rEntry, rDoc, aRegion);
SwFormatAnchor aAnchor(pFormat->GetAnchor());
aAnchor.SetAnchor(aRegion.GetPoint());
pFormat->SetFormatAttr(aAnchor);
// So the frames will be created when inserting into
// existing doc (after setting the anchor!):
- if(pDoc->getIDocumentLayoutAccess().GetCurrentViewShell()
+ if (rDoc.getIDocumentLayoutAccess().GetCurrentViewShell()
&& (RndStdIds::FLY_AT_PARA == pFormat->GetAnchor().GetAnchorId()))
{
pFormat->MakeFrames();
@@ -568,10 +568,10 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
case RES_FLTR_NUMRULE: // insert Numrule
{
const OUString& rNumNm = static_cast<SfxStringItem*>(rEntry.pAttr.get())->GetValue();
- SwNumRule* pNumRule = pDoc->FindNumRulePtr( rNumNm );
+ SwNumRule* pNumRule = rDoc.FindNumRulePtr( rNumNm );
if( pNumRule )
{
- if (rEntry.MakeRegion(pDoc, aRegion, SwFltStackEntry::RegionMode::CheckNodes))
+ if (rEntry.MakeRegion(rDoc, aRegion, SwFltStackEntry::RegionMode::CheckNodes))
{
SwNodeIndex aTmpStart( aRegion.Start()->nNode );
SwNodeIndex aTmpEnd( aTmpStart );
@@ -581,14 +581,14 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
{
SwPaM aTmpPam( aTmpStart, aTmpEnd );
// no start of a new list
- pDoc->SetNumRule( aTmpPam, *pNumRule, false );
+ rDoc.SetNumRule( aTmpPam, *pNumRule, false );
aTmpStart = aTmpEnd; // here starts the next range
++aTmpStart;
}
}
else
- pDoc->DelNumRule( rNumNm );
+ rDoc.DelNumRule( rNumNm );
}
}
break;
@@ -600,35 +600,35 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
if (IsFlagSet(BOOK_TO_VAR_REF))
{
- SwFieldType* pFT = pDoc->getIDocumentFieldsAccess().GetFieldType(SwFieldIds::SetExp, rName, false);
+ SwFieldType* pFT = rDoc.getIDocumentFieldsAccess().GetFieldType(SwFieldIds::SetExp, rName, false);
if (!pFT)
{
- SwSetExpFieldType aS(pDoc, rName, nsSwGetSetExpType::GSE_STRING);
- pFT = pDoc->getIDocumentFieldsAccess().InsertFieldType(aS);
+ SwSetExpFieldType aS(&rDoc, rName, nsSwGetSetExpType::GSE_STRING);
+ pFT = rDoc.getIDocumentFieldsAccess().InsertFieldType(aS);
}
SwSetExpField aField(static_cast<SwSetExpFieldType*>(pFT), pB->GetValSys());
aField.SetSubType( nsSwExtendedSubType::SUB_INVISIBLE );
- MakePoint(rEntry, pDoc, aRegion);
- pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, SwFormatField(aField));
+ MakePoint(rEntry, rDoc, aRegion);
+ rDoc.getIDocumentContentOperations().InsertPoolItem(aRegion, SwFormatField(aField));
MoveAttrs( *(aRegion.GetPoint()) );
}
if ( ( !IsFlagSet(HYPO) || IsFlagSet(BOOK_AND_REF) ) &&
!rEntry.bConsumedByField )
{
- MakeBookRegionOrPoint(rEntry, pDoc, aRegion);
+ MakeBookRegionOrPoint(rEntry, rDoc, aRegion);
// #i120879# - create a cross reference heading bookmark if appropriate.
const IDocumentMarkAccess::MarkType eBookmarkType =
( pB->IsTOCBookmark() &&
IDocumentMarkAccess::IsLegalPaMForCrossRefHeadingBookmark( aRegion ) )
? IDocumentMarkAccess::MarkType::CROSSREF_HEADING_BOOKMARK
: IDocumentMarkAccess::MarkType::BOOKMARK;
- pDoc->getIDocumentMarkAccess()->makeMark(aRegion, rName, eBookmarkType, sw::mark::InsertMode::New);
+ rDoc.getIDocumentMarkAccess()->makeMark(aRegion, rName, eBookmarkType, sw::mark::InsertMode::New);
}
}
break;
case RES_FLTR_ANNOTATIONMARK:
{
- if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion))
+ if (MakeBookRegionOrPoint(rEntry, rDoc, aRegion))
{
SwTextNode const*const pTextNode(
aRegion.End()->nNode.GetNode().GetTextNode());
@@ -653,7 +653,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
--aRegion.Start()->nContent;
}
- pDoc->getIDocumentMarkAccess()->makeAnnotationMark(aRegion, OUString());
+ rDoc.getIDocumentMarkAccess()->makeAnnotationMark(aRegion, OUString());
}
else
{
@@ -671,7 +671,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
break;
case RES_FLTR_RDFMARK:
{
- if (MakeBookRegionOrPoint(rEntry, pDoc, aRegion))
+ if (MakeBookRegionOrPoint(rEntry, rDoc, aRegion))
{
SwFltRDFMark* pMark = static_cast<SwFltRDFMark*>(rEntry.pAttr.get());
if (aRegion.GetNode().IsTextNode())
@@ -695,7 +695,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
break;
case RES_FLTR_TOX:
{
- MakePoint(rEntry, pDoc, aRegion);
+ MakePoint(rEntry, rDoc, aRegion);
SwPosition* pPoint = aRegion.GetPoint();
@@ -703,7 +703,7 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
// test if on this node there had been a pagebreak BEFORE the
// tox attribute was put on the stack
- SfxItemSet aBkSet( pDoc->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_BREAK>{} );
+ SfxItemSet aBkSet( rDoc.GetAttrPool(), svl::Items<RES_PAGEDESC, RES_BREAK>{} );
SwContentNode* pNd = nullptr;
if( !pTOXAttr->HadBreakItem() || !pTOXAttr->HadPageDescItem() )
{
@@ -737,10 +737,10 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
break;
case RES_FLTR_REDLINE:
{
- if (rEntry.MakeRegion(pDoc, aRegion,
+ if (rEntry.MakeRegion(rDoc, aRegion,
SwFltStackEntry::RegionMode::CheckNodes|SwFltStackEntry::RegionMode::CheckFieldmark))
{
- pDoc->getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::On
+ rDoc.getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::On
| RedlineFlags::ShowInsert
| RedlineFlags::ShowDelete );
SwFltRedline& rFltRedline = *static_cast<SwFltRedline*>(rEntry.pAttr.get());
@@ -751,8 +751,8 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
OUString(),
nullptr
);
- pDoc->getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline(aData, aRegion), true );
- pDoc->getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::NONE
+ rDoc.getIDocumentRedlineAccess().AppendRedline( new SwRangeRedline(aData, aRegion), true );
+ rDoc.getIDocumentRedlineAccess().SetRedlineFlags( RedlineFlags::NONE
| RedlineFlags::ShowInsert
| RedlineFlags::ShowDelete );
}
@@ -772,15 +772,15 @@ void SwFltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
{
rEntry.SetIsParaEnd( IsParaEndInCPs(nStart,nEnd,bHasSdOD) );
}
- if (rEntry.MakeRegion(pDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck))
+ if (rEntry.MakeRegion(rDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck))
{
if (rEntry.IsParaEnd())
{
- pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, nullptr, true);
+ rDoc.getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr, SetAttrMode::DEFAULT, nullptr, true);
}
else
{
- pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr);
+ rDoc.getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr);
}
}
}
diff --git a/sw/source/filter/inc/fltshell.hxx b/sw/source/filter/inc/fltshell.hxx
index 615917929475..338de25fcddd 100644
--- a/sw/source/filter/inc/fltshell.hxx
+++ b/sw/source/filter/inc/fltshell.hxx
@@ -102,8 +102,8 @@ public:
enum class RegionMode { NoCheck = 0, CheckNodes = 1<<0, CheckFieldmark = 1<<1 };
SW_DLLPUBLIC void SetEndPos( const SwPosition & rEndPos);
- SW_DLLPUBLIC bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion, RegionMode eCheck) const;
- SW_DLLPUBLIC static bool MakeRegion(SwDoc* pDoc, SwPaM& rRegion,
+ SW_DLLPUBLIC bool MakeRegion(SwDoc& rDoc, SwPaM& rRegion, RegionMode eCheck) const;
+ SW_DLLPUBLIC static bool MakeRegion(SwDoc& rDoc, SwPaM& rRegion,
RegionMode eCheck, const SwFltPosition &rMkPos, const SwFltPosition &rPtPos, bool bIsParaEnd=false,
sal_uInt16 nWhich=0);
@@ -132,7 +132,7 @@ private:
bool bSdODChecked;
protected:
- SwDoc* pDoc;
+ SwDoc& rDoc;
bool bIsEndStack;
virtual void SetAttrInDoc(const SwPosition& rTmpPos, SwFltStackEntry& rEntry);
@@ -158,7 +158,7 @@ public:
ALLOW_FLD_CR
};
- SwFltControlStack(SwDoc* pDo, sal_uLong nFieldFl);
+ SwFltControlStack(SwDoc& rDo, sal_uLong nFieldFl);
virtual ~SwFltControlStack();
bool IsFlagSet(Flags no) const { return ::SwFltGetFlag(nFieldFlags, no);}
@@ -299,8 +299,8 @@ public:
class SwFltEndStack : public SwFltControlStack
{
public:
- SwFltEndStack(SwDoc* pDo, sal_uLong nFieldFl)
- :SwFltControlStack(pDo, nFieldFl)
+ SwFltEndStack(SwDoc& rDo, sal_uLong nFieldFl)
+ :SwFltControlStack(rDo, nFieldFl)
{
bIsEndStack = true;
}
diff --git a/sw/source/filter/ww8/writerhelper.cxx b/sw/source/filter/ww8/writerhelper.cxx
index bed5a4eeb23d..7416b176bbef 100644
--- a/sw/source/filter/ww8/writerhelper.cxx
+++ b/sw/source/filter/ww8/writerhelper.cxx
@@ -794,7 +794,7 @@ namespace sw
void SetInDocAndDelete::operator()(std::unique_ptr<SwFltStackEntry>& pEntry)
{
SwPaM aRegion(pEntry->m_aMkPos.m_nNode);
- if (pEntry->MakeRegion(&mrDoc, aRegion,
+ if (pEntry->MakeRegion(mrDoc, aRegion,
SwFltStackEntry::RegionMode::CheckNodes|SwFltStackEntry::RegionMode::CheckFieldmark) &&
(*aRegion.GetPoint() != *aRegion.GetMark())
)
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 95004ec747c7..450e2f62916f 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -1299,7 +1299,7 @@ const SwNumFormat* SwWW8FltControlStack::GetNumFormatFromStack(const SwPosition
if (rTextNode.IsCountedInList())
{
OUString sName(static_cast<const SfxStringItem*>(pItem)->GetValue());
- const SwNumRule *pRule = pDoc->FindNumRulePtr(sName);
+ const SwNumRule *pRule = rDoc.FindNumRulePtr(sName);
if (pRule)
pRet = GetNumFormatFromSwNumRuleLevel(*pRule, rTextNode.GetActualListLevel());
}
@@ -1383,14 +1383,14 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
paragraph indent to be relative to the new paragraph indent
*/
SwPaM aRegion(rTmpPos);
- if (rEntry.MakeRegion(pDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck))
+ if (rEntry.MakeRegion(rDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck))
{
SvxLRSpaceItem aNewLR( *static_cast<SvxLRSpaceItem*>(rEntry.pAttr.get()) );
sal_uLong nStart = aRegion.Start()->nNode.GetIndex();
sal_uLong nEnd = aRegion.End()->nNode.GetIndex();
for(; nStart <= nEnd; ++nStart)
{
- SwNode* pNode = pDoc->GetNodes()[ nStart ];
+ SwNode* pNode = rDoc.GetNodes()[ nStart ];
if (!pNode || !pNode->IsTextNode())
continue;
@@ -1449,7 +1449,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
case RES_TXTATR_INETFMT:
{
SwPaM aRegion(rTmpPos);
- if (rEntry.MakeRegion(pDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck))
+ if (rEntry.MakeRegion(rDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck))
{
SwFrameFormat *pFrame;
// If we have just one single inline graphic then
@@ -1467,7 +1467,7 @@ void SwWW8FltControlStack::SetAttrInDoc(const SwPosition& rTmpPos,
}
else
{
- pDoc->getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr);
+ rDoc.getIDocumentContentOperations().InsertPoolItem(aRegion, *rEntry.pAttr);
}
}
}
@@ -1486,7 +1486,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
{
SwContentNode const*const pNd = rPos.nNode.GetNode().GetContentNode();
if (!pNd)
- pItem = &pDoc->GetAttrPool().GetDefaultItem(nWhich);
+ pItem = &rDoc.GetAttrPool().GetDefaultItem(nWhich);
else
{
/*
@@ -1511,7 +1511,7 @@ const SfxPoolItem* SwWW8FltControlStack::GetFormatAttr(const SwPosition& rPos,
if (pNd->IsTextNode())
{
const sal_Int32 nPos = rPos.nContent.GetIndex();
- m_xScratchSet.reset(new SfxItemSet(pDoc->GetAttrPool(), {{nWhich, nWhich}}));
+ m_xScratchSet.reset(new SfxItemSet(rDoc.GetAttrPool(), {{nWhich, nWhich}}));
if (pNd->GetTextNode()->GetParaAttr(*m_xScratchSet, nPos, nPos))
pItem = m_xScratchSet->GetItem(nWhich);
}
@@ -1564,7 +1564,7 @@ bool SwWW8FltRefStack::IsFootnoteEdnBkmField(
&& ((REF_FOOTNOTE == (nSubType = pField->GetSubType())) || (REF_ENDNOTE == nSubType))
&& !static_cast<const SwGetRefField*>(pField)->GetSetRefName().isEmpty())
{
- const IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess();
+ const IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess();
IDocumentMarkAccess::const_iterator_t ppBkmk =
pMarkAccess->findMark( static_cast<const SwGetRefField*>(pField)->GetSetRefName() );
if(ppBkmk != pMarkAccess->getAllMarksEnd())
@@ -1602,7 +1602,7 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
sal_uInt16 nBkmNo;
if( IsFootnoteEdnBkmField(rFormatField, nBkmNo) )
{
- ::sw::mark::IMark const * const pMark = pDoc->getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
+ ::sw::mark::IMark const * const pMark = rDoc.getIDocumentMarkAccess()->getAllMarksBegin()[nBkmNo];
const SwPosition& rBkMrkPos = pMark->GetMarkPos();
@@ -1624,7 +1624,7 @@ void SwWW8FltRefStack::SetAttrInDoc(const SwPosition& rTmpPos,
}
}
- pDoc->getIDocumentContentOperations().InsertPoolItem(aPaM, *rEntry.pAttr);
+ rDoc.getIDocumentContentOperations().InsertPoolItem(aPaM, *rEntry.pAttr);
MoveAttrs(*aPaM.GetPoint());
}
break;
@@ -2041,12 +2041,12 @@ WW8ReaderSave::WW8ReaderSave(SwWW8ImplReader* pRdr ,WW8_CP nStartCp) :
pRdr->m_pPrevNumRule = nullptr;
pRdr->m_nCurrentColl = 0;
- pRdr->m_xCtrlStck.reset(new SwWW8FltControlStack(&pRdr->m_rDoc, pRdr->m_nFieldFlags,
+ pRdr->m_xCtrlStck.reset(new SwWW8FltControlStack(pRdr->m_rDoc, pRdr->m_nFieldFlags,
*pRdr));
pRdr->m_xRedlineStack.reset(new sw::util::RedlineStack(pRdr->m_rDoc));
- pRdr->m_xAnchorStck.reset(new SwWW8FltAnchorStack(&pRdr->m_rDoc, pRdr->m_nFieldFlags));
+ pRdr->m_xAnchorStck.reset(new SwWW8FltAnchorStack(pRdr->m_rDoc, pRdr->m_nFieldFlags));
// Save the attribute manager: we need this as the newly created PLCFx Manager
// access the same FKPs as the old one and their Start-End position changes.
@@ -5034,7 +5034,7 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
m_pPaM = mpCursor.get();
- m_xCtrlStck.reset(new SwWW8FltControlStack(&m_rDoc, m_nFieldFlags, *this));
+ m_xCtrlStck.reset(new SwWW8FltControlStack(m_rDoc, m_nFieldFlags, *this));
m_xRedlineStack.reset(new sw::util::RedlineStack(m_rDoc));
@@ -5042,10 +5042,10 @@ ErrCode SwWW8ImplReader::CoreLoad(WW8Glossary const *pGloss)
RefFieldStck: Keeps track of bookmarks which may be inserted as
variables instead.
*/
- m_xReffedStck.reset(new SwWW8ReferencedFltEndStack(&m_rDoc, m_nFieldFlags));
- m_xReffingStck.reset(new SwWW8FltRefStack(&m_rDoc, m_nFieldFlags));
+ m_xReffedStck.reset(new SwWW8ReferencedFltEndStack(m_rDoc, m_nFieldFlags));
+ m_xReffingStck.reset(new SwWW8FltRefStack(m_rDoc, m_nFieldFlags));
- m_xAnchorStck.reset(new SwWW8FltAnchorStack(&m_rDoc, m_nFieldFlags));
+ m_xAnchorStck.reset(new SwWW8FltAnchorStack(m_rDoc, m_nFieldFlags));
size_t nPageDescOffset = m_rDoc.GetPageDescCnt();
diff --git a/sw/source/filter/ww8/ww8par.hxx b/sw/source/filter/ww8/ww8par.hxx
index 89cd22a60ddc..cad9f5e9b03d 100644
--- a/sw/source/filter/ww8/ww8par.hxx
+++ b/sw/source/filter/ww8/ww8par.hxx
@@ -382,8 +382,8 @@ protected:
virtual bool CheckSdOD(sal_Int32 nStart,sal_Int32 nEnd) override;
public:
- SwWW8FltControlStack(SwDoc* pDo, sal_uLong nFieldFl, SwWW8ImplReader& rReader_ )
- : SwFltControlStack( pDo, nFieldFl ), rReader( rReader_ ),
+ SwWW8FltControlStack(SwDoc& rDo, sal_uLong nFieldFl, SwWW8ImplReader& rReader_ )
+ : SwFltControlStack( rDo, nFieldFl ), rReader( rReader_ ),
nToggleAttrFlags(0), nToggleBiDiAttrFlags(0)
{}
@@ -427,8 +427,8 @@ public:
class SwWW8FltAnchorStack : public SwFltControlStack
{
public:
- SwWW8FltAnchorStack(SwDoc* pDo, sal_uLong nFieldFl)
- : SwFltControlStack( pDo, nFieldFl ) {}
+ SwWW8FltAnchorStack(SwDoc& rDo, sal_uLong nFieldFl)
+ : SwFltControlStack( rDo, nFieldFl ) {}
void AddAnchor(const SwPosition& rPos,SwFrameFormat *pFormat);
void Flush();
private:
@@ -459,8 +459,8 @@ namespace SwWW8
class SwWW8ReferencedFltEndStack : public SwFltEndStack
{
public:
- SwWW8ReferencedFltEndStack( SwDoc* pDo, sal_uLong nFieldFl )
- : SwFltEndStack( pDo, nFieldFl )
+ SwWW8ReferencedFltEndStack( SwDoc& rDo, sal_uLong nFieldFl )
+ : SwFltEndStack( rDo, nFieldFl )
, aReferencedTOCBookmarks()
{}
@@ -475,8 +475,8 @@ protected:
class SwWW8FltRefStack final : public SwFltEndStack
{
public:
- SwWW8FltRefStack(SwDoc* pDo, sal_uLong nFieldFl)
- : SwFltEndStack( pDo, nFieldFl )
+ SwWW8FltRefStack(SwDoc& rDo, sal_uLong nFieldFl)
+ : SwFltEndStack( rDo, nFieldFl )
, aFieldVarNames()
{}
bool IsFootnoteEdnBkmField(const SwFormatField& rFormatField, sal_uInt16& rBkmNo);
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 42827b1bbadc..94fd99994dea 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -1331,7 +1331,7 @@ SwFltStackEntry *SwWW8FltRefStack::RefToVar(const SwField* pField,
if (aResult != aFieldVarNames.end())
{
SwGetExpField aField( static_cast<SwGetExpFieldType*>(
- pDoc->getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::GetExp)), sName, nsSwGetSetExpType::GSE_STRING, 0);
+ rDoc.getIDocumentFieldsAccess().GetSysFieldType(SwFieldIds::GetExp)), sName, nsSwGetSetExpType::GSE_STRING, 0);
SwFormatField aTmp(aField);
rEntry.pAttr.reset( aTmp.Clone() );
pRet = &rEntry;
diff --git a/sw/source/filter/ww8/ww8par6.cxx b/sw/source/filter/ww8/ww8par6.cxx
index 8d7edf6ac1c8..b72ca39c84fe 100644
--- a/sw/source/filter/ww8/ww8par6.cxx
+++ b/sw/source/filter/ww8/ww8par6.cxx
@@ -2478,7 +2478,7 @@ bool SwWW8ImplReader::StartApo(const ApoTestResults &rApo, const WW8_TablePos *p
//frame, which makes no sense, restore them after the frame is
//closed
m_xSFlyPara->xOldAnchorStck = std::move(m_xAnchorStck);
- m_xAnchorStck.reset(new SwWW8FltAnchorStack(&m_rDoc, m_nFieldFlags));
+ m_xAnchorStck.reset(new SwWW8FltAnchorStack(m_rDoc, m_nFieldFlags));
if (m_xSFlyPara->pFlyFormat)
MoveInsideFly(m_xSFlyPara->pFlyFormat);
@@ -3424,7 +3424,7 @@ bool SwWW8ImplReader::ConvertSubToGraphicPlacement()
SwFltPosition aPtPos(*m_pPaM->GetPoint());
SwFrameFormat *pFlyFormat = nullptr;
- if (SwFltStackEntry::MakeRegion(&m_rDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck, aMkPos, aPtPos)
+ if (SwFltStackEntry::MakeRegion(m_rDoc, aRegion, SwFltStackEntry::RegionMode::NoCheck, aMkPos, aPtPos)
&& nullptr != (pFlyFormat = ContainsSingleInlineGraphic(aRegion)))
{
m_xCtrlStck->DeleteAndDestroy(nPos);