From 55dfe2c12e450a90cbc05f9ec53f1ed6508d8de9 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 29 Sep 2020 20:50:43 +0100 Subject: SwNode::GetDoc can return a reference instead MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit and remove discovered redundant null checks Change-Id: I6b8bc9593434f38947e399a48888a8fa0d4f7e77 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103640 Tested-by: Jenkins Reviewed-by: Caolán McNamara --- sw/source/filter/html/htmlatr.cxx | 2 +- sw/source/filter/html/htmlnum.cxx | 2 +- sw/source/filter/html/htmlplug.cxx | 2 +- sw/source/filter/html/htmltab.cxx | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) (limited to 'sw/source/filter/html') diff --git a/sw/source/filter/html/htmlatr.cxx b/sw/source/filter/html/htmlatr.cxx index dd55897b2d8d..9a96233407b4 100644 --- a/sw/source/filter/html/htmlatr.cxx +++ b/sw/source/filter/html/htmlatr.cxx @@ -2240,7 +2240,7 @@ Writer& OutHTML_SwTextNode( Writer& rWrt, const SwContentNode& rNode ) // export numbering string as plain text only for the outline numbering, // because the outline numbering isn't exported as a numbering - see if ( pNd->IsOutline() && - pNd->GetNumRule() == pNd->GetDoc()->GetOutlineNumRule() ) + pNd->GetNumRule() == pNd->GetDoc().GetOutlineNumRule() ) { aOutlineText = pNd->GetNumString(); nOffset = nOffset + aOutlineText.getLength(); diff --git a/sw/source/filter/html/htmlnum.cxx b/sw/source/filter/html/htmlnum.cxx index 840fd61e88bd..9d5ed50d57e7 100644 --- a/sw/source/filter/html/htmlnum.cxx +++ b/sw/source/filter/html/htmlnum.cxx @@ -25,7 +25,7 @@ void SwHTMLNumRuleInfo::Set( const SwTextNode& rTextNd ) { const SwNumRule* pTextNdNumRule( rTextNd.GetNumRule() ); if ( pTextNdNumRule && - pTextNdNumRule != rTextNd.GetDoc()->GetOutlineNumRule() ) + pTextNdNumRule != rTextNd.GetDoc().GetOutlineNumRule() ) { pNumRule = const_cast(pTextNdNumRule); nDeep = static_cast< sal_uInt16 >(pNumRule ? rTextNd.GetActualListLevel() + 1 : 0); diff --git a/sw/source/filter/html/htmlplug.cxx b/sw/source/filter/html/htmlplug.cxx index 265deafe963f..645ecbd1b358 100644 --- a/sw/source/filter/html/htmlplug.cxx +++ b/sw/source/filter/html/htmlplug.cxx @@ -514,7 +514,7 @@ bool SwHTMLParser::InsertEmbed() Size aTwipSize(pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapTwip))); SwFormatFrameSize aFrameSize(SwFrameSize::Fixed, aTwipSize.Width(), aTwipSize.Height()); aAttrSet.Put(aFrameSize); - pOLENode->GetDoc()->SetFlyFrameAttr(*pFormat, aAttrSet); + pOLENode->GetDoc().SetFlyFrameAttr(*pFormat, aAttrSet); return true; } diff --git a/sw/source/filter/html/htmltab.cxx b/sw/source/filter/html/htmltab.cxx index 65cdc272d118..6207967f3677 100644 --- a/sw/source/filter/html/htmltab.cxx +++ b/sw/source/filter/html/htmltab.cxx @@ -4945,13 +4945,13 @@ void SwHTMLParser::ClearFootnotesMarksInRange(const SwNodeIndex& rMkNdIdx, const //follow DelFlyInRange pattern here assert(rMkNdIdx.GetIndex() <= rPtNdIdx.GetIndex()); - SwDoc* pDoc = rMkNdIdx.GetNode().GetDoc(); + SwDoc& rDoc = rMkNdIdx.GetNode().GetDoc(); //ofz#9733 drop bookmarks in this range - IDocumentMarkAccess* const pMarkAccess = pDoc->getIDocumentMarkAccess(); + IDocumentMarkAccess* const pMarkAccess = rDoc.getIDocumentMarkAccess(); pMarkAccess->deleteMarks(rMkNdIdx, SwNodeIndex(rPtNdIdx, 1), nullptr, nullptr, nullptr); - SwFrameFormats& rTable = *pDoc->GetSpzFrameFormats(); + SwFrameFormats& rTable = *rDoc.GetSpzFrameFormats(); for ( auto i = rTable.size(); i; ) { SwFrameFormat *pFormat = rTable[--i]; -- cgit v1.2.3